smop.for.asmop: Subset Multivariate Optimal Partitioning for Possible...

Description Usage Arguments Details Value

View source: R/smop.for.asmop.R

Description

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.

Usage

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)

Arguments

data

An n x p matrix representing a length n time series containing observations of p variables.

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 length(possible.cpts), where each element is a logical matrix containing ncol(data) columns. The rows of this matrix represent the different possible affected variable subsets for the corresponding element in possible.cpts.

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 TRUE then information regarding the changepoint vector check-list is printed during the algorithm.

Details

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.

Value

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.


benpickering/smop documentation built on Sept. 4, 2020, 1:45 a.m.