Learn R Programming

hdMTD (version 0.1.4)

MTDest-methods: Methods for objects of class "MTDest"

Description

Methods for objects returned by MTDest() – EM fits of Mixture Transition Distribution models. Note that "MTDest" objects inherit from class "MTD" (they have class c("MTDest", "MTD")), and several methods for "MTD" also work on "MTDest" objects by inheritance. The methods documented here are specific to EM fits, providing diagnostics and summaries of the estimation.

Value

print.MTDest

Invisibly returns the "MTDest" object, after displaying its lag set, state space, final log-likelihood, and iteration count (if available).

summary.MTDest

Invisibly returns a named list with fields: call, S, A, lambdas, pj, p0 (or NULL),logLik, oscillations, iterations, lastComputedDelta and deltaLogLik. The same information is printed to the console in a readable format.

logLik.MTDest

An object of class "logLik" with attributes df (number of free parameters) and nobs (effective sample size).

Arguments

x

An object of class "MTDest" (for print.MTDest(x, ...)).

object

An object of class "MTDest".

...

Further arguments passed to or from other methods (ignored).

Details

These methods handle objects returned by MTDest (class c("MTDest","MTD")):

  • print.MTDest() displays a compact summary of the fitted model: the lag set (S), the state space (A), the final log-likelihood, and, if available, the number of EM updates performed.

  • summary.MTDest() computes and prints a detailed summary of the key components of the object, including lambdas, transition matrices, independent distribution (if present), log-likelihood, and (if available) oscillations and iteration diagnostics.

  • logLik.MTDest() returns the log-likelihood as an object of class "logLik", with attributes df (number of free parameters under the multimatrix model) and nobs (effective sample size).

See Also

MTDest, as.MTD, MTD-methods, oscillation, perfectSample, probs

Examples

Run this code
if (FALSE) {
set.seed(1)
MTD <- MTDmodel(Lambda = c(1, 3), A = c(0, 1), lam0 = 0.01)
X <- perfectSample(MTD, N = 200)  # small N to keep examples fast
init <- list(
  p0 = c(0.4, 0.6),
  lambdas = c(0.05, 0.45, 0.5),
  pj = list(
    matrix(c(0.2, 0.8, 0.45, 0.55), byrow = TRUE, ncol = 2),
    matrix(c(0.25, 0.75, 0.3, 0.7),  byrow = TRUE, ncol = 2)
  )
)
fit <- MTDest(X, S = c(1, 3), init = init, iter = TRUE)
print(fit)
summary(fit)
coef(fit) # Works by inheritance
logLik(fit)
BIC(fit)
}

Run the code above in your browser using DataLab