Hi, does anybody know of a nice test to detect trend turning points in time series? Possibly with reference? Thanks, joerg
I don't know about time series data, but if the "errors" are independent (and preferably constant variance), wouldn't this amounts to estimating zeroes in the first derivative of the trend? I believe several packages for smoothing (e.g., KernSmooth and locfit) can estimate derivatives. J. S. Marron's SiZer actually tests for significance of the zeroes, but that has not been implemented in R, AFAIK. Marron's web site has Matlab code for it. Andy> From: Joerg Schaber > > Hi, > > does anybody know of a nice test to detect trend turning > points in time > series? Possibly with reference? > Thanks, > > joerg > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
On Wed, 14 Apr 2004 19:05:32 +0200 Joerg Schaber wrote:> Hi, > > does anybody know of a nice test to detect trend turning points in > time series? Possibly with reference?You can look at the function breakpoints() in the package strucchange and the function segmented() in the package segmented which do segmentation of (generalized) linear regression models. The former tries to fit fully segmented regression models, the latter broken line trends. References are given on the respective help pages. A suitable test for a change in trend in linear regression models is the OLS-based CUSUM test with a Cramer-von Mises functional of Kraemer & Ploberger (1996, JoE) which is available via efp() in strucchange and associated methods. hth, Z> Thanks, > > joerg > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
On 14 Apr 2004 at 19:24, Achim Zeileis wrote:> On Wed, 14 Apr 2004 19:05:32 +0200 Joerg Schaber wrote: > > > Hi, > > > > does anybody know of a nice test to detect trend turning points in > > time series? Possibly with reference? > > You can look at the function breakpoints() in the package strucchangeI have found this very usefull. One Q: from the documentation (vignette) it is not clear if the distribution theory implemented in strucchange takes account of autocorrelation structure in a time series. For instance, to look for trend changes and at the same time changes in the form of seasonality I uses breakpoints(my.ts ~ 1:n + as.factor(cycle(my.ts)) ) Is this OK? Kjetil Halvorsen> and the function segmented() in the package segmented which do > segmentation of (generalized) linear regression models. The former > tries to fit fully segmented regression models, the latter broken line > trends. References are given on the respective help pages. > > A suitable test for a change in trend in linear regression models is > the OLS-based CUSUM test with a Cramer-von Mises functional of Kraemer > & Ploberger (1996, JoE) which is available via efp() in strucchange > and associated methods. > > hth, > Z > > > Thanks, > > > > joerg > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide! > > http://www.R-project.org/posting-guide.html > > > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html
> > > > does anybody know of a nice test to detect trend turning points in > > time series? Possibly with reference? > > You can look at the function breakpoints() in the package strucchange > and the function segmented() in the package segmented which do > segmentation of (generalized) linear regression models. The > former tries > to fit fully segmented regression models, the latter broken > line trends. > References are given on the respective help pages. > > A suitable test for a change in trend in linear regression > models is the > OLS-based CUSUM test with a Cramer-von Mises functional of > Kraemer & Ploberger (1996, JoE) which is available via efp() in > strucchange and associated methods.Hello Joerg, additionally to Achim's comments, there is also the Zivot & Andrews test available in the contributed package 'urca', Zivot, E. and Andrews, Donald W.K. (1992), Further Evidence on the Great Crash, the Oil-Price Shock, and the Unit-Root Hypothesis, Journal of Business & Economic Statistics, 10(3), 251-270. Download possible at: \url{http://cowles.econ.yale.edu/}, see rubric 'Discussion Papers (CFDPs)'. in case you are also interested in inferences on integration of your time series at hand. Bernhard> > hth, > Z > > > Thanks, > > > > joerg > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide! > > http://www.R-project.org/posting-guide.html > > > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html -------------------------------------------------------------------------------- The information contained herein is confidential and is inte...{{dropped}}
Dear Joerg, See http://www.brodgar.com/timeseries.htm and especially: http://www.brodgar.com/chronoexample.htm http://www.brodgar.com/chronoexample2.htm for methodology and examples of detecting breakpoints in multivariate time series. Kind regards, Alain Zuur www.brodgar.com www.highstat.com ---------------------------- Message: 36 Date: Wed, 14 Apr 2004 19:05:32 +0200 From: Joerg Schaber <Joerg.Schaber@uv.es> Subject: [R] trend turning points To: r-help <r-help@stat.math.ethz.ch> Message-ID: <407D6F5C.3060403@uv.es> Content-Type: text/plain; charset=us-ascii; format=flowed Hi, does anybody know of a nice test to detect trend turning points in time series? Possibly with reference? Thanks, joerg ------------------------------ Message: 37 Date: Wed, 14 Apr 2004 13:13:11 -0400 From: "Liaw, Andy" <andy_liaw@merck.com> Subject: RE: [R] trend turning points To: "'Joerg Schaber'" <Joerg.Schaber@uv.es>, r-help <r-help@stat.math.ethz.ch> Message-ID: <3A822319EB35174CA3714066D590DCD504AF7BD0@usrymx25.merck.com> Content-Type: text/plain I don't know about time series data, but if the "errors" are independent (and preferably constant variance), wouldn't this amounts to estimating zeroes in the first derivative of the trend? I believe several packages for smoothing (e.g., KernSmooth and locfit) can estimate derivatives. J. S. Marron's SiZer actually tests for significance of the zeroes, but that has not been implemented in R, AFAIK. Marron's web site has Matlab code for it. Andy> From: Joerg Schaber > > Hi, > > does anybody know of a nice test to detect trend turning > points in time > series? Possibly with reference? > Thanks, > > joerg >--------------------- Dr Alain Zuur Highland Statistics Ltd. www.highstat.com www.brodgar.com
>> does anybody know of a nice test to detect trend turning points in>> time series? Possibly with reference? > >You can look at the function breakpoints() in the package strucchange >and the function segmented() in the package segmented which do >segmentation of (generalized) linear regression models. The former >tries to fit fully segmented regression models, the latter broken line >trends. References are given on the respective help pages. > >A suitable test for a change in trend in linear regression models is >the OLS-based CUSUM test with a Cramer-von Mises functional of Kraemer >& Ploberger (1996, JoE) which is available via efp() in strucchange >and associated methods. I have seen strucchange with great interest but somehow the combination of the R and the statistics knowledge that is required to access it feels like a bottleneck :-) Could someone perhaps write a simple R program which illustrates the facilities and usage? -- Ajay Shah Consultant ajayshah at mayin.org Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi
On Mon, 19 Apr 2004 14:27:00 +0530 Ajay Shah wrote:> >> does anybody know of a nice test to detect trend turning points > >in> time series? Possibly with reference? > > > >You can look at the function breakpoints() in the package > >strucchange and the function segmented() in the package segmented > >which do segmentation of (generalized) linear regression models. > >The former tries to fit fully segmented regression models, the > >latter broken line trends. References are given on the respective > >help pages. > > > >A suitable test for a change in trend in linear regression models > >is the OLS-based CUSUM test with a Cramer-von Mises functional of > >Kraemer& Ploberger (1996, JoE) which is available via efp() in > >strucchange and associated methods. > > I have seen strucchange with great interest but somehow the > combination of the R and the statistics knowledge that is required to > access it feels like a bottleneck :-) Could someone perhaps write a > simple R program which illustrates the facilities and usage?The package has an accompanying vignette which explains the ideas behind it and how to use its inference functions. The breakpoints() facilities are also documented in a paper by Zeileis, Kleiber, Kraemer, Hornik (2003, CSDA). A mini-example would be: ## load package and data R> data(Nile) R> library(strucchange) ## fit, visualize and test OLS-based CUSUM test ## with a Cramer-von Mises functional R> ocus <- efp(Nile ~ 1, type = "OLS-CUSUM") R> plot(ocus, functional = "meanL2") R> sctest(ocus, functional = "meanL2") ## estimate breakpoints R> bp <- breakpoints(Nile ~ 1) R> plot(bp) R> summary(bp) hth, Z> -- > Ajay Shah Consultant > ajayshah at mayin.org Department of Economic Affairs > http://www.mayin.org/ajayshah Ministry of Finance, New Delhi >