Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompatHelper: bump compat for AbstractMCMC to 4, (keep existing compat) #28

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Expand Up @@ -11,7 +11,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
AbstractMCMC = "3.2"
AbstractMCMC = "3.2, 4"
ArrayInterface = "2, 3, 4, 5"
Distributions = "0.22, 0.23, 0.24, 0.25"
julia = "1"
Expand Down
20 changes: 20 additions & 0 deletions test/simple.jl
Expand Up @@ -33,6 +33,11 @@
@test all(length(x) == 2_000 for x in samples)
@test mean(mean, samples) ≈ μ atol = 0.05
@test mean(var, samples) ≈ σ² atol = 0.05

# initial parameter
init_x = randn(5)
samples = sample(ESSModel(prior, ℓ), ESS(), alg, 10, 5; progress=false, init_params=init_x)
devmotion marked this conversation as resolved.
Show resolved Hide resolved
@test map(first, samples) == init_x
end

# initial parameter
Expand Down Expand Up @@ -66,6 +71,11 @@
@test all(length(x) == 2_000 for x in samples)
@test mean(mean, samples) ≈ μ atol = 0.05
@test mean(var, samples) ≈ σ² atol = 0.05

# initial parameter
init_x = randn(5)
samples = sample(ESSModel(prior, ℓ), ESS(), alg, 10, 5; progress=false, init_params=init_x)
devmotion marked this conversation as resolved.
Show resolved Hide resolved
@test map(first, samples) == init_x
end

# initial parameter
Expand Down Expand Up @@ -100,6 +110,11 @@
@test all(length(x) == 2_000 for x in samples)
@test mean(mean, samples) ≈ μ atol = 0.05
@test mean(var, samples) ≈ σ² atol = 0.05

# initial parameter
init_x = [randn(1) for _ in 1:5]
samples = sample(ESSModel(prior, ℓvec), ESS(), alg, 10, 5; progress=false, init_params=init_x)
devmotion marked this conversation as resolved.
Show resolved Hide resolved
@test map(first, samples) == init_x
end

# initial parameter
Expand Down Expand Up @@ -136,6 +151,11 @@
@test all(length(x) == 2_000 for x in samples)
@test mean(mean, samples) ≈ μ atol = 0.05
@test mean(var, samples) ≈ σ² atol = 0.05

# initial parameter
init_x = [randn(1) for _ in 1:5]
samples = sample(ESSModel(prior, ℓvec), ESS(), alg, 10, 5; progress=false, init_params=init_x)
devmotion marked this conversation as resolved.
Show resolved Hide resolved
@test map(first, samples) == init_x
end

# initial parameter
Expand Down