diff --git a/ArviZExampleData/dev/.documenter-siteinfo.json b/ArviZExampleData/dev/.documenter-siteinfo.json index 095aa5d82..6755363e9 100644 --- a/ArviZExampleData/dev/.documenter-siteinfo.json +++ b/ArviZExampleData/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-26T01:11:26","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2023-12-27T01:11:09","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/ArviZExampleData/dev/api/index.html b/ArviZExampleData/dev/api/index.html index 340c1c40a..3c1462c8b 100644 --- a/ArviZExampleData/dev/api/index.html +++ b/ArviZExampleData/dev/api/index.html @@ -30,4 +30,4 @@ > prior > prior_predictive > observed_data - > constant_datasource \ No newline at end of file + > constant_datasource \ No newline at end of file diff --git a/ArviZExampleData/dev/datasets/index.html b/ArviZExampleData/dev/datasets/index.html index 6640c2baf..0daf7a95f 100644 --- a/ArviZExampleData/dev/datasets/index.html +++ b/ArviZExampleData/dev/datasets/index.html @@ -87,4 +87,4 @@ This model uses a Von Mises distribution to propose torsion angles for the structure of a glycan molecule (pdb id: 2LIQ), and a Potential to estimate the proposed structure's energy. Said Potential is bound by Boltzman's law. -remote: http://ndownloader.figshare.com/files/22882652 \ No newline at end of file +remote: http://ndownloader.figshare.com/files/22882652 \ No newline at end of file diff --git a/ArviZExampleData/dev/for_developers/index.html b/ArviZExampleData/dev/for_developers/index.html index 9de94a498..81ec4ad1d 100644 --- a/ArviZExampleData/dev/for_developers/index.html +++ b/ArviZExampleData/dev/for_developers/index.html @@ -4,4 +4,4 @@ julia> tarball_url = "https://github.com/arviz-devs/arviz_example_data/archive/refs/tags/v$version.tar.gz"; -julia> add_artifact!("Artifacts.toml", "arviz_example_data", tarball_url; force=true); \ No newline at end of file +julia> add_artifact!("Artifacts.toml", "arviz_example_data", tarball_url; force=true); \ No newline at end of file diff --git a/ArviZExampleData/dev/index.html b/ArviZExampleData/dev/index.html index 76c2d8ee5..bbe75b017 100644 --- a/ArviZExampleData/dev/index.html +++ b/ArviZExampleData/dev/index.html @@ -1 +1 @@ -Home · ArviZExampleData.jl
\ No newline at end of file +Home · ArviZExampleData.jl
\ No newline at end of file diff --git a/InferenceObjects/dev/.documenter-siteinfo.json b/InferenceObjects/dev/.documenter-siteinfo.json index 24f87cc0b..a70ff1276 100644 --- a/InferenceObjects/dev/.documenter-siteinfo.json +++ b/InferenceObjects/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-26T00:41:38","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2023-12-27T00:41:16","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/InferenceObjects/dev/dataset/index.html b/InferenceObjects/dev/dataset/index.html index a41e7abe0..ca0403186 100644 --- a/InferenceObjects/dev/dataset/index.html +++ b/InferenceObjects/dev/dataset/index.html @@ -5,4 +5,4 @@ data::NamedTuple, dims::Tuple{Vararg{DimensionalData.Dimension}}; metadata=DimensionalData.NoMetadata(), -)

In most cases, use convert_to_dataset to create a Dataset instead of directly using a constructor.

source

General conversion

InferenceObjects.convert_to_datasetFunction
convert_to_dataset(obj; group = :posterior, kwargs...) -> Dataset

Convert a supported object to a Dataset.

In most cases, this function calls convert_to_inference_data and returns the corresponding group.

source
InferenceObjects.namedtuple_to_datasetFunction
namedtuple_to_dataset(data; kwargs...) -> Dataset

Convert NamedTuple mapping variable names to arrays to a Dataset.

Any non-array values will be converted to a 0-dimensional array.

Keywords

  • attrs::AbstractDict{<:AbstractString}: a collection of metadata to attach to the dataset, in addition to defaults. Values should be JSON serializable.
  • library::Union{String,Module}: library used for performing inference. Will be attached to the attrs metadata.
  • dims: a collection mapping variable names to collections of objects containing dimension names. Acceptable such objects are:
    • Symbol: dimension name
    • Type{<:DimensionsionalData.Dimension}: dimension type
    • DimensionsionalData.Dimension: dimension, potentially with indices
    • Nothing: no dimension name provided, dimension name is automatically generated
  • coords: a collection indexable by dimension name specifying the indices of the given dimension. If indices for a dimension in dims are provided, they are used even if the dimension contains its own indices. If a dimension is missing, its indices are automatically generated.
source

DimensionalData

As a DimensionalData.AbstractDimStack, Dataset also implements the AbstractDimStack API and can be used like a DimStack. See DimensionalData's documentation for example usage.

Tables inteface

Dataset implements the Tables interface. This allows Datasets to be used as sources for any function that can accept a table. For example, it's straightforward to:

