tags:

views:

141

answers:

1

Hello,

My apologies if this is more of a statistics question than an R question. I am trying to estimate the following model in R.

y_t = mu0 (1 - S_t) + mu1 S_t + e_t e_t ~ N(0, sigma_t^2) sigma_t^2 = sigma_0^2 (1 - S_t) + sigma_1^2 S_t

where mu_t = mu0 if S_t = 0, mu_t = mu1 if S_t = 1, and S_t is a Markov process, either 0 or 1, with transition probabilities P(S_t = 1 | S_t-1 = 1 ) = p and P(S_t = 0 | S_t-1 = 0 ) = q.

Would 'flexmix' be a good library to use for this? I am new to this kind of statistics so any pointer to the right library would be appreciated.

Thanks,

+1  A: 

This looks like the exactly type of model you could easily code up in Bugs or Jags. Bugs/Jags is probably the most flexible approach to estimating custom models in R. You can easily move between R and Jags using R2Jags.

If you are new to Bayesian models, it may take a bit to get up to speed.

Tristan
Thanks for the suggestions. I think what I want to estimate is a Markov-switching ARCH model. I am trying to duplicate the results of this paper:http://linkinghub.elsevier.com/retrieve/pii/0304405X89900949I know there is the MSVAR package, which isn't quite what I want. Maybe fMarkovSwitching, although that looks like it isn't maintained at the moment. Maybe bayesGARCH? Any experience with any of those? Thanks for the help.
stevejb
I doubt this model is implemented in any standard package. The paper uses the EM algorithm. Setting the model up in a Bayesian framework, using Jags, is generally much easier and more robust. However, you will need to specify some priors that aren't in the paper.I assume you're doing this for academic reasons. A finite-state markov model does not seem particularly compelling in the real world.
Tristan
Hi Tristan, yes I am doing this for academic reasons, just trying to learn more about this particular model. I'll give Jags a shot. Thanks for the advice.
stevejb