ContinuousTransformations.ℝ
— ConstantA constant for the real line.
ContinuousTransformations.ℝ⁺
— ConstantThe positive real numbers.
ContinuousTransformations.ℝ⁻
— ConstantThe negative real numbers.
ContinuousTransformations.AbstractInterval
— Typeabstract type AbstractInterval
Abstract supertype for all univariate intervals. It is not specified whether they are open or closed.
ContinuousTransformations.Affine
— TypeContinuousTransformations.ArrayTransformation
— TypeArrayTransformation(transformation, dims)
ArrayTransformation(transformation, dims...)
Apply transformation to a vector, returning an array of the given dimensions.
domain
, image
, and isincreasing
return the corresponding values for the underlying transformation.
ContinuousTransformations.ContinuousTransformation
— Typeabstract type ContinuousTransformation <: Function
Continuous bijection $D ⊂ ℝ^n→ I ⊂ ℝ^n$ or $D ⊂ ℝ → I ⊂ ℝ$.
ContinuousTransformations.CorrelationCholeskyFactor
— TypeCorrelationCholeskyFactor(n)
Cholesky factor of a correlation matrix of size n
.
ContinuousTransformations.Exp
— TypeExp()
Mapping $ℝ → ℝ⁺$ using $x ↦ \exp(x)$.
ContinuousTransformations.GroupedTransformation
— Typeabstract type GroupedTransformation <: ContinuousTransformation
Abstract type for grouped transformations.
A grouped transformation takes a vector, and transforms contiguous blocks of elements to some output type, determined by the specific transformation type.
All subtypes support
length
: return the length of the vector that can be used as an argumentcallable object for the transformation
logjac
, andinverse
,domain
andimage
, which may have specific interpretation for their result types depending on the concrete subtype.
ContinuousTransformations.InvRealCircle
— TypeInvRealCircle()
Mapping $(-1,1) → ℝ$ using $x ↦ x/√(1-x^2)$.
ContinuousTransformations.Log
— TypeLog()
Mapping $ℝ → ℝ⁺$ using $x ↦ \exp(x)$.
ContinuousTransformations.Logistic
— TypeLogistic()
Mapping $ℝ → (0,1)$ using $x ↦ 1/(1+\exp(-x))$.
ContinuousTransformations.Logit
— TypeLogit()
Mapping $(0,1) → ℝ$ using $x ↦ \log(x/(1-x))$.
ContinuousTransformations.Negation
— TypeNegation()
Mapping $ℝ → ℝ$ using $x ↦ -x$.
ContinuousTransformations.NegativeRay
— TypeNegativeRay(right)
The real numbers below right
. See ℝ⁻
.
ContinuousTransformations.PositiveRay
— TypePositiveRay(left)
The real numbers above left
. See ℝ⁺
.
ContinuousTransformations.RealCircle
— TypeRealCircle()
Mapping $ℝ → (-1,1)$ using $x ↦ x/√(1+x^2)$.
ContinuousTransformations.RealLine
— TypeRealLine()
The real line. Use the constant ℝ
.
ContinuousTransformations.Segment
— TypeSegment(left, right)
The real numbers between left
and right
, with $-∞ < \text{left} < \text{right} < ∞$ enforced.
ContinuousTransformations.TransformDistribution
— TypeTransformDistribution(distribution, transformation)
Given a transformation
and a distribution
, create a transformed distribution object that has the distribution of transformation(x)
with x ∼ distribution
.
The transformation object is callable with the same syntax as transformation
. It also supports methods rand
, length
.
See also logpdf_in_domain
and logpdf_in_image
.
ContinuousTransformations.TransformLogLikelihood
— TypeTransformLogLikelihood(ℓ, transformation::Union{Tuple, GroupedTransformation})
TransformLogLikelihood(ℓ, transformations...)
Return a callable that
transforms its vector argument using a grouped transformation to a set of values,
calls
ℓ
(which should return a scalar) with this tuple.returns the result above corrected by the log Jacobians.
Useful when ℓ
is a log-likelihood function with a restricted domain, and transformations
is used to trasform to this domain from $ℝ^n$.
See also get_transformation
, get_distribution
, Distributions.logpdf
, and logpdf_in_domain
.
ContinuousTransformations.TransformationTuple
— TypeTransformationTuple(transformations::Tuple)
TransformationTuple(transformations...)
A tuple of ContinuousTransformation
s. Given a vector of matching length
, each takes as many reals as needed, and returns the result as a tuple.
ContinuousTransformations.TransformationWrapper
— Typeabstract type TransformationWrapper <: Function
Wrap a transformation to achieve some specialized functionality.
Supports length
, get_transformation
, and other methods depending on the subtype.
ContinuousTransformations.UnitVector
— TypeUnitVector(n)
Transform n-1
real numbers to a unit vector of length n
, under the Euclidean norm.
ContinuousTransformations.UnivariateTransformation
— Typeabstract type UnivariateTransformation <: ContinuousTransformation
Univariate monotone transformation, either increasing or decreasing on the whole domain (thus, a bijection).
ContinuousTransformations.EXP
— FunctionExp()
Mapping $ℝ → ℝ⁺$ using $x ↦ \exp(x)$.
ContinuousTransformations.IDENTITY
— FunctionIdentity (as an affine transformation).
ContinuousTransformations.INVREALCIRCLE
— FunctionInvRealCircle()
Mapping $(-1,1) → ℝ$ using $x ↦ x/√(1-x^2)$.
ContinuousTransformations.LOG
— FunctionLog()
Mapping $ℝ → ℝ⁺$ using $x ↦ \exp(x)$.
ContinuousTransformations.LOGISTIC
— FunctionLogistic()
Mapping $ℝ → (0,1)$ using $x ↦ 1/(1+\exp(-x))$.
ContinuousTransformations.LOGIT
— FunctionLogit()
Mapping $(0,1) → ℝ$ using $x ↦ \log(x/(1-x))$.
ContinuousTransformations.NEGATION
— FunctionNegation()
Mapping $ℝ → ℝ$ using $x ↦ -x$.
ContinuousTransformations.REALCIRCLE
— FunctionRealCircle()
Mapping $ℝ → (-1,1)$ using $x ↦ x/√(1+x^2)$.
ContinuousTransformations.affine_bridge
— Methodaffine_bridge(interval1, interval1)
Return an affine transformation between two intervals of the same type.
ContinuousTransformations.all_finite
— Methodall_finite(x)
Test if a numerical argument is made up of finite real numbers.
ContinuousTransformations.bridge
— Functionbridge(dom, img, [transformation])
Return a transformation that maps dom
to img
.
The transformation
argument may be used to specify a particular transformation family, otherwise default_transformation
is used.
ContinuousTransformations.default_transformation
— Methoddefault_transformation(dom, img)
Return a transformation from dom
that can be mapped to img
using affine_bridge
.
ContinuousTransformations.domain
— Functiondomain(transformation)
Return the domain of the transformation.
ContinuousTransformations.get_distribution
— Methodget_distribution(t)
Return the wrapped distribution.
ContinuousTransformations.get_loglikelihood
— Methodget_loglikelihood(t)
Return the log likelihood function.
ContinuousTransformations.get_transformation
— Methodget_transformation(d)
Return the transformation from a wrapper object.
ContinuousTransformations.image
— Functionimage(transformation)
Return the image of the transformation.
ContinuousTransformations.inverse
— Methodinverse(t, x)
Return $t⁻¹(x)$.
inverse(t)
Return the transformation $t⁻¹$.
ContinuousTransformations.isincreasing
— Functionisincreasing(transformation)
Return true
(false
), when the transformation is monotonically increasing (decreasing).
ContinuousTransformations.lkj_correlation_cholesky_logpdf
— Methodlkj_correlation_cholesky_logpdf(L, η)
Log PDF of the LKJ distribution (Lewandowski et al 2009) for correlation matrices.
A correlation matrix $Ω=LL'$ has the density $|Ω|^(η-1)$. However, it is usually not necessary to construct $Ω$, so this function is parametrized in terms of a Cholesky decomposition L
.
Note that this function does not check if L
yields a valid correlation matrix. Use CorrelationCholeskyFactor
for generating valid arguments.
Valid values are $η > 0$. When $η > 1$, the distribution is unimodal at the identity, while $0 < η < 1$ has a trough. $η = 2$ is recommended as a vague prior.
When $η = 1$, the density is uniform. Note however that the function should still be invoked, because of the Jacobian correction of the transformation.
ContinuousTransformations.logjac
— Functionlogjac(t, x)
The log of the determinant of the Jacobian of t
at x
. ```
ContinuousTransformations.logpdf_in_domain
— Methodlogpdf_in_domain(t, x)
The log pdf for a transformed distribution at t(x)
in image, calculated in the domain without performing the transformation.
The log pdf is adjusted with the log determinant of the Jacobian, ie the following holds:
julia logpdf_in_image(t, t(x)) == logpdf_in_domain(t, x)
See logpdf_in_image
.
Typical usage of this function would be drawing some random x
s from the contained distribution (possibly also used for some other purpose), and obtaining the log pdfs at t(y)
with the same values.
ContinuousTransformations.logpdf_in_image
— Methodlogpdf_in_image(t, y)
The log pdf for a transformed distribution at y
in image.
See also logpdf_in_domain
.
ContinuousTransformations.transform
— Methodtransform(t, x)
Return $t(x)$. NOTE: this equivalent to the callable syntax t(x)
, which is also available.
ContinuousTransformations.transform_and_logjac
— Methody, logjac =
transform_and_logjac(t, x)
Return the transformed value and the determinant of the log Jacobian.
Equivalent to t(x), logjac(t, x)
, but may be faster because of reused components.
ContinuousTransformations.ungrouping_map
— Methodungrouping_map(T, f, A)
Map the vector A
elementwise using f
, and collect the results in arrays or vectors organized as a single result from f
. For example, if f
returns tuples, this function returns tuples of vectors.
The shape of the result is determined by the first argument, which can be Vector
or Array
. The difference is that Array
stacks arrays into arrays, while Vector
does not.
Array
may be more useful for summaries along dimensions, eg mean
and similar.
ContinuousTransformations.width
— Methodwidth(s)
Width of a finite interval.
ContinuousTransformations.@increment_logjac
— MacroReturn transformation(x)
while incrementing logjac
with the log Jacobian determinant.
ContinuousTransformations.@increment_logjac
— MacroReturn transformation(x)
while incrementing logjac
with the log Jacobian determinant.
ContinuousTransformations.ComposedTransformation
— TypeComposedTransformation(f, g)
Compose two univariate transformations, resulting in the mapping $f∘g$, or `x ↦ f(g(x))
.
Use the ∘
operator for construction.
ContinuousTransformations.NotRRStable
— Typestruct NotRRStable <: ContinuousTransformations.RRStability
Trait that indicates that a univariate transformation is notRRStable
.
ContinuousTransformations.RRStability
— Typeabstract type RRStability
Trait that is useful for domain and image calculations. See RRStable
.
ContinuousTransformations.RRStable
— Typestruct RRStable <: ContinuousTransformations.RRStability
Trait that indicates that a univariate transformation
maps $ℝ$ to $ℝ$,
supports mapping intervals, and
maps subtypes of
AbstractInterval
to the same type.
ContinuousTransformations.RR_stability
— MethodRR_stability(?)
Return either the trait RRStable
and NotRRStable
.
ContinuousTransformations.TANH
— FunctionHyperbolic tangent transformation.
An affine stretch of LOGISTIC to (-1, 1).
ContinuousTransformations._fma
— Method_fma(x, y, z)
Placeholder for Base.fma
until https://github.com/JuliaDiff/ReverseDiff.jl/issues/86 is fixed.
ContinuousTransformations._maybe_segment
— Method_maybe_segment(a, b)
Helper function for forming a segment when possible. Internal, not exported.
ContinuousTransformations.composed_domain
— Methodcomposed_domain(f_RR_stability, g_RR_stability, f, g)
ContinuousTransformations.composed_image
— Methodcomposed_image(f_RR_stability, g_RR_stability, f, g)
ContinuousTransformations.make_ungrouped_container
— Methodmake_ungrouped_container(?, representative_elt, len)
Make a container for ungrouped results.
The first argument, Vector
or Array
, determines the result of ungrouping.
representative_elt
is a representative element, used to determine element type and stucture, and len
is the length of the result.
ContinuousTransformations.rhs_string
— Functionrhs_string(transformation, term)
Return the formula representing the hand side of the transformation
, with term
as the argument.
ContinuousTransformations.triangle_length
— Methodtriangle_length(n)
Number of elements in a triangle of an $n×n$ square matrix, including the diagonal.
ContinuousTransformations.ungroup_elt!
— Methodungroup_elt!(T, container, elt, i)
Save elt
in container
at index i
. T
determines the layout of container
, conformably with make_ungrouped_container
.
ContinuousTransformations.@define_from_transform_and_logjac
— MacroDefine transform
and logjac
using transform_and_logjac
.
ContinuousTransformations.@define_isapprox
— MacroDefine an isapprox
method, comparing the given fields in type T
.
ContinuousTransformations.@define_singleton
— MacroDefine a singleton type with the given name and supertype (specified as name <: supertype
), and a constant which defaults to the name in uppercase.