\ No newline at end of file +)

In most cases, use convert_to_dataset to create a Dataset instead of directly using a constructor.

source

General conversion

InferenceObjects.convert_to_datasetFunction
convert_to_dataset(obj; group = :posterior, kwargs...) -> Dataset

Convert a supported object to a Dataset.

In most cases, this function calls convert_to_inference_data and returns the corresponding group.

source
InferenceObjects.namedtuple_to_datasetFunction
namedtuple_to_dataset(data; kwargs...) -> Dataset

Convert NamedTuple mapping variable names to arrays to a Dataset.

Any non-array values will be converted to a 0-dimensional array.

Keywords

  • attrs::AbstractDict{<:AbstractString}: a collection of metadata to attach to the dataset, in addition to defaults. Values should be JSON serializable.
  • library::Union{String,Module}: library used for performing inference. Will be attached to the attrs metadata.
  • dims: a collection mapping variable names to collections of objects containing dimension names. Acceptable such objects are:
    • Symbol: dimension name
    • Type{<:DimensionsionalData.Dimension}: dimension type
    • DimensionsionalData.Dimension: dimension, potentially with indices
    • Nothing: no dimension name provided, dimension name is automatically generated
  • coords: a collection indexable by dimension name specifying the indices of the given dimension. If indices for a dimension in dims are provided, they are used even if the dimension contains its own indices. If a dimension is missing, its indices are automatically generated.
source

DimensionalData

As a DimensionalData.AbstractDimStack, Dataset also implements the AbstractDimStack API and can be used like a DimStack. See DimensionalData's documentation for example usage.

Tables inteface

Dataset implements the Tables interface. This allows Datasets to be used as sources for any function that can accept a table. For example, it's straightforward to:

\ No newline at end of file diff --git a/InferenceObjects/dev/index.html b/InferenceObjects/dev/index.html index 48e7494f4..2c4c065b7 100644 --- a/InferenceObjects/dev/index.html +++ b/InferenceObjects/dev/index.html @@ -1 +1 @@ -Home · InferenceObjects.jl

InferenceObjects

InferenceObjects.jl is a Julia implementation of the InferenceData schema for storing results of Bayesian inference. Its purpose is to serve the following three goals:

  1. Usefulness in the analysis of Bayesian inference results.
  2. Reproducibility of Bayesian inference analysis.
  3. Interoperability between different inference backends and programming languages.

The implementation consists primarily of the InferenceData and Dataset structures. InferenceObjects also provides the function convert_to_inference_data, which may be overloaded by inference packages to define how various inference outputs can be converted to an InferenceData.

For examples of how InferenceData can be used, see the ArviZ.jl documentation.

\ No newline at end of file +Home · InferenceObjects.jl

InferenceObjects

InferenceObjects.jl is a Julia implementation of the InferenceData schema for storing results of Bayesian inference. Its purpose is to serve the following three goals:

  1. Usefulness in the analysis of Bayesian inference results.
  2. Reproducibility of Bayesian inference analysis.
  3. Interoperability between different inference backends and programming languages.

The implementation consists primarily of the InferenceData and Dataset structures. InferenceObjects also provides the function convert_to_inference_data, which may be overloaded by inference packages to define how various inference outputs can be converted to an InferenceData.

For examples of how InferenceData can be used, see the ArviZ.jl documentation.

\ No newline at end of file diff --git a/InferenceObjects/dev/inference_data/index.html b/InferenceObjects/dev/inference_data/index.html index 40ca63a16..71b0101f9 100644 --- a/InferenceObjects/dev/inference_data/index.html +++ b/InferenceObjects/dev/inference_data/index.html @@ -190,4 +190,4 @@ > posterior julia> to_netcdf(idata, "data.nc") -"data.nc"source \ No newline at end of file +"data.nc"source \ No newline at end of file diff --git a/PSIS/dev/.documenter-siteinfo.json b/PSIS/dev/.documenter-siteinfo.json index ed59d0efa..6b4149057 100644 --- a/PSIS/dev/.documenter-siteinfo.json +++ b/PSIS/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-26T00:40:16","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2023-12-27T00:40:12","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/PSIS/dev/api/index.html b/PSIS/dev/api/index.html index caf81b364..36efc40b9 100644 --- a/PSIS/dev/api/index.html +++ b/PSIS/dev/api/index.html @@ -6,4 +6,4 @@ x = rand(proposal, 1_000, 100) log_ratios = logpdf.(target, x) .- logpdf.(proposal, x) result = psis(log_ratios) -paretoshapeplot(result)

We can also plot the Pareto shape parameters directly:

paretoshapeplot(result.pareto_shape)

We can also use plot directly:

plot(result.pareto_shape; showlines=true)
source
\ No newline at end of file +paretoshapeplot(result)

We can also plot the Pareto shape parameters directly:

paretoshapeplot(result.pareto_shape)

We can also use plot directly:

