SimHMMGen: Simulation of univariate hidden Markov model

Description Usage Arguments Details Value Examples

View source: R/SimHMMGen.R

Description

This function simulates observation from a univariate hidden Markov model

Usage

1
SimHMMGen(Q, family, theta, n, graph = 0)

Arguments

Q

transition probability matrix; (r x r)

family

distribution name; run the function distributions() for help

theta

parameters; (r x p)

n

number of simulated observations

graph

1 for a graph, 0 otherwise (default); only for continuous distributions

Details

HMM observations simulation

Value

SimData

Simulated data

MC

Simulated Markov chain

Sim

Simulated Data for each regime

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
family = "gaussian"
Q = matrix(c(0.8, 0.3, 0.2, 0.7), 2, 2) ; theta = matrix(c(-1.5, 1.7, 1, 1),2,2) ;
sim = SimHMMGen(Q, family, theta, 500, 0)



family = "binomial"
size = 5
Q = matrix(c(0.8, 0.3, 0.2, 0.7), 2, 2) ; thetaB = matrix(c(size, size, 0.2, 0.7),2,2) ;
simB = SimHMMGen(Q, family, thetaB, 500, graph=0)$SimData

GenHMM1d documentation built on Jan. 21, 2021, 9:07 a.m.

Related to SimHMMGen in GenHMM1d...