1
$\begingroup$

Is there any detailed materials that can help explain how to set up HMM on R Studio?

$\endgroup$
  • 1
    $\begingroup$ have you seen here? $\endgroup$ – Media Jan 21 '18 at 15:12
0
$\begingroup$

You can take a look at here. As you can read from there:

  1. Download and unpack hiddenDomains

If you haven't already done this, download the latest version of hiddenDomains from the Sourceforge website

Now unpack it

shell$ tar -xzvf hiddenDomains.VERSION.NUMBER.tar.gz

Where VERSION and NUMBER represent the release that you downloaded.

  1. Install R and required R packages (if necessary) Download and install R if you don't already have it.

If you don't already have them, you will need to install two hidden Markov model libraries:

depmixS4
HiddenMarkov
You can do this by starting R on the command line:

shell$ R

Or, if you prefer RStudio, you can use that.

Regardless of how you started R, type the following commands to install the packages.

> install.packages("depmixS4")
> install.packages("HiddenMarkov")

Here and here may also be helpful for knowing how to use it.

$\endgroup$
0
$\begingroup$

There is a package called ‘HMM’ (not 'hmm'). You can find the documentation here. There are a lot of tutorials available.

$\endgroup$
0
$\begingroup$

Use depmixS4 package in R. This basic example would help-

https://machinelearningstories.blogspot.com/2017/02/hidden-markov-model-session-1.html

depmixs4 vignette is also present. u can get in package also.

A simple code sample would be-

R Code snippets-

Required library

library(depmixS4)

data loading-

physician_prescrition_data <-c(12,16,45,45,56,67,78,98,120,124,156)

model execution-

HMM_model <- depmixS4::depmix(physician_prescrition_data~1, nstates = 2,ntimes=length(physician_prescrition_data))

model fitting

HMM_fm <- fit(HMM_model)

Transition probabilties-

HMM_fm@transition

posterior states-

posterior(HMM_fm) plot(ts(posterior(HMM_fm)[,1]))

Emission probabilties-

HMM_fm@response

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.