문제

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,

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top