Commit b4fa17e4 authored by Peter Jentsch's avatar Peter Jentsch
Browse files

fix bug in shift... use distributions rather than sampler

parent 0c4e34f0
......@@ -39,7 +39,7 @@ const contact_time_distributions = load_contact_time_distributions()
function shift_contact_distributions(sampler_matrix::AbstractMatrix{T},proportion) where T<:Distributions.PoissonADSampler
return map(sampler_matrix) do sampler
μ_old = sampler.μ
return Distributions.PoissonADSampler(μ_old*proportion)
return Poisson(μ_old*proportion)
end
end
......
......@@ -101,9 +101,9 @@ function load_mixing_matrices()
return map(t -> from_mean.(Geometric{Float64},t),workschool_mixing), map(t -> from_mean.(Geometric{Float64}, t),rest_mixing)
end
function make_sampler(λ)
return Distributions.PoissonADSampler(λ)#Distributions.DiscreteNonParametricSampler(0:durmax,[pdf(Poisson(λ),x) for x in 0:durmax])
end
# function make_sampler(λ)
# return Distributions.PoissonADSampler(λ)#Distributions.DiscreteNonParametricSampler(0:durmax,[pdf(Poisson(λ),x) for x in 0:durmax])
# end
function load_contact_time_distributions()
distkey = "Distributions.Poisson"
fnames = (
......@@ -113,7 +113,7 @@ function load_contact_time_distributions()
)
contact_distributions_tuple = map(fnames) do fname
dat = deserialize(joinpath(PACKAGE_FOLDER,"intervals_model_output","simulation_output","$fname.dat"))
return map(p -> make_sampler(mode(p.particles)), as_symmetric_matrix(dat[distkey].P))
return map(p -> Poisson(mode(p.particles)), as_symmetric_matrix(dat[distkey].P))
end
return contact_distributions_tuple
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment