diff --git a/dev/api/Inference/index.html b/dev/api/Inference/index.html index c4b6bfa96..4723b9ca7 100644 --- a/dev/api/Inference/index.html +++ b/dev/api/Inference/index.html @@ -1,5 +1,463 @@ -Inference · Turing

API: Turing.Inference

Turing.Inference.ESSType
ESS

Elliptical slice sampling algorithm.

Examples

julia> @model function gdemo(x)
+Inference · Turing
+
+
+
+
+
+

API: Turing.Inference

Turing.Inference.ESSType
ESS

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]
source
+ diff --git a/dev/api/Optimisation/index.html b/dev/api/Optimisation/index.html index 3cfb92e49..56aeff4f1 100644 --- a/dev/api/Optimisation/index.html +++ b/dev/api/Optimisation/index.html @@ -1,5 +1,463 @@ -Optimisation · Turing

API: Turing.Optimisation

SciMLBase.OptimizationProblemMethod
OptimizationProblem(log_density::OptimLogDensity, adtype, constraints)

Create an OptimizationProblem for the objective function defined by log_density.

source
Turing.Optimisation.MAPType
MAP <: ModeEstimator

Concrete type for maximum a posteriori estimation. Only used for the Optim.jl interface.

source
Turing.Optimisation.ModeEstimationConstraintsType
ModeEstimationConstraints

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.

source
Turing.Optimisation.ModeEstimatorType
ModeEstimator

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.

