changepoints | R Documentation |
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.
object |
An instance of an cpop S4 class produced by |
A data frame.
cpop-jss-article-2024cpop
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.