online.class_input: Input all required arguments into online cpt classes - Only...

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

View source: R/online.class_input.R

Description

This function helps to input all the necessary information into the correct format for ocpt and ocpt.range classes.

This function is called by ocpt.mean.initialise, ocpt.var.initialise and ocpt.meanvar.initialise and all the corresponding update functions. This is not intended for use by regular users of the package. It is exported for developers to call directly for speed and convenience.

WARNING: No checks on arguments are performed!

Usage

1
2
3
4
online.class_input(sumstat, cpttype, method, test.stat, penalty, pen.value, 
minseglen, param.estimates, out = list(), Q = NA, shape = NA, 
lastchangelike = c(0), lastchangecpts =c(0), checklist = c(0), 
nchecklist=0, ndone = 0, nupdate = length(sumstat[,1])-1, cost_func)

Arguments

sumstat

Summary statistic used in changepoint analysis, see ocpt.mean.initialise for further details.

cpttype

Type of changepoint analysis performed as a text string, e.g. "Mean", "Mean and Variance".

method

Method used as a text string, see ocpt.mean.initialise for further details.

test.stat

The assumed test statistic / distribution of the data as a text string. , see ocpt.mean.initialise, ocpt.meanvar.initialise or ocpt.var.initialise for further details.

penalty

Penalty used as a text string, see ocpt.mean.initialise for further details.

pen.value

Numerical penalty value used in the analysis (positive).

minseglen

Minimum segment length used in the analysis (positive integer).

param.estimates

Logical. If TRUE then parameter estimates are calculated. If FALSE no parameter estimates are calculated and the slot is blank in the returned object.

out

List of output from PELT.online or other method used. Function assumes that method and format of out match.

Q

The value of Q used in the BinSeg or SegNeigh methods.

shape

Value of the assumed known shape parameter required when test.stat="Gamma".

lastchangelike

Vector of lenght n containing the likelihood of the optimal segmentation up to each timepoint.

lastchangecpts

Vector of length n containing the last changepoint prior to each timepoint.

checklist

Vector of locations of the potential last changepoint for next iteration (to be updated), max length=(ndone+nupdate).

nchecklist

Stores the current number of changepoints detected.

ndone

Length of the time series when analysis begins.

nupdate

Length of the time series to be analysed in this update.

cost_func

The cost function that has been used.

Details

This function takes all the input required for the ocpt or ocpt.range classes and enters it into the object.

This function is exported for developer use only. It does not perform any checks on inputs and is simply a convenience function for converting the output of the worker functions into a nice format for the ocpt and ocpt.range classes.

Value

An object of class ocpt or ocpt.range as appropriate filled with the given attributes.

Author(s)

Andrew Connell, Rebecca Killick

See Also

ocpt.var.initialise,ocpt.mean.initialise,ocpt

Examples

1
2
#This function should only be used by developers, 
#see its use in ocpt.mean, ocpt.var and ocpt.meanvar.

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