Learn R Programming

cpop (version 1.0.8)

changepoints: 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.

Value

A data frame.

Arguments

object

An instance of an cpop S4 class produced by cpop.

References

cpop-jss-article-2024cpop

Examples

Run this code
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)

Run the code above in your browser using DataLab