Skip to content

Commit 9ab460c

Browse files
committed
Fix Literate Errors
1 parent 98ba9b6 commit 9ab460c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

examples/gaussian-ssm/script.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mutable struct Parameters{AT<:Real,QT<:Real,RT<:Real}
3434
r::RT
3535
end
3636

37-
struct GaussianPrior <: SSMProblems.StatePrior
37+
struct GaussianPrior{ΣT<:Real} <: SSMProblems.StatePrior
3838
σ::ΣT
3939
end
4040

@@ -43,7 +43,7 @@ struct LinearGaussianDynamics{AT<:Real,QT<:Real} <: SSMProblems.LatentDynamics
4343
q::QT
4444
end
4545

46-
function SSMProblems.distribution(dyn::GaussianPrior; kwargs...)
46+
function SSMProblems.distribution(prior::GaussianPrior; kwargs...)
4747
return Normal(0, prior.σ)
4848
end
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)
6969
end
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.
8383
pgas = 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
#

examples/levy-ssm/script.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ function meancov(t, dyn::LangevinDynamics, path::GammaPath, dist::Normal)
6161
fts = exp.(Ref(dyn), (t .- path.times)) .* Ref(dyn.L)
6262
μ = sum(@. fts * mean(dist) * path.jumps)
6363
Σ = sum(@. fts * transpose(fts) * var(dist) * path.jumps)
64-
65-
# Guarantees positive semi-definiteness
6664
return μ, Σ + eltype(Σ)(1e-6) * I
6765
end
6866

@@ -148,7 +146,6 @@ plot!(
148146
label="Marginal State (x2)",
149147
)
150148

151-
# TODO: collect jumps from the model
152149
p2 = scatter([], []; color=:darkorange, label="Jumps")
153150

154151
plot(

0 commit comments

Comments
 (0)