diff --git a/Project.toml b/Project.toml index 4e4eb4cac..3251939c3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DynamicPPL" uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8" -version = "0.23.5" +version = "0.23.6" [deps] AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001" diff --git a/src/test_utils.jl b/src/test_utils.jl index cc2d27803..394341c04 100644 --- a/src/test_utils.jl +++ b/src/test_utils.jl @@ -621,6 +621,13 @@ const UnivariateAssumeDemoModels = Union{ function posterior_mean(model::UnivariateAssumeDemoModels) return (s=49 / 24, m=7 / 6) end +function likelihood_optima(::DynamicPPL.TestUtils.UnivariateAssumeDemoModels) + return (s=1 / 16, m=7 / 4) +end +function posterior_optima(::DynamicPPL.TestUtils.UnivariateAssumeDemoModels) + # TODO: Figure out exact for `s`. + return (s=0.907407, m=7 / 6) +end function Random.rand( rng::Random.AbstractRNG, ::Type{NamedTuple}, model::UnivariateAssumeDemoModels ) @@ -654,6 +661,31 @@ function posterior_mean(model::MultivariateAssumeDemoModels) return vals end +function likelihood_optima(model::DynamicPPL.TestUtils.MultivariateAssumeDemoModels) + # Get some containers to fill. + vals = Random.rand(model) + + # NOTE: These are "as close to zero as we can get". + vals.s[1] = 1e-32 + vals.s[2] = 1e-32 + + vals.m[1] = 1.5 + vals.m[2] = 2.0 + + return vals +end +function posterior_optima(model::DynamicPPL.TestUtils.MultivariateAssumeDemoModels) + # Get some containers to fill. + vals = Random.rand(model) + + # TODO: Figure out exact for `s[1]`. + vals.s[1] = 0.890625 + vals.s[2] = 1 + vals.m[1] = 3 / 4 + vals.m[2] = 1 + + return vals +end function Random.rand( rng::Random.AbstractRNG, ::Type{NamedTuple}, model::MultivariateAssumeDemoModels ) @@ -684,6 +716,31 @@ function posterior_mean(model::MatrixvariateAssumeDemoModels) return vals end +function likelihood_optima(model::DynamicPPL.TestUtils.MatrixvariateAssumeDemoModels) + # Get some containers to fill. + vals = Random.rand(model) + + # NOTE: These are "as close to zero as we can get". + vals.s[1, 1] = 1e-32 + vals.s[1, 2] = 1e-32 + + vals.m[1] = 1.5 + vals.m[2] = 2.0 + + return vals +end +function posterior_optima(model::DynamicPPL.TestUtils.MatrixvariateAssumeDemoModels) + # Get some containers to fill. + vals = Random.rand(model) + + # TODO: Figure out exact for `s[1]`. + vals.s[1, 1] = 0.890625 + vals.s[1, 2] = 1 + vals.m[1] = 3 / 4 + vals.m[2] = 1 + + return vals +end function Base.rand( rng::Random.AbstractRNG, ::Type{NamedTuple}, model::MatrixvariateAssumeDemoModels )