djpedregal / SSpace

A flexible and powerful State Space Matlab toolbox for linear Gaussian, non-linear and non-Gaussian univariate and multivariate systems.
GNU General Public License v3.0
5 stars 0 forks source link

Building multivariate non-gaussian model #2

Open zjph602xtc opened 3 years ago

zjph602xtc commented 3 years ago

Dear Dr. Pedregal,

I have an ss model that y=(y1, y2) is two-dimensional where y1 follows a normal distribution and y2 follows a binomial distribution (n is known). They are conditionally independent given the latent state. I am wondering whether the sspace toolbox can handle this kind of question. If it does, how can I write model.dist and model.param? I guess model.dist = [Gaussian Binomial]? (but 'Gaussian' is not in the distribution list and this seems to return an error).

My second question is that in your document, in the non-gaussian model, yt ~ p(yt| theta_t)+ Dt, and theta_t = Z_t alpha_t. So that there is no H_t matrix involved. Then in SampleNONGAUSS.m, it says (line 17), 'Beware that the 'H' input to this function, i.e. the observational noise variance, is compulsory.' I'm not sure why do we need H, and what is this H_t referring to in the non-gaussian model.

Thank you!!

Regards Peter

djpedregal commented 3 years ago

Thank you very much for your interest in SSpace. Unfortunately SSpace does not handle multivariate non-Gaussian cases, so the answer to your first question is that it cannot be directly implemented. There may be, however some sort of Gaussian approximation. Check a references by Harvey and Esther Ruiz about Stochastic volatility approximated by linear Gaussian models, I am not sure it would do.

Regarding the second question, the help about the compulsory ‘H’ is in terms of code, it means that you should not remove the H from the inputs to the SampleNONGAUSS template because SSpace would crash. In the case you comment you are right, H is not used and SSpace uses H = 0 internally for the case you comment. It may be different from zero for other non-Gaussian models, heavy T-tailed or Stochastic Volatility models. See Durbin and Koopman (2012). You may see an example in demo7: the user does not specify H and SSpace assign a value of 0 to it internally.

I hope this helps. Best wishes. Diego.

El 30 dic 2020, a las 10:21, Peter_Xu notifications@github.com<mailto:notifications@github.com> escribió:

Dear Dr. Pedregal,

I have an ss model that y=(y1, y2) is two-dimensional where y1 follows a normal distribution and y2 follows a binomial distribution (n is known). They are conditionally independent given the latent state. I am wondering whether the sspace toolbox can handle this kind of question. If it does, how can I write model.dist and model.param? I guess model.dist = ['Gaussian' 'Binary']? (but 'Gaussian' is not in the distribution list).

My second question is that in your document, in the non-gaussian model, yt ~ p(yt| theta_t)+ Dt, and theta_t = Z_t alpha_t. So that there is no H_t matrix involved. Then in SampleNONGAUSS.m, it says (line 17), 'Beware that the 'H' input to this function, i.e. the observational noise variance, is compulsory.' I'm not sure why do we need H, and what is this H_t referring to in the non-gaussian model.

Thank you!!

Regards Peter

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/djpedregal/SSpace/issues/2, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG3UEQ74BT7TGALE52BR2H3SXLWH7ANCNFSM4VOD2W6Q.

zjph602xtc commented 3 years ago

Thank you so much for your quick response!

Btw, do you know any software that can handle multivariate non-Gaussian cases in Matlab/R/Python? I tried SSM toolbox, but it only runs in 32-bit environment (due to the 32-bit mex file). I also tried KFAS package, but the result is extremely unstable. It would be very appreciated if you have any other suggestions.

Thank you!

Regards Peter

djpedregal commented 3 years ago

I have never used it before, you may check SSfpack and PCGive. Bye they are commercial… I am sorry I cannot be more specific. Diego.

El 30 dic 2020, a las 11:45, Peter_Xu notifications@github.com<mailto:notifications@github.com> escribió:

Thank you so much for your quick response!

Btw, do you know any software that can handle multivariate non-Gaussian cases in Matlab/R/Python? I tried SSM toolboxhttps://www.jstatsoft.org/article/view/v041i06, but it only runs in 32-bit environment (due to the 32-bit mex file). I also tried KFAS packagehttps://cran.r-project.org/package=KFAS, but the result is extremely unstable. It would be very appreciated if you have any other suggestions.

Thank you!

Regards Peter

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/djpedregal/SSpace/issues/2#issuecomment-752413047, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG3UEQZATNGL2BGHGHQJF5LSXMAGFANCNFSM4VOD2W6Q.