Description Usage Arguments Details Value Author(s) References See Also Examples
Implements the PELT method for identifying changepoints in a given set of summary statistics for a specified cost function and penalty. This function is used when we have existing data and want to update it by adding new data.
This function is called by ocpt.mean.update
, ocpt.var.update
and ocpt.var.update
. This is not intended for use by regular users of the package. It is exported for developers to call directly for speed increases or to fit alternative cost functions.
WARNING: No checks on arguments are performed!
1 | PELT.online.update(previousanswer,newdata)
|
previousanswer |
This is a summary of data produced by |
newdata |
A new set of data in the form of a vector or a column/row of a matrix. |
This function is used as a wrapper function to implement the PELT algorithm in C. It simply creates the necessary worker vectors, ensures all inputs are the correct type, and passes everything to the C function.
This function is exported for developer use only. It does not perform any checks on inputs (other than type coersion) and is simply a wrapper function for the C code.
A list is returned with elements:
cost_func |
The cost function that has been used. |
sumstat |
The summary statistics for the time series. |
ndone |
Length of the time series when analysis begins. |
nupdate |
Length of the time series to be analysed in this update. |
penalty |
Penalty used to decide if a changepoint is significant. |
cptsout |
Vector of locations of the identified changepoints up to (ndone+nupdate). |
error |
0 by default, nonzero indicates error in code. |
shape |
Only used when cost_func is the gamma likelihood. Otherwise 1. |
minseglen |
Minimum segment length. |
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 |
Number in the checklist currently (to be updated). |
numchangecpts |
Stores the current number of changepoints detected. |
Andrew Connell Rebecca Killick
PELT Algorithm: Killick R, Fearnhead P, Eckley IA (2012) Optimal detection of changepoints with a linear computational cost, JASA 107(500), 1590–1598
CROPS: Haynes K, Eckley IA, Fearnhead P (2014) Efficient penalty search for multiple changepoint problems (in submission), arXiv:1412.3617
PELT.online
,PELT.online.initialise
,ocpt
1 2 3 | #This function should only be used by developers,
#see its use in ocpt.mean.update, ocpt.var.update
#and ocpt.meanvar.update.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.