bootstrapfun: Function to perform parametric bootstrap

View source: R/bootstrapfun.R

bootstrapfunR Documentation

Function to perform parametric bootstrap

Description

This function simulates the data under the null hypothesis of a Gaussian HMM and compute the Cramér-von Mises test statistic.

Usage

bootstrapfun(mu, sigma, Q, max_iter, prec, n)

Arguments

mu

vector of means for each regime (r x 1);

sigma

vector of standard deviations for each regime (r x 1);

Q

transition probality matrix (r x r);

max_iter

maximum number of iterations of the EM algorithm; suggestion 10 000;

prec

precision (stopping criteria); suggestion 0.0001;

n

length of the time series.

Value

f

values of the density function at time n+k

w

weights of the mixture

Author(s)

Bouchra R Nasri and Bruno N Rémillard, January 31, 2019

References

Chapter 10.2 of B. Rémillard (2013). Statistical Methods for Financial Engineering, Chapman and Hall/CRC Financial Mathematics Series, Taylor & Francis.

Examples

mu <- c(-0.3 ,0.7) ; sigma <- c(0.15,0.05); Q <- matrix(c(0.8, 0.3, 0.2, 0.7),2,2) ;
data <- Sim.HMM.Gaussian.1d(mu,sigma,Q,eta0=1,100)$x
out <- bootstrapfun(mu,sigma,Q,max_iter=10000,prec=0.0001,n=100)


GaussianHMM1d documentation built on July 9, 2023, 6:52 p.m.