helske / KFAS

KFAS: R Package for Exponential Family State Space Models
64 stars 17 forks source link

model components in the KFAS package #45

Closed suprajamalladi closed 4 years ago

suprajamalladi commented 4 years ago

Hi! My research is primarily on SSM using KFAS but I always wondered if the model components were stochastic in KFAS? is there a specific method to differentiate in terms of building a model for stochastic and non stochastic model coefficients? I know there is a specific way to do that using DLM but not sure with KFAS

helske commented 4 years ago

The definition of stochastic and non-stochastic model components works in the same way, you just have to define matrix Q (the covariance matrix of the state-level noise) and perhaps P1 and/or P1inf (prior distribution of the alpha_1) accordingly your needs.

suprajamalladi commented 4 years ago

Thank you for your response! The below example is the kind of model I am using:

for example: model <-SSModel(data.1~SSMtrend(2,Q=list(NA,NA))+ SSMseasonal(period=12,sea.type='dummy',Q=NA), data=data1,H=NA)

you mean to say: the above model has no P1 and P1inf mentioned and Q is all NA,so is it a stochastic model? when i have predefined values for Q and P1,P1inf: you mean to say the model becomes non-stochastic?

helske commented 4 years ago

No, I mean that if Q is set to zero then there is no noise term in the state equation so the states are non-stochastic.

suprajamalladi commented 4 years ago

ok i get it, thank you for your response!