View source: R/repJLDetectChangePoint.R

repJLDetectChangePoint | R Documentation |

Repeatedly computes a random projection with Bernoulli entries of each element in a time series, then calls detectChangePoint to determine where the change point occurs. Creates histogram of locations of numKeep most likely change points. 95 if the change points are chosen completely randomly. Note that this is not the case, because the likely change points in any random projection of a fixed time series are likely correlated. As such, this plot requires some experience to read correctly. The current behavior is that change points are only recorded if BFIC is greater than 3.

```
repJLDetectChangePoint(
multiSeries,
reducedDim = 5,
useGaussian = TRUE,
setdetail,
useBFIC = TRUE,
numRepeat = 100,
numKeep = 2,
alpha = 0.05
)
```

`multiSeries` |
The high dimensional time series. Should be a matrix, with each row being an observation of the time series. |

`reducedDim` |
The dimension you want to project onto. Should be less than the dimension of the time series. Default is 10 |

`useGaussian` |
Set to TRUE if you want to use a random Gaussian projection. Default is random matrix of +- 1. |

`setdetail` |
Optional argument to set the detail level you wish to use. Default is all details. |

`useBFIC` |
Optional argument to use BFIC to decide change point location. |

`numRepeat` |
Number of times to repeat random projection. Default is 100. |

`numKeep` |
number of indices to keep. Recommend 2-3 percent of time series length. Max is 5. |

`alpha` |
alpha level of the test |

Many times when there is no change point, times in the first few or last few possible locations will appear significant. It is recommended to always ignore times that are in the first 8 or last eight spots when using this technique. Eight is a rough guide, and not written in stone, and seems to depend on the filter length.

percent The percentage of runs for which BFIC was bigger than 3. (Not useful.)

indices A table of indices which were included as most likely change points and the number of times they were included.

sigindices A list of indices which occured more often than would be expected if completely random.

q95 This is the cutoff for being a significant index.

results The BFIC and indices of the most likely change points.

```
mu1 <- rep(0,100)
mu2 <- rep(1, 100)
sigma <- diag(100)
series <- createTimeSeries(mu1, mu2, sigma) #Change point at 72
repJLDetectChangePoint(series)
mu1 <- rep(0,100)
mu2 <- rep(0, 100)
sigma <- diag(100)
series <- createTimeSeries(mu1, mu2, sigma) #No change point
repJLDetectChangePoint(series)
## Not run:
data(lennon) #Requires EMD package
lennon_ts <- matrix(as.vector(lennon) + rnorm(65536*120,0,1), nrow = 120, byrow = TRUE)
lennon_ts[80:128,7500:8000] <- lennon_ts[80:128,7500:8000] + 40
image(matrix(lennon_ts[1,], nrow = 256), col = gray(0:100/100))
image(matrix(lennon_ts[90,], nrow = 256), col = gray(0:100/100))
repJLDetectChangePoint(lennon_ts, numKeep = 3)
## End(Not run)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.