Learn R Programming

hdMTD (version 0.1.4)

MTD-accessors: Accessors for objects of classes "MTD", "MTDest", and/or "hdMTD"

Description

Public accessors that expose object components without relying on the internal list structure. These accessors are available for "MTD" (model objects), "MTDest" (EM fits), and/or "hdMTD" (lag selection).

Usage

pj(object)

p0(object)

lambdas(object)

lags(object)

Lambda(object)

S(object)

states(object)

transitP(object)

Value

pj(object)

A list of stochastic matrices (one per lag).

p0(object)

A numeric probability vector for the independent component.

lambdas(object)

A numeric vector of mixture weights that sums to 1.

lags(object)

The lag set (elements of \(\mathbb{Z}^-\)).

Lambda(object)

The set of relevant lags as positive integers (elements of \(\mathbb{N}^+\)).

S(object)

For "MTDest" and "hdMTD", the set of candidate/estimated lags as positive integers (elements of \(\mathbb{N}^+\)).

states(object)

The state space.

transitP(object)

The global transition matrix \(P\).

Arguments

object

An object of class "MTD", "MTDest" or "hdMTD" (as supported by each accessor).

Details

Returned lag sets follow the package convention and are shown as negative integers via lags() (elements of \(\mathbb{Z}^-\)). For convenience, positive-index accessors are also provided: Lambda() for "MTD" objects and "MTDest" fits, and S() for "MTDest" and "hdMTD" objects (elements of \(\mathbb{N}^+\)).

The function transitP() returns the global transition matrix, i.e., a convex combination of the independent distribution p0 and the lag-specific transition matrices pj, weighted by lambdas.

See Also

MTDmodel, MTDest, hdMTD.

Examples

Run this code
if (FALSE) {
## For generating an MTD model
set.seed(1)
m <- MTDmodel(Lambda = c(1, 3), A = c(0, 1))
pj(m); p0(m); lambdas(m); lags(m); Lambda(m); states(m)
transitP(m)
## For an EM fit (using coef(m) as init for simplicity):
X <- perfectSample(m, N = 800)
fit <- MTDest(X, S = c(1, 3), init = coef(m))
pj(fit); p0(fit); lambdas(fit); lags(fit); S(fit); states(fit)
transitP(fit)
## For lag selection:
S_hat <- hdMTD(X, d = 5, method = "FS", l = 2)
S(S_hat); lags(S_hat)
}

Run the code above in your browser using DataLab