Description Objects from the Class Slots Methods Author(s) See Also Examples
A class for online changepoint objects.
Objects can be created by calls of the form new("ocpt", ...)
.
new("ocpt", ...)
:creates a new object with class ocpt
sumstat
:Object of class "array"
, a summary statistic for the the original data.
cpttype
:Object of class "character"
, the type of online changepoint that was identified.
method
:Object of class "character"
, the method that was used to search for changepoints.
test.stat
:Object of class "character"
, the test statistic for the analysis of the data.
pen.type
:Object of class "character"
, the penalty type specified in the analysis.
pen.value
:Object of class "numeric"
, the value of the penalty used in the analysis.
minseglen
:Object of class "numeric"
, the minimum segment length (no. of observations between changepoints) used in the analysis.
cpts
:Object of class "numeric"
, vector of online changepoints identified.
ncpts.max
:Object of class "numeric"
, maximum number of online changepoint that can be identified.
param.est
:Object of class "list"
, list where each element is a vector of parameter estimates, if requested.
date
:Object of class "character"
, date and time the changepoint analysis was run.
version
:Object of class "character"
, version number of the package used when the analysis was run.
lastchangelike
:Object of class "numeric"
, vector of lenght n containing the likelihood of the optimal segmentation up to each timepoint.
lastchangecpts
:Object of class "numeric"
, vector of length n containing the last changepoint prior to each timepoint.
nchecklist
:Object of class "numeric"
, stores the current number of changepoints detected.
checklist
:Object of class "numeric"
, vector of locations of the potential last changepoint for next iteration (to be updated), max length=(ndone+nupdate).
ndone
:Object of class "numeric"
, length of the time series when analysis begins.
nupdate
:Object of class "numeric"
, length of the time series to be analysed in this update.
cost_func
:Object of class "character"
, the cost function used in PELT.online calculations.
shape
:Object of class "numeric"
, only used when cost_func is the gamma likelihood. Otherwise 1.
signature(object = "ocpt")
: retrieves ocpts slot
signature(object = "ocpt")
: retrieves ocpttype slot
signature(object = "ocpt")
: retrieves matrix version of sumstat slot
signature(object = "ocpt")
: retrieves test.stat slot
signature(object = "ocpt")
: retrieves ncpts.max slot
signature(object = "ocpt")
: retrieves method slot
signature(object = "ocpt")
: retrieves minseglen slot
signature(object = "ocpt")
: retrieves param.est slot
signature(object = "ocpt")
: retrieves pen.type slot
signature(object = "ocpt")
: retrieves pen.value slot
signature(object = "ocpt")
: replaces cpts slot
signature(object = "ocpt")
: replaces cpttype slot
signature(object = "ocpt")
: replaces sumstat slot
signature(object = "ocpt")
: replaces test.stat slot
signature(object = "ocpt")
: replaces ncpts.max slot
signature(object = "ocpt")
: replaces method slot
signature(object = "ocpt")
: replaces minseglen slot
signature(object = "ocpt")
: replaces param.est slot
signature(object = "ocpt")
: replaces pen.type slot
signature(object = "ocpt")
: replaces pen.value slot
signature(object = "ocpt")
: prints details of the cpt object including summary
signature(object = "ocpt")
: prints a summary of the cpt object
signature(object = "ocpt")
: plots the ocpt object with changepoints highlighted
signature(object = "ocpt")
: calculates the parameter estimates for the ocpt object
signature(object = "ocpt")
: returns the overall log-likelihood of the ocpt object
Andrew Connell, Rebecca Killick
cpts-methods
,cpt.reg
,ocpt.mean.initialise
,ocpt.var.initialise
,ocpt.meanvar.initialise
1 2 3 4 5 6 7 8 9 10 11 12 | showClass("ocpt") # shows the structure of the ocpt class
x=new("ocpt") # creates a new object with the ocpt class defaults
cpts(x) # retrieves the ocpts slot from x
# Example of a change in variance at 100 in simulated normal data
set.seed(1)
x=c(rnorm(100,0,1),rnorm(100,0,10))
ans=ocpt.var.initialise(x)
print(ans) # prints details of the analysis including a summary
summary(ans)
plot(ans,data=x) # plots the data with change (vertical line) at 100
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.