hmmcontSimul: Simulation of an observation and underlying Markov processes...

Description Usage Arguments Value Author(s) See Also Examples

Description

The function simulates (i) two observation processes that correspond to the distributions of the two states in an HMM, (ii) the underlying Markov process, and (iii) an observation process that correspond to an HMM in terms of both the underlying Markov and observations processes. The function uses the last-iteration parameters, when the HMM-object was modified by function baumwelchcont previously.

Usage

1
hmmcontSimul(hmm, n)

Arguments

hmm

An object of the class ContObservHMM

n

Number of observations to be simulated.

Value

The function returns an object of the class SimulContHMM that is a list comprising the two observations processes (each corresponds to the distribution of one of the two states), the Markov chain (i.e. the underlying process consisting of two states), and the observation process that correspond to that Markov chain and the two distributions. Hence, the latter is the process simulated according a given HMM.

Author(s)

Mikhail A. Beketov

See Also

Functions: hmmsetcont, baumwelchcont, and viterbicont.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Returns<-(logreturns(Prices))*10
hmm<-hmmsetcont(Returns)
for(i in 1:6){hmm<-baumwelchcont(hmm)} 
hmmcomplete<-viterbicont(hmm)

sim<-hmmcontSimul(hmmcomplete, n=100) # simulating the processes

plot(sim$StateProcess1, type="l", ylab="State 1 Process")
plot(sim$StateProcess2, type="l", ylab="State 2 Process")
plot(sim$MarkovChain, type="l", ylab="Markov chain")
plot(sim$SimulatedObservation, type="l", ylab="Full HMM Process")

HMMCont documentation built on May 1, 2019, 10:46 p.m.