@@ -34,7 +34,7 @@ mutable struct Parameters{AT<:Real,QT<:Real,RT<:Real}
3434 r:: RT
3535end
3636
37- struct GaussianPrior <: SSMProblems.StatePrior
37+ struct GaussianPrior{ΣT <: Real } <: SSMProblems.StatePrior
3838 σ:: ΣT
3939end
4040
@@ -43,7 +43,7 @@ struct LinearGaussianDynamics{AT<:Real,QT<:Real} <: SSMProblems.LatentDynamics
4343 q:: QT
4444end
4545
46- function SSMProblems. distribution (dyn :: GaussianPrior ; kwargs... )
46+ function SSMProblems. distribution (prior :: GaussianPrior ; kwargs... )
4747 return Normal (0 , prior. σ)
4848end
4949
@@ -65,7 +65,7 @@ function LinearGaussianStateSpaceModel(θ::Parameters)
6565 prior = GaussianPrior (sqrt (θ. q^ 2 / (1 - θ. a^ 2 )))
6666 dyn = LinearGaussianDynamics (θ. a, θ. q)
6767 obs = LinearGaussianObservation (θ. r)
68- return SSMProblems. StateSpaceModel (dyn, obs)
68+ return SSMProblems. StateSpaceModel (prior, dyn, obs)
6969end
7070
7171# Everything is now ready to simulate some data.
@@ -81,7 +81,7 @@ plot!(y; seriestype=:scatter, label="y", xlabel="t", mc=:red, ms=2, ma=0.5)
8181# `AdvancedPS` subscribes to the `AbstractMCMC` API. To sample we just need to define a Particle Gibbs kernel
8282# and a model interface.
8383pgas = AdvancedPS. PGAS (20 )
84- chains = sample (rng, true_model ( y), pgas, 500 ; progress= false );
84+ chains = sample (rng, AdvancedPS . TracedSSM (true_model, y), pgas, 500 ; progress= false );
8585# md nothing #hide
8686
8787#
0 commit comments