asymptoticIterSimCovMat: Compute the asymptotic covariance matrix of a fitted HMM by...

View source: R/RHmm-HyperNew.R

asymptoticIterSimCovMat R Documentation

Compute the asymptotic covariance matrix of a fitted HMM by simulation

Description

This ‘new’ function computes the empirical asymptotic covariance matrix of the fitted HMM.

Usage

asymptoticIterSimCovMat(HMM, obs, nSimul, verbose=FALSE, oldCovMat=NULL)

Arguments

HMM

a HMMClass or HMMFitClass object

obs

A vector, a matrix, a data frame, a list of vectors or a list of matrices of observations. See HMMFit.

nSimul

The number of simulation

verbose

A boolean. if true, displays some informations. Default false.

oldCovMat

An object containing

  • esp2man: The current matrix of the empirical mean of \theta\%*\%t(\theta)

  • mean: The current vector of the empirical mean of \theta

  • cov: the current empirical covariance matrix of \theta

  • nSimul: The current number of simulations

where \theta is the vector of all parameters of the HMM.

Value

An object with the same attributes than ‘oldCovMat’ parameter.

Numerical computations

This is an “experimental” method. The HMM model is simulated nSimul times then fitted and the empirical covariance matrix is computed.

See Also

setAsymptoticCovMat, asymptoticCov

Examples

    # Fit a 3 states 1D-gaussian model
    data(n1d_3s)
    Res <- HMMFit(obs_n1d_3s, nStates=3)
    # First 10 computations of covariance matrix
    Cov <- asymptoticIterSimCovMat(Res, obs_n1d_3s, 10)
    # 10 more computations of covariance matrix
    Cov <- asymptoticIterSimCovMat(Res, obs_n1d_3s, 10, verbose=TRUE, oldCovMat=Cov)
    Res<-setAsymptoticCovMat(Res, Cov$cov)
    summary(Res)
    

RHmm documentation built on Nov. 30, 2023, 7:22 p.m.