plot(result.pareto_shape; showlines=true)
source
\ No newline at end of file diff --git a/PSIS/dev/index.html b/PSIS/dev/index.html index 9abdedde1..fae2d7a86 100644 --- a/PSIS/dev/index.html +++ b/PSIS/dev/index.html @@ -13,4 +13,4 @@ (-Inf, 0.5] good 7 (23.3%) 959 (0.5, 0.7] okay 14 (46.7%) 927 (0.7, 1] bad 8 (26.7%) —— - (1, Inf) very bad 1 (3.3%) ——

As indicated by the warnings, this is a poor choice of a proposal distribution, and estimates are unlikely to converge (see PSISResult for an explanation of the shape thresholds).

When running PSIS with many parameters, it is useful to plot the Pareto shape values to diagnose convergence. See Plotting PSIS results for examples.

\ No newline at end of file + (1, Inf) very bad 1 (3.3%) ——

As indicated by the warnings, this is a poor choice of a proposal distribution, and estimates are unlikely to converge (see PSISResult for an explanation of the shape thresholds).

When running PSIS with many parameters, it is useful to plot the Pareto shape values to diagnose convergence. See Plotting PSIS results for examples.

\ No newline at end of file diff --git a/PSIS/dev/internal/index.html b/PSIS/dev/internal/index.html index 202cf2353..c1c9d33d9 100644 --- a/PSIS/dev/internal/index.html +++ b/PSIS/dev/internal/index.html @@ -1 +1 @@ -Internal · PSIS.jl

Internal

PSIS.GeneralizedParetoType
GeneralizedPareto{T<:Real}

The generalized Pareto distribution.

This is equivalent to Distributions.GeneralizedPareto and can be converted to one with convert(Distributions.GeneralizedPareto, d).

Constructor

GeneralizedPareto(μ, σ, k)

Construct the generalized Pareto distribution (GPD) with location parameter $μ$, scale 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$.

source
PSIS.fit_gpdMethod
fit_gpd(x; μ=0, kwargs...)

Fit a GeneralizedPareto with location μ to the data x.

The fit is performed using the Empirical Bayes method of [ZhangStephens2009].

Keywords

  • prior_adjusted::Bool=true, If true, a weakly informative Normal prior centered on $\frac{1}{2}$ is used for the shape $k$.
  • sorted::Bool=issorted(x): If true, x is assumed to be sorted. If false, a sorted copy of x is made.
  • min_points::Int=30: The minimum number of quadrature points to use when estimating the posterior mean of $\theta = \frac{\xi}{\sigma}$.
source
\ No newline at end of file +Internal · PSIS.jl

Internal

PSIS.GeneralizedParetoType
GeneralizedPareto{T<:Real}

The generalized Pareto distribution.

This is equivalent to Distributions.GeneralizedPareto and can be converted to one with convert(Distributions.GeneralizedPareto, d).

Constructor

GeneralizedPareto(μ, σ, k)

Construct the generalized Pareto distribution (GPD) with location parameter $μ$, scale 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$.

source
PSIS.fit_gpdMethod
fit_gpd(x; μ=0, kwargs...)

Fit a GeneralizedPareto with location μ to the data x.

The fit is performed using the Empirical Bayes method of [ZhangStephens2009].

Keywords

  • prior_adjusted::Bool=true, If true, a weakly informative Normal prior centered on $\frac{1}{2}$ is used for the shape $k$.
  • sorted::Bool=issorted(x): If true, x is assumed to be sorted. If false, a sorted copy of x is made.
  • min_points::Int=30: The minimum number of quadrature points to use when estimating the posterior mean of $\theta = \frac{\xi}{\sigma}$.
source
\ No newline at end of file diff --git a/PSIS/dev/plotting/9bbc4653.svg b/PSIS/dev/plotting/b69f7664.svg similarity index 76% rename from PSIS/dev/plotting/9bbc4653.svg rename to PSIS/dev/plotting/b69f7664.svg index 131439713..c3f5b0877 100644 --- a/PSIS/dev/plotting/9bbc4653.svg +++ b/PSIS/dev/plotting/b69f7664.svg @@ -1,124 +1,124 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PSIS/dev/plotting/index.html b/PSIS/dev/plotting/index.html index 0f2eb0d6c..fd04d1f26 100644 --- a/PSIS/dev/plotting/index.html +++ b/PSIS/dev/plotting/index.html @@ -10,4 +10,4 @@ (-Inf, 0.5] good 4 (20.0%) 959 (0.5, 0.7] okay 10 (50.0%) 927 (0.7, 1] bad 6 (30.0%) ——

Plots.jl

PSISResult objects can be plotted directly:

using Plots
-plot(result; showlines=true, marker=:+, legend=false, linewidth=2)
Example block output

This is equivalent to calling PSISPlots.paretoshapeplot(result; kwargs...).

\ No newline at end of file +plot(result; showlines=true, marker=:+, legend=false, linewidth=2)Example block output

This is equivalent to calling PSISPlots.paretoshapeplot(result; kwargs...).

\ No newline at end of file