ocpt.np.update: Identifying Changes Via ECP. Update function.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ocpt.np.R

Description

Calculates the optimal positioning and (potentially) number of changepoints for data using the user specified method. The update function should be used once e.cp3o_delta.online.initialise has created an answer.

Usage

1
ocpt.np.update(previousanswer, newdata,K)

Arguments

previousanswer

A S4 class. This will be the output from the e.cp3o_delta.online.initialise function.

newdata

A vector, ts object or matrix containing the new data within which you wish to find a changepoint. If data is a matrix, each row is considered a separate dataset.

K

Maximum number of changpoints the algorithm will output as estimates. Also the total number of iterations the dynamic programming will do.

Details

This function is used to find changes in mean and variance for data. The changes are found using the method supplied which can be a single changepoint or multiple changepoints. A changepoint is denoted as the last observation of the segment / regime.

Value

A ecp.ocpt object is returned with a summary:

number of changepoints

The estimated number of change points.

Estimate Locations

The location of the change points estimated by the procedure.

Goodness of Fit Model

Goodness of Fit Model's score.

Delta

The window size.

Alpha

The moment index used.

Verbose

A flag indicating if status updates should be printed.

Number of Datapoints

Total number of data pieces observed.

Calcualtion Time

Time procedure took.

Author(s)

Andrew Connell, Rebecca Killick, David Matteson

See Also

ocpt.var.initialise,ocpt.meanvar.initialise,ocpt

Examples

1
2
3
4
5
6
set.seed(1)
x = matrix(c(rnorm(100,50,1),rnorm(100,5,1)),ncol=1)
y=matrix(c(rnorm(100,15,1),rnorm(100,25,1)),ncol=1)
ans = ocpt.np.initialise(x)
updatedans = ocpt.np.update(ans,y,K=3)
updatedans

rkillick/changepoint.online documentation built on Sept. 26, 2020, 11:01 p.m.