helske / KFAS

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

Documentation: "more complex model" example #71

Closed gergelybat closed 2 years ago

gergelybat commented 2 years ago

In the reference manual (KFAS.pdf) under "More complex model" the following model is defined: model <- SSModel(y ~ SSMregression(~ x1 + x2, Q = 0, R = matrix(c(1, 0), 2, 1)) + SSMarima(rep(0, 2), 0, Q = 0), H = 0) Later on the coefficient for x2 (beta2) is not estimated. In order to make it work, I made the following changes (but I'm new to KFAS, this might be not the right approach):

helske commented 2 years ago

beta2 is estimated similarly as the intercept and beta1, they are all part of the state vector, with variance of intercept and beta2 being constant. It is just I did not draw beta2 at the end as it is constant.

gergelybat commented 2 years ago

Thank you for the explanation. I really overcomplicated this.