Skip to content

Commit 9e2f73f

Browse files
committed
temporary fix, that yields inefficient sampler
1 parent a04e243 commit 9e2f73f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/gaussian-process/script.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
using Pkg
2+
Pkg.activate("/sftwr/user-pkg/m1cak00/julia/dev/AdvancedPS/examples/gaussian-process")
3+
14
# # Gaussian Process State-Space Model (GP-SSM)
25
using LinearAlgebra
36
using Random
@@ -25,14 +28,14 @@ end
2528
function SSMProblems.simulate(
2629
rng::AbstractRNG, dyn::GaussianProcessDynamics, step::Int, state
2730
)
28-
dyn.proc = posterior(dyn.proc(step:step), [state])
31+
dyn.proc = posterior(dyn.proc(step:step, 0.1), [state])
2932
μ, σ = mean_and_cov(dyn.proc, [step])
3033
return rand(rng, Normal(μ[1], sqrt(σ[1])))
3134
end
3235

3336
function SSMProblems.logdensity(dyn::GaussianProcessDynamics, step::Int, state, prev_state)
3437
μ, σ = mean_and_cov(dyn.proc, [step])
35-
return logpdf(Normal(μ, sqrt(σ)), state)
38+
return logpdf(Normal[1], sqrt[1])), state)
3639
end
3740

3841
# Linear Gaussian dynamics used for simulation
@@ -79,7 +82,7 @@ _, x, y = sample(rng, true_model, 100);
7982
gpssm = GaussianProcessStateSpaceModel(0.5, SqExponentialKernel())
8083
model = gpssm(y)
8184
pg = AdvancedPS.PGAS(20)
82-
chains = sample(rng, model, pg, 250)
85+
chains = sample(rng, model, pg, 50)
8386
#md nothing #hide
8487

8588
particles = hcat([chain.trajectory.model.X for chain in chains]...)

0 commit comments

Comments
 (0)