Skip to content

Commit

Permalink
Update test references (#44)
Browse files Browse the repository at this point in the history
* Update test references

* Update show test

* Run formatter

* Increment patch number

* Set new Distributions lower bound

* Bump minimum Julia version to v1.4

* Bump minimum Julia version to v1.6
  • Loading branch information
sethaxen authored Apr 7, 2023
1 parent 331f038 commit ee2a35f
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1.6'
- '1'
os:
- ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PSIS"
uuid = "ce719bf2-d5d0-4fb9-925d-10a81b42ad04"
authors = ["Seth Axen <[email protected]> and contributors"]
version = "0.7.1"
version = "0.7.2"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -12,13 +12,13 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
AxisArrays = "0.4"
Distributions = "0.21.1, 0.22, 0.23, 0.24, 0.25"
Distributions = "0.25.81"
JLD2 = "0.4"
LogExpFunctions = "0.2.0, 0.3"
Plots = "1"
RecipesBase = "1"
ReferenceTests = "0.9"
julia = "1"
julia = "1.6"

[extras]
AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9"
Expand Down
2 changes: 1 addition & 1 deletion src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ While `psis` computes smoothed log weights out-of-place, `psis!` smooths them in
- `log_ratios`: an array of logarithms of importance ratios, with one of the following
sizes:
+ `(ndraws,)`: a vector of draws for a single parameter from a single chain
+ `(ndraws, nparams)`: a matrix of draws for a multiple parameter from a single chain
+ `(ndraws, nchains, nparams)`: an array of draws for multiple parameters from
Expand Down
2 changes: 1 addition & 1 deletion src/ess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ where ``r_{\\mathrm{eff}}`` is the relative efficiency of the `log_weights`.
Estimate ESS for Pareto-smoothed importance sampling.
!!! note
ESS estimates for Pareto shape values ``k > 0.7``, which are unreliable and misleadingly
high, are set to `missing`. To avoid this, set `bad_shape_missing=false`.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/generalized_pareto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Construct the generalized Pareto distribution (GPD) with location parameter ``μ
parameter ``σ`` and shape parameter ``k``.
!!! note
The shape parameter ``k`` is equivalent to the commonly used shape parameter ``ξ``.
This is the same parameterization used by [^VehtariSimpson2021] and is related to that
used by [^ZhangStephens2009] as ``k \\mapsto -k``.
Expand Down
13 changes: 5 additions & 8 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ using AxisArrays: AxisArrays
PSISResult with 100 draws, 1 chains, and 30 parameters
Pareto shape (k) diagnostic values:
Count Min. ESS
(-Inf, 0.5] good 4 (13.3%) 95
(0.5, 0.7] okay 2 (6.7%) 97
(-Inf, 0.5] good 2 (6.7%) 98
(0.5, 0.7] okay 6 (20.0%) 92
(0.7, 1] bad 4 (13.3%) ——
(1, Inf) very bad 19 (63.3%) ——
(1, Inf) very bad 17 (56.7%) ——
—— missing 1 (3.3%) ——"""
end
end
Expand Down Expand Up @@ -276,11 +276,8 @@ end
Dict("log_weights" => logw, "pareto_shape" => result.pareto_shape),
by =
(ref, x) ->
isapprox(
permutedims(ref["log_weights"], (2, 3, 1)),
x["log_weights"];
rtol=1e-6,
) && isapprox(ref["pareto_shape"], x["pareto_shape"]; rtol=1e-6),
isapprox(ref["log_weights"], x["log_weights"]; rtol=1e-6) &&
isapprox(ref["pareto_shape"], x["pareto_shape"]; rtol=1e-6),
)
end
end
Expand Down
Binary file modified test/references/normal_to_cauchy_reff_0.7.jld2
Binary file not shown.
Binary file modified test/references/normal_to_cauchy_reff_0.7_improved.jld2
Binary file not shown.
Binary file modified test/references/normal_to_cauchy_reff_1.2.jld2
Binary file not shown.
Binary file modified test/references/normal_to_cauchy_reff_1.2_improved.jld2
Binary file not shown.

2 comments on commit ee2a35f

@sethaxen
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/81227

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.2 -m "<description of version>" ee2a35ff59d86f741d2be200805572916d7e15b8
git push origin v0.7.2

Please sign in to comment.