API: Turing.Inference
Turing.Inference.CSMC
— TypeCSMC(...)
Equivalent to PG
.
Turing.Inference.ESS
— TypeESS
Elliptical slice sampling algorithm.
Examples
julia> @model function gdemo(x)
+Inference · Turing
+
+
+
+
+
+API: Turing.Inference
Turing.Inference.CSMC
— TypeCSMC(...)
Equivalent to PG
.
sourceTuring.Inference.ESS
— TypeESS
Elliptical slice sampling algorithm.
Examples
julia> @model function gdemo(x)
m ~ Normal()
x ~ Normal(m, 0.5)
end
@@ -178,7 +636,6 @@
y[1] 20.0342 20.1188 20.2135 20.2588 20.4188
y[2] 20.1870 20.3178 20.3839 20.4466 20.5895
-
julia> ys_pred = vec(mean(Array(group(predictions, :y)); dims = 1));
julia> sum(abs2, ys_test - ys_pred) ≤ 0.1
@@ -209,3 +666,4 @@
2-element Array{Array{Float64,1},1}:
[-2.0844148956440796]
[-1.704630494695469]
sourceSettings
This document was generated with Documenter.jl version 1.8.0 on Tuesday 10 December 2024. Using Julia version 1.11.2.
+
diff --git a/previews/PR2433/api/Optimisation/index.html b/previews/PR2433/api/Optimisation/index.html
index 0fa1585a5..b2ee10c6e 100644
--- a/previews/PR2433/api/Optimisation/index.html
+++ b/previews/PR2433/api/Optimisation/index.html
@@ -1,5 +1,463 @@
-Optimisation · Turing API: Turing.Optimisation
SciMLBase.OptimizationProblem
— MethodOptimizationProblem(log_density::OptimLogDensity, adtype, constraints)
Create an OptimizationProblem
for the objective function defined by log_density
.
sourceTuring.Optimisation.MAP
— TypeMAP <: ModeEstimator
Concrete type for maximum a posteriori estimation. Only used for the Optim.jl interface.
sourceTuring.Optimisation.MLE
— TypeMLE <: ModeEstimator
Concrete type for maximum likelihood estimation. Only used for the Optim.jl interface.
sourceTuring.Optimisation.ModeEstimationConstraints
— TypeModeEstimationConstraints
A struct that holds constraints for mode estimation problems.
The fields are the same as possible constraints supported by the Optimization.jl: ub
and lb
specify lower and upper bounds of box constraints. cons
is a function that takes the parameters of the model and returns a list of derived quantities, which are then constrained by the lower and upper bounds set by lcons
and ucons
. We refer to these as generic constraints. Please see the documentation of Optimization.jl for more details.
Any of the fields can be nothing
, disabling the corresponding constraints.
sourceTuring.Optimisation.ModeEstimator
— TypeModeEstimator
An abstract type to mark whether mode estimation is to be done with maximum a posteriori (MAP) or maximum likelihood estimation (MLE). This is only needed for the Optim.jl interface.
sourceTuring.Optimisation.ModeResult
— TypeModeResult{
+Optimisation · Turing
+
+
+
+
+
+API: Turing.Optimisation
SciMLBase.OptimizationProblem
— MethodOptimizationProblem(log_density::OptimLogDensity, adtype, constraints)
Create an OptimizationProblem
for the objective function defined by log_density
.
sourceTuring.Optimisation.MAP
— TypeMAP <: ModeEstimator
Concrete type for maximum a posteriori estimation. Only used for the Optim.jl interface.
sourceTuring.Optimisation.MLE
— TypeMLE <: ModeEstimator
Concrete type for maximum likelihood estimation. Only used for the Optim.jl interface.
sourceTuring.Optimisation.ModeEstimationConstraints
— TypeModeEstimationConstraints
A struct that holds constraints for mode estimation problems.
The fields are the same as possible constraints supported by the Optimization.jl: ub
and lb
specify lower and upper bounds of box constraints. cons
is a function that takes the parameters of the model and returns a list of derived quantities, which are then constrained by the lower and upper bounds set by lcons
and ucons
. We refer to these as generic constraints. Please see the documentation of Optimization.jl for more details.
Any of the fields can be nothing
, disabling the corresponding constraints.
sourceTuring.Optimisation.ModeEstimator
— TypeModeEstimator
An abstract type to mark whether mode estimation is to be done with maximum a posteriori (MAP) or maximum likelihood estimation (MLE). This is only needed for the Optim.jl interface.
sourceTuring.Optimisation.ModeResult
— TypeModeResult{
V<:NamedArrays.NamedArray,
M<:NamedArrays.NamedArray,
O<:Optim.MultivariateOptimizationResults,
@@ -20,3 +478,4 @@
[solver];
kwargs...
)
Find the maximum likelihood estimate of a model.
This is a convenience function that calls estimate_mode
with MLE()
as the estimator. Please see the documentation of Turing.Optimisation.estimate_mode
for more details.
sourceSettings
This document was generated with Documenter.jl version 1.8.0 on Tuesday 10 December 2024. Using Julia version 1.11.2.
+
diff --git a/previews/PR2433/api/index.html b/previews/PR2433/api/index.html
index b028d52a9..31257ad5b 100644
--- a/previews/PR2433/api/index.html
+++ b/previews/PR2433/api/index.html
@@ -1,5 +1,463 @@
-API · Turing API
Module-wide re-exports
Turing.jl directly re-exports the entire public API of the following packages:
Please see the individual packages for their documentation.
Individual exports and re-exports
All of the following symbols are exported unqualified by Turing, even though the documentation suggests that many of them are qualified. That means, for example, you can just write
using Turing
+API · Turing
+
+
+
+
+
+API
Module-wide re-exports
Turing.jl directly re-exports the entire public API of the following packages:
Please see the individual packages for their documentation.
Individual exports and re-exports
All of the following symbols are exported unqualified by Turing, even though the documentation suggests that many of them are qualified. That means, for example, you can just write
using Turing
@model function my_model() end
@@ -63,8 +521,8 @@
y[1] 20.0342 20.1188 20.2135 20.2588 20.4188
y[2] 20.1870 20.3178 20.3839 20.4466 20.5895
-
julia> ys_pred = vec(mean(Array(group(predictions, :y)); dims = 1));
julia> sum(abs2, ys_test - ys_pred) ≤ 0.1
true
sourceQuerying model probabilities and quantities
Please see the generated quantities and probability interface guides for more information.
Exported symbol Documentation Description generated_quantities
DynamicPPL.generated_quantities
Calculate additional quantities defined in a model pointwise_loglikelihoods
DynamicPPL.pointwise_loglikelihoods
Compute log likelihoods for each sample in a chain logprior
DynamicPPL.logprior
Compute log prior probability logjoint
DynamicPPL.logjoint
Compute log joint probability LogDensityFunction
DynamicPPL.LogDensityFunction
Wrap a Turing model to satisfy LogDensityFunctions.jl interface condition
AbstractPPL.condition
Condition a model on data decondition
AbstractPPL.decondition
Remove conditioning on data conditioned
DynamicPPL.conditioned
Return the conditioned values of a model fix
DynamicPPL.fix
Fix the value of a variable unfix
DynamicPPL.unfix
Unfix the value of a variable OrderedDict
OrderedCollections.OrderedDict
An ordered dictionary
Extra re-exports from Bijectors
Note that Bijectors itself does not export ordered
.
Bijectors.ordered
— Functionordered(d::Distribution)
Return a Distribution
whose support are ordered vectors, i.e., vectors with increasingly ordered elements.
Specifically, d
is restricted to the subspace of its domain containing only ordered elements.
Warning rand
is implemented using rejection sampling, which can be slow for high-dimensional distributions. In such cases, consider using MCMC methods to sample from the distribution instead.
Warning The resulting ordered distribution is un-normalized, which can cause issues in some contexts, e.g. in hierarchical models where the parameters of the ordered distribution are themselves sampled. See the notes below for a more detailed discussion.
Notes on ordered
being un-normalized
The resulting ordered distribution is un-normalized. This is not a problem if used in a context where the normalizing factor is irrelevant, but if the value of the normalizing factor impacts the resulting computation, the results may be inaccurate.
For example, if the distribution is used in sampling a posterior distribution with MCMC and the parameters of the ordered distribution are themselves sampled, then the normalizing factor would in general be needed for accurate sampling, and ordered
should not be used. However, if the parameters are fixed, then since MCMC does not require distributions be normalized, ordered
may be used without problems.
A common case is where the distribution being ordered is a joint distribution of n
identical univariate distributions. In this case the normalization factor works out to be the constant n!
, and ordered
can again be used without problems even if the parameters of the univariate distribution are sampled.
sourcePoint estimates
See the mode estimation tutorial for more information.
Exported symbol Documentation Description maximum_a_posteriori
Turing.Optimisation.maximum_a_posteriori
Find a MAP estimate for a model maximum_likelihood
Turing.Optimisation.maximum_likelihood
Find a MLE estimate for a model MAP
Turing.Optimisation.MAP
Type to use with Optim.jl for MAP estimation MLE
Turing.Optimisation.MLE
Type to use with Optim.jl for MLE estimation
Settings
This document was generated with Documenter.jl version 1.8.0 on Tuesday 10 December 2024. Using Julia version 1.11.2.
+
diff --git a/previews/PR2433/index.html b/previews/PR2433/index.html
index 4b2251ae9..2277e11e4 100644
--- a/previews/PR2433/index.html
+++ b/previews/PR2433/index.html
@@ -1,2 +1,461 @@
-Home · Turing Turing.jl
This site contains the API documentation for the identifiers exported by Turing.jl.
If you are looking for usage examples and guides, please visit https://turinglang.org/docs.
Settings
This document was generated with Documenter.jl version 1.8.0 on Tuesday 10 December 2024. Using Julia version 1.11.2.
+Home · Turing
+
+
+
+
+
+Turing.jl
This site contains the API documentation for the identifiers exported by Turing.jl.
If you are looking for usage examples and guides, please visit https://turinglang.org/docs.
Settings
This document was generated with Documenter.jl version 1.8.0 on Tuesday 10 December 2024. Using Julia version 1.11.2.
+