# Example: clustering data generated from a Gaussian
# mixture model of three components
x <- c(rnorm(50, mean=-1, sd=0.3),
rnorm(50, mean=1, sd=0.3),
rnorm(50, mean=3, sd=0.3))
y <- x^3
res <- Cksegs.1d.dp(y, x=x)
plot(res, lwd=2)
Run the code above in your browser using DataLab