if (FALSE) {
# simulated curve with an upward jump at .7
n = 1000
x = seq(1/n, 1, length = n)
set.seed(123)
y = 4 * sin(5 * x) + 3 * x + (x >= .7) + rnorm(n, sd = 1)
ans = changept(y ~ jp(x))
plot(ans)
}
Run the code above in your browser using DataLab