[R] Breakpoints and non linear regression

Achim Zeileis Achim.Zeileis at uibk.ac.at
Fri Nov 9 20:00:33 CET 2012


On Fri, 9 Nov 2012, thomas88 wrote:

> Hello,
>
> I have done some research about breakpoints (I am not a statistician) and I
> found out about the breakpoint, strucchange and segmented packages in R
> allowing to find breakpoints assuming linear model.
>
> However, I would like to fit a periodic time series with a non linear
> (periodic) model, and I was wondering how I could find breakpoints for this
> model in R. Is it even possible ?
>
> My model is an asymmetric gaussian fitting (cf
> http://www.nateko.lu.se/personal/Lars.Eklundh/Institutionssida/IEEE_TGRS_timesat.pdf)
> with a linear-time-dependant amplitude (I am fitting this model over the
> whole time series).
>
> *My ideas
> *
>
> 1) I guess I am more interested in the breakpoints of the "amplitude" of my
> periodic function, so that I could assume a model of the form:
>
> Y ~ (a + b*t)*f(t), with |f(t)| <= 1, where f is a periodic function to be
> fitted to a non linear model, but where no breakpoints should occur.
>
> So basically, the breakpoints would only happen in the (a,b) pair of
> coefficients, which would be a linear regression. However, as f is unknown,
> this makes things harder and I don't have a lot of extremas (min/max) to
> detect breakpoints robustly...
>
> 2) To detect breakpoint with an harmonic model and then to apply my non
> linear regression on each segment.

I would probably first try whether the following leads to reasonable fits

Y(t) = A * exp(b * t) * H(t)

i.e., a multiplicative model with an exponential trend and some harmonic 
trend. By taking logs you then get

log Y(t) = log(A) + b * t + log(H(t))
->
log(Y(t)) = a + b * t + h(t)

so that you can fit a model with a linear trend plus harmonic season to 
the log-series. And, of course, the harmonic trend can then be built up up 
sin/cos at different frequencies and you could fit the whole thing as a 
linear model to the log-series.

It's not quite the same model that you propose above but might be an 
approach worth exploring. You could also look at the "bfast" package which 
has a function bfastpp() for setting up trend and harmonic season for a 
time series. And it also allows for iterative fitting of separate trend 
and season breakpoints in the time series.

hth,
Z

> These two ideas could potentially work, however these are workarounds.
>
> Thank you for your advices !
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Breakpoints-and-non-linear-regression-tp4649072.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list