@@ -41,12 +41,12 @@ to_origin(ν::NU, ::Any) where NU = NoTransformOrigin{NU}(ν)
4141
4242
4343"""
44- struct MeasureBase.NoVarTransform {NU,MU} end
44+ struct MeasureBase.NoTransport {NU,MU} end
4545
4646Indicates that no transformation from a measure of type `MU` to a measure of
4747type `NU` could be found.
4848"""
49- struct NoVarTransform {NU,MU} end
49+ struct NoTransport {NU,MU} end
5050
5151
5252"""
@@ -120,10 +120,10 @@ See [`transport_to`](@ref).
120120function transport_def end
121121
122122transport_def (:: Any , :: Any , x:: NoTransformOrigin ) = x
123- transport_def (:: Any , :: Any , x:: NoVarTransform ) = x
123+ transport_def (:: Any , :: Any , x:: NoTransport ) = x
124124
125125function transport_def (ν, μ, x)
126- _vartransform_with_intermediate (ν, _checked_vartransform_origin (ν), _checked_vartransform_origin (μ), μ, x)
126+ _transport_with_intermediate (ν, _checked_transport_origin (ν), _checked_transport_origin (μ), μ, x)
127127end
128128
129129
@@ -132,92 +132,92 @@ function _origin_must_have_separate_type(::Type{MU}, μ_o::MU) where MU
132132 throw (ArgumentError (" Measure of type $MU and its origin must have separate types" ))
133133end
134134
135- @inline function _checked_vartransform_origin (μ:: MU ) where MU
135+ @inline function _checked_transport_origin (μ:: MU ) where MU
136136 μ_o = transport_origin (μ)
137137 _origin_must_have_separate_type (MU, μ_o)
138138end
139139
140140
141- function _vartransform_with_intermediate (ν, ν_o, μ_o, μ, x)
141+ function _transport_with_intermediate (ν, ν_o, μ_o, μ, x)
142142 x_o = to_origin (μ, x)
143- # If μ is a pushforward then checked_var may have been bypassed, so check now:
144- y_o = transport_def (ν_o, μ_o, checked_var (μ_o, x_o))
143+ # If μ is a pushforward then checked_arg may have been bypassed, so check now:
144+ y_o = transport_def (ν_o, μ_o, checked_arg (μ_o, x_o))
145145 y = from_origin (ν, y_o)
146146 return y
147147end
148148
149- function _vartransform_with_intermediate (ν, ν_o, :: NoTransformOrigin , μ, x)
149+ function _transport_with_intermediate (ν, ν_o, :: NoTransformOrigin , μ, x)
150150 y_o = transport_def (ν_o, μ, x)
151151 y = from_origin (ν, y_o)
152152 return y
153153end
154154
155- function _vartransform_with_intermediate (ν, :: NoTransformOrigin , μ_o, μ, x)
155+ function _transport_with_intermediate (ν, :: NoTransformOrigin , μ_o, μ, x)
156156 x_o = to_origin (μ, x)
157- # If μ is a pushforward then checked_var may have been bypassed, so check now:
158- y = transport_def (ν, μ_o, checked_var (μ_o, x_o))
157+ # If μ is a pushforward then checked_arg may have been bypassed, so check now:
158+ y = transport_def (ν, μ_o, checked_arg (μ_o, x_o))
159159 return y
160160end
161161
162- function _vartransform_with_intermediate (ν, :: NoTransformOrigin , :: NoTransformOrigin , μ, x)
163- _vartransform_with_intermediate (ν, _vartransform_intermediate (ν, μ), μ, x)
162+ function _transport_with_intermediate (ν, :: NoTransformOrigin , :: NoTransformOrigin , μ, x)
163+ _transport_with_intermediate (ν, _transport_intermediate (ν, μ), μ, x)
164164end
165165
166166
167- @inline _vartransform_intermediate (ν, μ) = _vartransform_intermediate (getdof (ν), getdof (μ))
168- @inline _vartransform_intermediate (:: Integer , n_μ:: Integer ) = StdUniform ()^ n_μ
169- @inline _vartransform_intermediate (:: StaticInt{1} , :: StaticInt{1} ) = StdUniform ()
167+ @inline _transport_intermediate (ν, μ) = _transport_intermediate (getdof (ν), getdof (μ))
168+ @inline _transport_intermediate (:: Integer , n_μ:: Integer ) = StdUniform ()^ n_μ
169+ @inline _transport_intermediate (:: StaticInt{1} , :: StaticInt{1} ) = StdUniform ()
170170
171- function _vartransform_with_intermediate (ν, m, μ, x)
171+ function _transport_with_intermediate (ν, m, μ, x)
172172 z = transport_def (m, μ, x)
173173 y = transport_def (ν, m, z)
174174 return y
175175end
176176
177177# Prevent infinite recursion in case vartransform_intermediate doesn't change type:
178- @inline _vartransform_with_intermediate (:: NU , :: NU , :: MU , :: Any ) where {NU,MU} = NoVarTransform {NU,MU} ()
179- @inline _vartransform_with_intermediate (:: NU , :: MU , :: MU , :: Any ) where {NU,MU} = NoVarTransform {NU,MU} ()
178+ @inline _transport_with_intermediate (:: NU , :: NU , :: MU , :: Any ) where {NU,MU} = NoTransport {NU,MU} ()
179+ @inline _transport_with_intermediate (:: NU , :: MU , :: MU , :: Any ) where {NU,MU} = NoTransport {NU,MU} ()
180180
181181
182182"""
183- struct VarTransformation <: Function
183+ struct TransportFunction <: Function
184184
185185Transforms a variate from one measure to a variate of another.
186186
187- In general `VarTransformation ` should not be called directly, call
187+ In general `TransportFunction ` should not be called directly, call
188188[`transport_to`](@ref) instead.
189189"""
190- struct VarTransformation {NU,MU} <: Function
190+ struct TransportFunction {NU,MU} <: Function
191191 ν:: NU
192192 μ:: MU
193193
194- function VarTransformation {NU,MU} (ν:: NU , μ:: MU ) where {NU,MU}
194+ function TransportFunction {NU,MU} (ν:: NU , μ:: MU ) where {NU,MU}
195195 return new {NU,MU} (ν, μ)
196196 end
197197
198- function VarTransformation (ν:: NU , μ:: MU ) where {NU,MU}
198+ function TransportFunction (ν:: NU , μ:: MU ) where {NU,MU}
199199 check_dof (ν, μ)
200200 return new {NU,MU} (ν, μ)
201201 end
202202end
203203
204- @inline transport_to (ν, μ) = VarTransformation (ν, μ)
204+ @inline transport_to (ν, μ) = TransportFunction (ν, μ)
205205
206- function Base.:(== )(a:: VarTransformation , b:: VarTransformation )
206+ function Base.:(== )(a:: TransportFunction , b:: TransportFunction )
207207 return a. ν == b. ν && a. μ == b. μ
208208end
209209
210210
211- Base. @propagate_inbounds function (f:: VarTransformation )(x)
212- return transport_def (f. ν, f. μ, checked_var (f. μ, x))
211+ Base. @propagate_inbounds function (f:: TransportFunction )(x)
212+ return transport_def (f. ν, f. μ, checked_arg (f. μ, x))
213213end
214214
215- @inline function InverseFunctions. inverse (f:: VarTransformation {NU,MU} ) where {NU,MU}
216- return VarTransformation {MU,NU} (f. μ, f. ν)
215+ @inline function InverseFunctions. inverse (f:: TransportFunction {NU,MU} ) where {NU,MU}
216+ return TransportFunction {MU,NU} (f. μ, f. ν)
217217end
218218
219219
220- function ChangesOfVariables. with_logabsdet_jacobian (f:: VarTransformation , x)
220+ function ChangesOfVariables. with_logabsdet_jacobian (f:: TransportFunction , x)
221221 y = f (x)
222222 logpdf_src = logdensityof (f. μ, x)
223223 logpdf_trg = logdensityof (f. ν, y)
@@ -228,26 +228,26 @@ function ChangesOfVariables.with_logabsdet_jacobian(f::VarTransformation, x)
228228end
229229
230230
231- Base.:(∘ )(:: typeof (identity), f:: VarTransformation ) = f
232- Base.:(∘ )(f:: VarTransformation , :: typeof (identity)) = f
231+ Base.:(∘ )(:: typeof (identity), f:: TransportFunction ) = f
232+ Base.:(∘ )(f:: TransportFunction , :: typeof (identity)) = f
233233
234- function Base.:∘ (outer:: VarTransformation , inner:: VarTransformation )
234+ function Base.:∘ (outer:: TransportFunction , inner:: TransportFunction )
235235 if ! (outer. μ == inner. ν || isequal (outer. μ, inner. ν) || outer. μ ≈ inner. ν)
236- throw (ArgumentError (" Cannot compose VarTransformation if source of outer doesn't equal target of inner." ))
236+ throw (ArgumentError (" Cannot compose TransportFunction if source of outer doesn't equal target of inner." ))
237237 end
238- return VarTransformation (outer. ν, inner. μ)
238+ return TransportFunction (outer. ν, inner. μ)
239239end
240240
241241
242- function Base. show (io:: IO , f:: VarTransformation )
242+ function Base. show (io:: IO , f:: TransportFunction )
243243 print (io, Base. typename (typeof (f)). name, " (" )
244244 show (io, f. ν)
245245 print (io, " , " )
246246 show (io, f. μ)
247247 print (io, " )" )
248248end
249249
250- Base. show (io:: IO , M:: MIME"text/plain" , f:: VarTransformation ) = show (io, f)
250+ Base. show (io:: IO , M:: MIME"text/plain" , f:: TransportFunction ) = show (io, f)
251251
252252
253253"""
@@ -262,7 +262,7 @@ abstract type TransformVolCorr end
262262 NoVolCorr()
263263
264264Indicate that density calculations should ignore the volume element of
265- var transformations. Should only be used in special cases in which
265+ variate transformations. Should only be used in special cases in which
266266the volume element has already been taken into account in a different
267267way.
268268"""
@@ -272,7 +272,7 @@ struct NoVolCorr <: TransformVolCorr end
272272 WithVolCorr()
273273
274274Indicate that density calculations should take the volume element of
275- var transformations into account (typically via the
275+ variate transformations into account (typically via the
276276log-abs-det-Jacobian of the transform).
277277"""
278278struct WithVolCorr <: TransformVolCorr end
0 commit comments