sim.hmmR: Simulate sequence of states and signals of functioning of a...

View source: R/functions_HMMRel.R

sim.hmmRR Documentation

Simulate sequence of states and signals of functioning of a system modelled by a HMM.

Description

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.

Usage

sim.hmmR(hmmR,n)

Arguments

hmmR

A Hidden Markov Model.

n

An integer number indicating the length of the sequence of states and signals to be simulated.

Value

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.

Author(s)

M.L. Gamiz, N. Limnios, and M.C. Segovia-Garcia (2024)

References

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 Also

See def.hmmR to define a HMM object.

Examples

## 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)

HMMRel documentation built on April 4, 2025, 2:04 a.m.