Replies: 1 comment
-
Hi @caxelrud! Yes we do, you can check out the mountain car example in our docs. The code there is a bit complicated, so for clarity I would recommend checking out the Kalman filtering example. The model specification in this notebook can easily be adapted to include controls, as shown below @model function rotate_ssm(nr_samples, x0, A, B, C, Q, P)
x = randomvar(nr_samples) # hidden states
u = randomvar(nr_samples) # latent controls
y = datavar(Vector{Float64}, nr_samples) # observations
# prior on latent state
x_prior ~ MvNormalMeanCovariance(mean(x0), cov(x0))
x_prev = x_prior
for n in 1 : nr_samples
# prior on controls
u[n] ~ MvNormalMeanCovariance(zeros(2), I)
# state transition with inputs
x[n] ~ MvNormalMeanCovariance(A * x_prev + B * u[n], Q)
# observation model
y[n] ~ MvNormalMeanCovariance(C * x[i], P)
x_prev = x[n]
end
end I hope this helps :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, do you have a Kalman filtering example that includes a State-Space system with inputs (u)?
Generally described as:
x(n+1)=A.x(n)+B.u(n)
y(n)=C.x(n)+D.u(n)
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions