Is there any detailed materials that can help explain how to set up HMM on R Studio?
You can take a look at here. As you can read from there:
- 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.
- 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:
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")
There is a package called ‘HMM’ (not 'hmm'). You can find the documentation here. There are a lot of tutorials available.
Use depmixS4 package in R. This basic example would help-
depmixs4 vignette is also present. u can get in package also.
A simple code sample would be-
R Code snippets-
HMM_model <- depmixS4::depmix(physician_prescrition_data~1, nstates = 2,ntimes=length(physician_prescrition_data))
HMM_fm <- fit(HMM_model)