changepoints {cpop} | R Documentation |
Changepoint locations
Description
Creates a data frame containing the locations of the changepoints in terms of the index of the data and the value of the location at that index.
Arguments
object |
An instance of an cpop S4 class produced by |
Value
A data frame.
References
Fearnhead P, Grose D (2024). “cpop: Detecting Changes in Piecewise-Linear Signals.” Journal of Statistical Software, 109(7), 1–30. doi:10.18637/jss.v109.i07.
Examples
library(cpop)
# generate some test data
set.seed(0)
x <- seq(0,1,0.01)
n <- length(x)
sd <- rep(0.1,n)
mu <- c(2*x[1:floor(n/2)],2 - 2*x[(floor(n/2)+1):n])
y <- rnorm(n,mu,sd)
# use the locations in x
res <- cpop(y,x,beta=2*log(length(y)),sd=sd)
changepoints(res)
[Package cpop version 1.0.7 Index]