Description Usage Arguments Details Value Author(s) See Also Examples
Function that helps narrow down possible changepoints. Sometimes the onlineCPD
and offlineCPD
functions report an excessive number of changepoints. This function is called inside plot.oCPD
and removes them based on criteria described in Details.
1 | findCP(oCPD, buffer = 10)
|
oCPD |
results of a call to |
buffer |
a whole number. Any time there are two changepoints within |
The function chooses changepoints based on the following criteria; first, if there are two changepoints within buffer
data points, it will pick one to replace them both, based on the sum of the probabilities for each change. Then, if the algorithm ever changes it's mind on a changepoint (i.e. the red, diagonal line ever jumps up) the function will remove the changepoint.
A vector of changepoints.
Zachary Zanussi
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Two changepoints within \code{buffer} points:
set.seed(5)
y <- c(rnorm(15,0.5,0.01),0.505,0.51,0.015,0.52,rnorm(15,0.6,0.05))
res <- offlineCPD(y)
plot(res,buffer=10) ## Will replace the two changepoints
plot(res,cleanCP=FALSE) ## Will not replace the changepoints
## A changepoint is forgotten:
set.seed(5)
y <- c(rnorm(50,0.5,0.1),rnorm(20,0.48,0.02),rnorm(50,0.5,0.1),rnorm(75,0.7,0.4))
res <- offlineCPD(y)
plot(res) ## Will remove the changepoint that has been second-guessed
plot(res,cleanCP=FALSE) ## Will not remove the changepoint
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.