7
$\begingroup$

Is there a specific method to detect change points(structural breaks) in a timeseries? (stocks prices).

$\endgroup$
6
  • 6
    $\begingroup$ We have a specialist in this subject who is a frequent contributor. Consult almost any of his replies for an account of his favorite methods. Here is a typical one. $\endgroup$
    – whuber
    Commented Oct 13, 2011 at 17:37
  • $\begingroup$ @whuber, I didn't find methods on his post. $\endgroup$
    – Dail
    Commented Oct 13, 2011 at 19:44
  • 1
    $\begingroup$ He provides a link to documents with references and equations. $\endgroup$
    – whuber
    Commented Oct 13, 2011 at 20:05
  • $\begingroup$ You can also try the package strucchange. $\endgroup$
    – ThomasKK
    Commented Aug 10, 2018 at 9:40
  • $\begingroup$ Can you please extend your answer and explain why the package is useful. $\endgroup$
    – Ferdi
    Commented Aug 10, 2018 at 10:02

8 Answers 8

2
$\begingroup$

@Dail if you're more inclined to the applied rather than the theoretical behind detection of structural break, you might want try http://cran.r-project.org/web/packages/cpm/index.html this is the link for CPM package of R, where you can use processStream to find multiple break point in your time series.

$\endgroup$
1
  • 2
    $\begingroup$ My issue with this is that the documentation seems to suggest the package only covers mean shift and variance changes, but not a change in any auto-regressive or moving average terms a model might have. $\endgroup$
    – Frank
    Commented Apr 6, 2020 at 20:31
11
$\begingroup$

Change Points can arise from a number of possible causes. Each of the possible causes can be evaluated. In terms of increasing complexity : 1. detecting a change in the expected value is essentially Intervention Detection. Pursue the work of Ruey Tsay to understand what you need to do. His work does not cover detecting the onset of a new time trend, The second item that you might consider is detecting when and if the parameters of the model have changed. If you pursue Gregory Chow's work on testing the difference between parameters for known groupings and simply generalize that to search for possible points in time where the parameters have changed you could be successful. Next in terms of complexity is to conduct a test for a significant change in the variance of the residuals. Simply evaluate different possible breal points for variance change and conduct a sequence of F tests to find the point ( if any ) that the variance has changed. I have had personal experience in developing each of these three tests and possible cures in order to render the final error process Gaussian.

Thanks for the kudos Whuber !

$\endgroup$
7
  • $\begingroup$ thank you for your answer. The problem is that I didn't understand what method I should use, I only read Chow test but I can't use that because I don't know "where is" the break. So I'm looking for a nonparametric method to detect structural breaks at unknow point. Is there a method to check that? Thank you very much! $\endgroup$
    – Dail
    Commented Oct 14, 2011 at 11:31
  • $\begingroup$ Dail: What you have to do is TRY different points in time and test each of them to see what point in time is the most likely candidate $\endgroup$
    – IrishStat
    Commented Oct 14, 2011 at 13:48
  • $\begingroup$ exactly! But, what is the method to find those change points (that AFTER I can test with Chow) ? $\endgroup$
    – Dail
    Commented Oct 14, 2011 at 14:19
  • $\begingroup$ @Dali: I think IrishStat is saying that you try all points with Chow, and see which are most likely. $\endgroup$
    – Wayne
    Commented Oct 14, 2011 at 18:52
  • $\begingroup$ @Wayne, that's the problem. I can't use Chow test, because I must know the points before. Chow test only works with "know" points, I don't know where the structural change happens $\endgroup$
    – Dail
    Commented Oct 15, 2011 at 6:24
2
$\begingroup$

Here's some demo R code that shows how to detect (endogenously) structural breaks in time series / longitudinal data.

# assuming you have a 'ts' object in R 

# 1. install package 'strucchange'
# 2. Then write down this code:

library(strucchange)

# store the breakdates
bp_ts <- breakpoints(ts)

