Description Usage Arguments Details Value Author(s) References See Also Examples
Calculates the optimal positioning and (potentially) number of changepoints for data using the user specified method.
1 2 3 |
data |
A vector, ts object or matrix containing the data within which you wish to find a changepoint. If data is a matrix, each row is considered a separate dataset. |
penalty |
Choice of "None", "SIC", "BIC", "MBIC", AIC", "Hannan-Quinn", "Asymptotic", "Manual" and "CROPS" penalties. If Manual is specified, the manual penalty is contained in the pen.value parameter. If Asymptotic is specified, the theoretical type I error is contained in the pen.value parameter. If CROPS is specified, the penalty range is contained in the pen.value parameter; note this is a vector of length 2 which contains the minimum and maximum penalty value. Note CROPS can only be used if the method is "PELT". The predefined penalties listed DO count the changepoint as a parameter, postfix a 0 e.g."SIC0" to NOT count the changepoint as a parameter. |
pen.value |
The theoretical type I error e.g.0.05 when using the Asymptotic penalty. A vector of length 2 (min,max) if using the CROPS penalty. The value of the penalty when using the Manual penalty option - this can be a numeric value or text giving the formula to use. Available variables are, n=length of original data, null=null likelihood, alt=alternative likelihood, tau=proposed changepoint, diffparam=difference in number of alternatve and null parameters. |
Q |
The maximum number of changepoints to search for using the "BinSeg" method. The maximum number of segments (number of changepoints + 1) to search for using the "SegNeigh" method. |
test.stat |
The assumed test statistic / distribution of the data. Currently only "Normal", "ECP" and "CUSUM" supported. |
class |
Logical. If TRUE then an object of class |
param.estimates |
Logical. If TRUE and class=TRUE then parameter estimates are returned. If FALSE or class=FALSE no parameter estimates are returned. |
shape |
Only used when cost function is the gamma likelihood. |
minseglen |
Positive integer giving the minimum segment length (no. of observations between changes), default is the minimum allowed by theory. |
alpha |
The moment index used for determining the distance between and within segments. |
verbose |
Allows the user to have some of the internal steps returned. (Only for ECP method.) |
This function is used to find changes in mean for data using the test statistic specified in the test.stat parameter. The changes are found using the method supplied which can be single changepoint or multiple changepoints. A changepoint is denoted as the last observation of the segment / regime.
If class=TRUE
then an object of S4 class "ocpt" is returned. The slot ocpts
contains the changepoints that are returned. For class=FALSE
the structure is as follows.
If data is a vector (single dataset) then a vector/list is returned depending on the value of method. If data is a matrix (multiple datasets) then a list is returned where each element in the list is either a vector or list depending on the value of method.
Returns a summary of:
cpttype |
In this case it will always be change in mean. |
Method |
The method used. |
test.stat |
The chosen test statistic. |
penalty |
Both the type and value of the penalty |
minseglen |
The minimum segment length. |
max no. of cpts |
Maximum number of changepoints possible. |
ndone |
Length of the time series when analysis begins. |
nupdate |
Length of the time series to be analysed in this update. |
Andrew Connell, Rebecca Killick
Change in Normal mean: Hinkley, D. V. (1970) Inference About the Change-Point in a Sequence of Random Variables, Biometrika 57, 1–17
PELT Algorithm: Killick R, Fearnhead P, Eckley IA (2012) Optimal detection of changepoints with a linear computational cost, JASA 107(500), 1590–1598
MBIC: Zhang, N. R. and Siegmund, D. O. (2007) A Modified Bayes Information Criterion with Applications to the Analysis of Comparative Genomic Hybridization Data. Biometrics 63, 22-32.
ocpt.var.initialize
,ocpt.meanvar.initialize
,ocpt
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.