RNG never used when sampling initial state
In simulate.jl, a random state is sampled from the Gaussian Belief:
# make initial state
s0 = rand(rng, b0)
However, the rng passed into the rand() function isn't actually used to seed experiments; in kf_classes.jl, the rand() function is defined as
function Base.rand(rng::AbstractRNG, b::GaussianBelief)
return b.μ + cholesky(b.Σ).L * randn(size(b.Σ,1))
end
Should there be two extensions of rand() - one that dispatches on the rng for simulation reproducibility and one that does not? For example,
function Base.rand(rng::AbstractRNG, b::GaussianBelief)
return b.μ + cholesky(b.Σ).L * randn(rng, size(b.Σ,1))
end
function Base.rand(b::GaussianBelief)
return b.μ + cholesky(b.Σ).L * randn(size(b.Σ,1))
end
You should only have to implement 1 new method. Read this: https://docs.julialang.org/en/v1/stdlib/Random/#Hooking-into-the-Random-API
I think you should only have to implement 1 method with SamplerTrivial to get everything to work
Specifically https://docs.julialang.org/en/v1/stdlib/Random/#A-simple-sampler-without-pre-computed-data
I think you should just define
rand (rng::AbstractRNG, s::Random.SamplerTrivial{<:GaussianBelief})
And everything should work