Skip to main content
11 votes
Accepted

How can I highlight noisy patches in a time series?

For simplicity, I would suggest analyzing the sizes (absolute values) of the residuals relative to a robust smooth of the data. For automated detection, consider replacing those sizes by an indicator:...
whuber's user avatar
  • 327k
8 votes

Determining a significant breakpoint in a slope

It appears that your version cpop does not respect the inhomogeneous grid in days. It should, and for me the latest version does:...
M. Londschien's user avatar
7 votes

Anchoring a linear regression to a specific data point in r

Your model implicitly is this. You have data $(x_1,y_1), \ldots, (x_m,y_m)$ and other data $(x_{m+1},y_{m+1}), \ldots, (x_n,y_n)$ for which $x_j \ge x_i$ whenever $m \lt j \le n$ and $1 \le i \le m$: ...
whuber's user avatar
  • 327k
7 votes
Accepted

Minimum posterior probability for Bayesian changepoint analysis in R

In case it may be useful for those who still check this old question, here are some additional thoughts, especially to your second question: Is there an accepted method or r-package that is used for ...
zhaokg's user avatar
  • 680
6 votes
Accepted

Testing whether there is an increase between two regression slopes in a time series

I feel that after three years it does no harm to post my own answer to how I solved this problem. It could be the case I have made an error or two, so please use with a pinch of salt! Following ...
Geoff's user avatar
  • 501
6 votes

Bayesian online changepoint detection (marginal predictive distribution)

Both (1) and (1b) are correct. The OP has it right that (in this model) there might be a changepoint at $t+1$, and $x_{t+1}$ depends on whether there is a changepoint. This does not imply any problems ...
Juho Kokkala's user avatar
  • 7,923
6 votes

How to do “broken stick linear regression” in R?

Here is how to do this for one cultivar: plot(shoot ~ P, data = subset(DF, cultivar == "Dinninup")) ...
Roland's user avatar
  • 6,711
6 votes

How to do “broken stick linear regression” in R?

The package mcp was made just for scenarios like this. See below how I structured your data as df later. Fit a change point ...
Jonas Lindeløv's user avatar
6 votes
Accepted

Is it reasonable to choose a subset of the time series to create a model?

change points If you think there was a change point in 2010, then you'll get a better forecast by not using earlier data. The idea is that something has changed in 2010, and earlier data is irrelevant....
Aksakal's user avatar
  • 61.7k
5 votes

Maximizing Log-Likelihood Estimation for Changepoint Detection

Not sure if there is still interest in answering this question, anyways here is my take on this. Adrian, you are right that what is in the slide above is for a given sample. For cases in which the ...
cbellei's user avatar
  • 136
5 votes

Python module for change point analysis

I just came across a change point detection library in Python named "ruptures" : https://arxiv.org/abs/1801.00826 Maybe this can be of use.
Basileios's user avatar
  • 151
5 votes

How to characterize abrupt change?

This inference problem has many names, including change points, switch points, break points, broken line regression, broken stick regression, bilinear regression, piecewise linear regression, local ...
Jonas Lindeløv's user avatar
5 votes
Accepted

Bayesian change point detection

Briefly, the package mcp does Bayesian change point regression. As of v0.2, it takes Gaussian, Binomial, Bernoulli, and Poisson. Modeling your data as four ...
Jonas Lindeløv's user avatar
5 votes

Judging flatness of time-series

I would consider the following protocol, which I would call quick-and-dirty. Code is from R. a) Determine a linear model mod<-lm(signal ~ t) to see if there is evidence for a trend. See if ...
Peter Leopold's user avatar
5 votes
Accepted

Error bars in a population and subtracting two populations with different error bars

If I read your question correctly, you want to infer the distances between the plateau heights and the associated uncertainty of this inference. If it makes sense to think of this as a change point ...
Jonas Lindeløv's user avatar
5 votes

Minimum posterior probability for Bayesian changepoint analysis in R

That's not what the tutorial says. It says, about one example where there's an obvious changepoint The lower posterior probability plot shows that at one location (looks like #28) the probability ...
Thomas Lumley's user avatar
5 votes
Accepted

Nonparametric changepoint detection for series with variable number of measurements across time

If you are open to using R, here is a solution using mcp. mcp can infer the location of changes in means (worked examples), ...
Jonas Lindeløv's user avatar
4 votes

Change point detection test using Pettitt-Mann-Whitney test?

The $U_t$ values are based on (centered) sums of ranks. They're integers, so they can be the same -- and indeed you do have two $U_t$ values the same. However, it is not clear how you're assigning p-...
Glen_b's user avatar
  • 285k
4 votes

R changepoint, different number of outputs

Changepoints mark where your time-series changes. In this case you observed two changes around time 6 (mean increased) and 14 (mean decreased).
Tim's user avatar
  • 140k
4 votes

CUSUM algorithm and first derivative

The resetting of g+ and g- to zero when the threshold is exceeded is not a part of the classic CUSUM procedure. The classic CUSUM (per Ewan 1963 https://www.tandfonline.com/doi/pdf/10.1080/00401706....
Dave X's user avatar
  • 143
4 votes
Accepted

Detecting change point in a time series

You can do this with mcp. First, let's get your data in an accessible format. The variable "days" is the number of days since the first record. I remove the NAs: <...
Jonas Lindeløv's user avatar
4 votes

Changepoint analysis with missing data

If you are working on time series data or 1D univariate sequence data, a possible package available in R, Python, and Matlab is Rbeast (https://github.com/zhaokg/...
zhaokg's user avatar
  • 680
4 votes
Accepted

Using PELT changepoint detection for observation counts data

The justification to use or not use PELT depends on how you will define the cost/loss function. I think that we first need to distinguish those terms. Within change-point detection framework, a common ...
Lucas Prates's user avatar
  • 1,223
4 votes

Using PELT changepoint detection for observation counts data

As Lucas states whether PELT is appropriate depends on how you define your problem. As stated in the original PELT paper if you are using likelihoods to define your cost function in a segment ...
adunaic's user avatar
  • 1,291
4 votes

Is it reasonable to choose a subset of the time series to create a model?

I would not say one forecast is "more accurate" than the others. You will only see that after the fact. One forecast does have narrower prediction intervals, but only by pretending that ...
Stephan Kolassa's user avatar
3 votes

Bayesian change point detection

Numerous packages are available in R for changepoint or breakpoint detection but the majority of them are non-Bayesian. Many such packages are touched in @Jonas Lindeløv's blog post: https://lindeloev....
zhaokg's user avatar
  • 680
3 votes

Detect changes in time series

In R, many packages are potentially useful, as partially summarized in the CRAN Task View on time series:https://cran.r-project.org/web/views/TimeSeries.html. Here is a relevant excerpt on change ...
zhaokg's user avatar
  • 680
3 votes
Accepted

Finding the change point in data from a piecewise linear function

The mcp package can do this. First, let's simulate some data: ...
Jonas Lindeløv's user avatar
3 votes

What is change point analysis for At Most One Change(AMOC)?

It appears as though you are using the changepoint package in R from the function names mentioned and the ...
adunaic's user avatar
  • 1,291
3 votes
Accepted

Pettitt's Test for Change-Point Detection Showing P-Value Larger than 1

The true p-value is a probability, so you are correct that it must be between zero and one. However, according to the documentation for the trend package, this ...
Ben's user avatar
  • 127k

Only top scored, non community-wiki answers of a minimum length are eligible