I am currently trying to establish an interest rate model, where I am trying to incorporate a Markov-Chain that should represent the state of the economy, i.e. 2 states for "good" and "bad". The tricky part is that I assume that the observed interest rates (in my case monthly compounded YTM of US-Tbills) follow a CIR-process of the form, and the Markov-Chain is unobserved.
Usually this is done by using different filtering and smoothing techniques in the EM-Algorithm. Unfortunately, these tend to be quite complicated and I am really struggling to implement them manually in R. So my question would be, which R-package would be the best to get around this problem. I checked out depmixS4 and hiddenmarkov, but they don't work in my case. I would appreciate any hint. Thanks a lot!
Not sure about the CIR process, but the msm
package allows you to estimate continuous-time hidden Markov models: https://cran.r-project.org/web/packages/msm/index.html