I'm trying to find a structural break in my time series using the breakpoints()
function (in the strucchange
package). My goal is to find where is "knot" in my dataset. I'm looking for a procedure which would test all possible knots and choose the one who minimize an information criterion such AIC or BIC. breakpoints()
does a good job but I would like to draw a continuous piecewise linear function. This, I would like the intercept to be the same before and after the breakpoint. Is anyone aware of a function or an option to do this ?
On the picture below, the red line is the true model and the blue line is fitted using breakpoints()
. I would like a procedure which would fit the true model (no jump at the breakpoint).
See my gist file to reproduce this example.