Description Usage Arguments Details Value
View source: R/smop.for.asmop.R
This method performs the Subset Multivariate Optimal Partitioning (SMOP) algorithm for a given set of possible changepoint locations and given sets of possible corresponding affected variable subsets. The method is designed for use as part of the Approximate SMOP algorithm, with the sets of possible changepoint locations being obtained using PELT, and the affected variable subsets being obtained using hard or soft restriction.
1 2 3 | smop.for.asmop(data, possible.cpts, possible.subsets, alpha, beta,
min.dist, cost.func = norm.meanvar, initial.likelihood.value = 0,
verbose = F)
|
data |
An |
possible.cpts |
A vector containing all possible changepoint locations, which will be used to generate the search-space of changepoint vectors. |
possible.subsets |
A list of length |
alpha |
The variable-specific penalty, used to penalise the addition of a given changepoint into a given variable. A non-negative numeric value. |
beta |
The multivariate penalty, used to penalise the addition of a changepoint into the model. A non-negative numeric value. |
min.dist |
The minimum distance allowed between any two changepoints. Required to have an integer value of at least 2. |
cost.func |
A function used to calculate the multivariate cost within SMOP. See details for more information. |
initial.likelihood.value |
Numeric. The initial value of the likelihood. |
verbose |
Logical. If |
The method takes a given set of possible changepoint locations and corresponding sets of possible affected variable subsets, and uses these to generate a search-space consisting of all possible changepoint vectors within the time series. An optimal partitioning search is used to obtain the optimal changepoint vector(s) from this search-space which minimise the penalised cost, as defined by cost.func
and the penalties alpha
and beta
.
The possible changepoint locations in checklist.cpts
are obtained by applying PELT to each variable (i.e. column) in data
. The corresponding sets of possible affected variable subsets are obtained by applying either hard restriction or soft restriction (specified by the user) to the set of possible changepoint locations.
Values currently supported for the cost function cost.func
include:
"norm.mean" | Used for detecting changes in mean in Normally-distributed data. Assumes fixed variance parameters (= 1 ). The mean parameters are set to their maximum likelihood estimates. |
"norm.var" | Used for detecting changes in variance in Normally-distributed data. Assumes fixed mean parameters (= 0 ). The variance parameters are set to their maximum likelihood estimates. |
"norm.meanvar" | Used for detecting changes in both mean and variance in Normally-distributed data. The mean and variance parameters are set to their maximum likelihood estimates. |
"norm.mean.seglen" , "norm.var.seglen" , "norm.meanvar.seglen" | Identical to "norm.mean" , "norm.var" and "norm.meanvar" , respectively, except these contain an additional log(segment length) penalty term in the likelihood for each variable. Designed for use when using the modified BIC penalty (Zhang and Siegmund, 2007) to penalise changes. |
This method is designed to be internal, and is not intended for explicit use by the end-user.
A list containing the following elements:
num.cpt.vecs |
The number of changepoint vectors within the search-space considered. |
cpt.vecs |
A matrix containing the optimal changepoint vectors for the series. |
like |
The value of the likelihood for the optimal set of changepoint vectors. |
cpts |
The optimal changepoint locations in the series. |
subsets |
A logical matrix containing the optimal affected variable subsets for each of the detected changepoints. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.