Learn R Programming

cpcens (version 0.1.0)

PELT: Most recent changepoints from AGG method.

Description

Detecting most recent changepoints from AGG method (detect changepoint in univariate time series). We use PELT for segmenting a time series into changing means, assuming normally distributed observations with changing mean but constant variance.

Usage

PELT(data, pen)

Arguments

data

a censored data matrix. And then we add this data matrix column wise and resulting data use as first argument in PELT function.

pen

(penalty term) default 200*log(dim(data)[2]. Here dim(data)[2] means length of series (n).

Value

indicates the most recent changepoint in each series .

Examples

Run this code
# NOT RUN {
#example
library(cpcens)
data("censoredex")
data=censoredex
n=144
N=100
agg = apply( data , 2 , sum )
pagg = PELT( agg , 200*log(dim(data)[2]) )
agg.chpts = rep( rev( pagg$cpts )[1] , N )
# }

Run the code above in your browser using DataLab