TuringLang / SSMProblems.jl

Common abstractions for state-space models
http://turinglang.org/SSMProblems.jl/
MIT License
2 stars 2 forks source link

Question: Can the obervation vector, y_t, depend on y_{t-1}? #21

Closed dleather closed 1 month ago

dleather commented 11 months ago

I randomly came across your project while trying to implement my state-space model in Julia. So consider this both a question and a suggestion..

Does your framework capture models where a subset of $x_t$ (as defined in the documentation) is unobserved. For example, consider a 2-dimensional vector auto-regression model: $Xt = \mu + \Phi X{t-1} + \Sigma * \epsilon_t$, where $\epsilon_t$ is standard MvNormal and only the first element of $X_t$ is observed. The goal would be to filter out the second element of $X_t$ using a particle filter.

As far as I can tell from the documentation such a model would not fit as the conditional distribution of $yt$ would need to depend on $y{t-1}$ in addition to $x_t: y_t | xt, y{t-1} \sim g(y_t | xt, y{t-1})$

Thanks for your time developing this package.

THargreaves commented 8 months ago

I don't think there is anything stopping such a representation.

The way I would think about it is that your control vector ut (which we haven't made explicit in the interface) just so happens to be y{t-1}. Then, my intuition says that you can just ignore the row of the auto-regression model corresponding to the observation since there is no uncertainty in that.

Letting Z_t be the unobserved elements of X_t and y_t the first observed one we have the state-space model.

Zt = \mu[2:D] + \Phi[2:D, 2:D]Z{t-1} + \Phi[2:D, 1]y_{t-1} + noise yt = \mu[1] + \Phi[1, 2:D]Z{t-1} + noise

The only weird thing here is if Sigma is non-diagonal, the process and observation noise are correlated. I'm not exactly sure how to deal with that, but I can have a think.