source
Turing.Optimisation.ModeResultType
ModeResult{
+Optimisation · Turing
+
+
+
+
+
+

API: Turing.Optimisation

SciMLBase.OptimizationProblemMethod
OptimizationProblem(log_density::OptimLogDensity, adtype, constraints)

Create an OptimizationProblem for the objective function defined by log_density.

source
Turing.Optimisation.MAPType
MAP <: ModeEstimator

Concrete type for maximum a posteriori estimation. Only used for the Optim.jl interface.

source
Turing.Optimisation.ModeEstimationConstraintsType
ModeEstimationConstraints

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.

source
Turing.Optimisation.ModeEstimatorType
ModeEstimator

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.

source
Turing.Optimisation.ModeResultType
ModeResult{
     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.

source
+ diff --git a/dev/api/index.html b/dev/api/index.html index 6b45503b2..a2e1f9933 100644 --- a/dev/api/index.html +++ b/dev/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
source

Querying model probabilities and quantities

Please see the generated quantities and probability interface guides for more information.

Exported symbolDocumentationDescription
generated_quantitiesDynamicPPL.generated_quantitiesCalculate additional quantities defined in a model
pointwise_loglikelihoodsDynamicPPL.pointwise_loglikelihoodsCompute log likelihoods for each sample in a chain
logpriorDynamicPPL.logpriorCompute log prior probability
logjointDynamicPPL.logjointCompute log joint probability
LogDensityFunctionDynamicPPL.LogDensityFunctionWrap a Turing model to satisfy LogDensityFunctions.jl interface
conditionAbstractPPL.conditionCondition a model on data
deconditionAbstractPPL.deconditionRemove conditioning on data
conditionedDynamicPPL.conditionedReturn the conditioned values of a model
fixDynamicPPL.fixFix the value of a variable
unfixDynamicPPL.unfixUnfix the value of a variable
OrderedDictOrderedCollections.OrderedDictAn ordered dictionary

Extra re-exports from Bijectors

Note that Bijectors itself does not export ordered.

Bijectors.orderedFunction
ordered(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.

source

Point estimates

See the mode estimation tutorial for more information.

Exported symbolDocumentationDescription
maximum_a_posterioriTuring.Optimisation.maximum_a_posterioriFind a MAP estimate for a model
maximum_likelihoodTuring.Optimisation.maximum_likelihoodFind a MLE estimate for a model
MAPTuring.Optimisation.MAPType to use with Optim.jl for MAP estimation
MLETuring.Optimisation.MLEType to use with Optim.jl for MLE estimation
+ diff --git a/dev/index.html b/dev/index.html index 0b1cf81ac..c25b1e57c 100644 --- a/dev/index.html +++ b/dev/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.

+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.

+ diff --git a/index.html b/index.html index 6a5afc301..3ac259691 100644 --- a/index.html +++ b/index.html @@ -1,2 +1,3 @@ + diff --git a/previews/PR2410/api/Inference/index.html b/previews/PR2410/api/Inference/index.html index d04ca6b70..4cb460e81 100644 --- a/previews/PR2410/api/Inference/index.html +++ b/previews/PR2410/api/Inference/index.html @@ -1,5 +1,463 @@ -Inference · Turing

API: Turing.Inference

Turing.Inference.ESSType
ESS

Elliptical slice sampling algorithm.

Examples

julia> @model function gdemo(x)
+Inference · Turing
+
+
+
+
+
+

API: Turing.Inference

Turing.Inference.ESSType
ESS

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]
source
+ diff --git a/previews/PR2410/api/Optimisation/index.html b/previews/PR2410/api/Optimisation/index.html index e9d77f08d..b5603114d 100644 --- a/previews/PR2410/api/Optimisation/index.html +++ b/previews/PR2410/api/Optimisation/index.html @@ -1,5 +1,463 @@ -Optimisation · Turing

API: Turing.Optimisation

SciMLBase.OptimizationProblemMethod
OptimizationProblem(log_density::OptimLogDensity, adtype, constraints)

Create an OptimizationProblem for the objective function defined by log_density.

source
Turing.Optimisation.MAPType
MAP <: ModeEstimator

Concrete type for maximum a posteriori estimation. Only used for the Optim.jl interface.

source
Turing.Optimisation.ModeEstimationConstraintsType
ModeEstimationConstraints

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.

source
Turing.Optimisation.ModeEstimatorType
ModeEstimator

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.

source
Turing.Optimisation.ModeResultType
ModeResult{
+Optimisation · Turing
+
+
+
+
+
+

API: Turing.Optimisation

SciMLBase.OptimizationProblemMethod
OptimizationProblem(log_density::OptimLogDensity, adtype, constraints)

Create an OptimizationProblem for the objective function defined by log_density.

source
Turing.Optimisation.MAPType
MAP <: ModeEstimator

Concrete type for maximum a posteriori estimation. Only used for the Optim.jl interface.

source
Turing.Optimisation.ModeEstimationConstraintsType
ModeEstimationConstraints

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.

source
Turing.Optimisation.ModeEstimatorType
ModeEstimator

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.

source
Turing.Optimisation.ModeResultType
ModeResult{
     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.

source
+ diff --git a/previews/PR2410/api/index.html b/previews/PR2410/api/index.html index 536710e87..c7476c547 100644 --- a/previews/PR2410/api/index.html +++ b/previews/PR2410/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
source

Querying model probabilities and quantities

Please see the generated quantities and probability interface guides for more information.

Exported symbolDocumentationDescription
generated_quantitiesDynamicPPL.generated_quantitiesCalculate additional quantities defined in a model
pointwise_loglikelihoodsDynamicPPL.pointwise_loglikelihoodsCompute log likelihoods for each sample in a chain
logpriorDynamicPPL.logpriorCompute log prior probability
logjointDynamicPPL.logjointCompute log joint probability
LogDensityFunctionDynamicPPL.LogDensityFunctionWrap a Turing model to satisfy LogDensityFunctions.jl interface
conditionAbstractPPL.conditionCondition a model on data
deconditionAbstractPPL.deconditionRemove conditioning on data
conditionedDynamicPPL.conditionedReturn the conditioned values of a model
fixDynamicPPL.fixFix the value of a variable
unfixDynamicPPL.unfixUnfix the value of a variable
OrderedDictOrderedCollections.OrderedDictAn ordered dictionary

Extra re-exports from Bijectors

Note that Bijectors itself does not export ordered.

Bijectors.orderedFunction
ordered(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.

source

Point estimates

See the mode estimation tutorial for more information.

Exported symbolDocumentationDescription
maximum_a_posterioriTuring.Optimisation.maximum_a_posterioriFind a MAP estimate for a model
maximum_likelihoodTuring.Optimisation.maximum_likelihoodFind a MLE estimate for a model
MAPTuring.Optimisation.MAPType to use with Optim.jl for MAP estimation
MLETuring.Optimisation.MLEType to use with Optim.jl for MLE estimation
+ diff --git a/previews/PR2410/index.html b/previews/PR2410/index.html index 2627b4dc8..0637d3d21 100644 --- a/previews/PR2410/index.html +++ b/previews/PR2410/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.

+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.

+