View source: R/functions_HMMRel.R
sim.hmmR | R Documentation |
This function simulates a sample path from a 2-dimensional HMM. It returns the hidden sequence of states and signals. At each time, the hidden state of the system is simulated from the HMM as well as the associated signal that informs on the system performance at that time.
sim.hmmR(hmmR,n)
hmmR |
A Hidden Markov Model. |
n |
An integer number indicating the length of the sequence of states and signals to be simulated. |
The function sim.hmmR
returns a list with the following information:
Xn |
The sequence of simulated hidden states. |
Yn |
The sequence of observed signals. |
P |
The transition probability matrix of the hidden Markov chain (MC). |
alpha |
The initial distribution of the hidden MC. |
M |
The emission probability matrix. |
states |
The set of hidden states of the system. |
signal |
The alphabet corresponding to the observations. |
M.L. Gamiz, N. Limnios, and M.C. Segovia-Garcia (2024)
Gamiz, M.L., Limnios, N., Segovia-Garcia, M.C. (2023). Hidden Markov models in reliability and maintenance. European Journal of Operational Research, 304(3), 1242-1255.
See def.hmmR
to define a HMM object.
## Define a HMM object describing a repairable system
P<-matrix(c(8,2,1,0,6,4,6,2,2)/10,3,3,byrow=TRUE)
M<-matrix(c(7,3,0,4,3,3,0,4,6)/10,3,3,byrow=TRUE)
hmm1<-def.hmmR(model='other',rate=NA,p=NA,alpha=c(1,0,0),P=P,M=M,Nx=3,Ny=3,n.up=2,n.green=2)
sim.hmmR(hmmR=hmm1,n=20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.