# this will give you the break dates and their confidence intervals
summary(bp_ts) 

# store the confidence intervals
ci_ts <- confint(bp_ts)

## to plot the breakpoints with confidence intervals
plot(ts)
lines(bp_ts)
lines(ci_ts)

Check out this example case that I have blogged about.

$\endgroup$
2
$\begingroup$

If you care the use of R, a selection of packages available are summarized in the CRAN task view on time series (https://cran.r-project.org/web/views/TimeSeries.html). Below is the relevant portion:

Change point detection is provided in strucchange and strucchangeRcpp (using linear regression models) and in trend (using nonparametric tests). The changepoint package provides many popular changepoint methods, and ecp does nonparametric changepoint detection for univariate and multivariate series. changepoint.np implements the nonparametric PELT algorithm, changepoint.mv detects changepoints in multivariate time series, while changepoint.geo implements the high-dimensional changepoint detection method GeomCP. Factor-augmented VAR (FAVAR) models are estimated by a Bayesian method with FAVAR. InspectChangepoint uses sparse projection to estimate changepoints in high-dimensional time series. Rbeast provides Bayesian change-point detection and time series decomposition ...

Of these, Rbeast is also available as a library in Matlab and Python (https://github.com/zhaokg/Rbeast).

$\endgroup$
1
$\begingroup$

Searching on Google scholar for "Bayesian changepoint detection" will produce some useful references, such as Adams and MacKay, which looks very interesting and sounds the sort of thing you are looking for. There is also a good book on "Numerical Bayesian Methods Applied to Signal Processing" by O'Ruanaidh and Fitzgerald that I remember being very good on this sort of thing, but I don't have a copy anymore, so I can't check for relevant pages (but the index suggests there is a chapter on retrospective changepoint detection).

$\endgroup$
3
  • $\begingroup$ do you mean "bcp" function of the "bcp" library in R? Can I use this method with financial time series? Is it good for that? $\endgroup$
    – Dail
    Commented Oct 14, 2011 at 11:35
  • $\begingroup$ sorry, I am a MATLAB rather than an R user, so I can't really advise on that. $\endgroup$ Commented Oct 14, 2011 at 14:57
  • $\begingroup$ however I have seen that 0.3 is used as level, so if the bcp return value above it, there is a strucutral change.No? $\endgroup$
    – Dail
    Commented Oct 15, 2011 at 6:26
1
$\begingroup$

@Dail -- You don't need to know the date in advance. There are many options beyond the Chow Test. In practice, the Chow test can be undesirable because it assumes homoskedasticity, which is very often violated in real time series data. There is a famous paper on testing for structural breaks when the break dates are unknown and methods are now quite well developed. The reference is Andrews, 1993 but you probably would prefer to just have a look at these slides though, which provide an overview of the various tests, the theory, and examples of practical applications. There is an R package that you can use to implement the tests called strucchange which you can find more info about here

$\endgroup$
1
$\begingroup$

I'd like to second what IrishStat has said and point you directly to two of Ruey Tsay's books:

  1. Analysis of Financial Time Series, Third Edition, Wiley, 2010. ISBN: 0-470-41435-9; 10-digits: 978-0470414354 (book's website with some R code)

  2. An Introduction to Analysis of Financial Data with R, Wiley, 2013 ISBN: 0-470-89081-3; 10-digits: 978-0470890813

Furthermore, I suggest investigating: Modelling Nonlinear Economic Time Series (Advanced Texts in Econometrics) (2011) by Timo Terasvirta, Dag Tjostheim, and Clive W. J. Granger. This book is very detailed and contains a great number of references. Chapter 6 of the book is where you should look.

$\endgroup$
0
$\begingroup$

Chow test, multiple break-point test (such as Bia Perron test), Quant-Andrews break point test etc. are different test available in Eviews.

Read description, assumptions and interpretation of each test before applying it your data set.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.