1

How can we calculate Emission probabilities for a Hidden Markov Model (HMM) in R?

As for calculating Transition Probabilities we use function

tr <- seqtrate(exampledata)

and this function returns a Transition Matrix. Example data is a sequential data.

Is there a function that returns us an Emission Matrix?

zx8754
  • 52,746
  • 12
  • 114
  • 209

1 Answers1

0

Please have a look to R's HMM package from https://cran.r-project.org/web/packages/HMM/HMM.pdf

You can find such an example there

hmm = initHMM(c("A","B"), c("L","R"), transProbs=matrix(c(.8,.2,.2,.8),2),
              emissionProbs=matrix(c(.6,.4,.4,.6),2))
print(hmm)
# Sequence of observations
observation = c("L","L","R","R")
baumWelch(hmm, observation, maxIterations=100, delta=1E-9, pseudoCount=0)

baumWelch algorithm returns the updated emission probabilities.

boyaronur
  • 521
  • 6
  • 18
  • Hey thanks. I have checked the link you shared. you can see that in the example you shared they have provided the values for transition and EMISSION probabilities. But in my case,I have to calculate these probabilities for my dataset.For a transition matrix **tr <- seqtrate(exampledata)** this line of code returns a transition matrix. I am seaching something like this to get an emission matrix. @boyaronur – Aymen Tasneem Oct 05 '18 at 19:20