cpt.trend: change point analysis using binary segmentation

Description Usage Arguments Value See Also Examples

View source: R/cpttrend.R

Description

change point analysis using binary segmentation

Usage

1
cpt.trend(x, Q = 10, minseglen = 10, penalty = 1)

Arguments

x

xts, dataframe, matrix or vector, representing a time series

Q

Maximum number of change points required

minseglen

Minimum length of a trend segment

penalty

Penalty value, increasing it reduces number of segments

Value

change points data (object of class cpttrends)

See Also

cpt.mean

Examples

1
2
3
4
5
6
x <- quantmod::getSymbols("^GSPC", auto.assign = FALSE)
x <- x["2015/"]
cpts <- cpt.trend(x,50,minseglen = 20, penalty = 5)
summary(cpts)
quantmod::chart_Series(x)
quantmod::add_TA(cpts$segments[[NROW(cpts$segments)]],on=1,lty=3)

prodipta/techchart documentation built on Sept. 13, 2020, 2:51 p.m.