-
Notifications
You must be signed in to change notification settings - Fork 56
/
distributions.jl
67 lines (53 loc) · 1.99 KB
/
distributions.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""
FVectorvariate
Structure that subtypes `VariateForm`, indicating that a single sample
is a vector from a fiber of a vector bundle.
"""
struct FVectorvariate <: VariateForm end
"""
FVectorSupport(space::AbstractManifold, VectorSpaceFiber)
Value support for vector bundle fiber-valued distributions (values from a fiber of a vector
bundle at a `point` from the given manifold).
For example used for tangent vector-valued distributions.
"""
struct FVectorSupport{TSpace<:VectorSpaceFiber} <: ValueSupport
space::TSpace
end
"""
FVectorDistribution{TSpace<:VectorSpaceFiber, T}
An abstract distribution for vector bundle fiber-valued distributions (values from a fiber
of a vector bundle at point `x` from the given manifold).
For example used for tangent vector-valued distributions.
"""
abstract type FVectorDistribution{TSpace<:VectorSpaceFiber} <:
Distribution{FVectorvariate,FVectorSupport{TSpace}} end
"""
MPointvariate
Structure that subtypes `VariateForm`, indicating that a single sample
is a point on a manifold.
"""
struct MPointvariate <: VariateForm end
"""
MPointSupport(M::AbstractManifold)
Value support for manifold-valued distributions (values from given
[`AbstractManifold`](https://juliamanifolds.github.io/ManifoldsBase.jl/stable/types.html#ManifoldsBase.AbstractManifold) `M`).
"""
struct MPointSupport{TM<:AbstractManifold} <: ValueSupport
manifold::TM
end
"""
MPointDistribution{TM<:AbstractManifold}
An abstract distribution for points on manifold of type `TM`.
"""
abstract type MPointDistribution{TM<:AbstractManifold} <:
Distribution{MPointvariate,MPointSupport{TM}} end
"""
support(d::FVectorDistribution)
Get the object of type `FVectorSupport` for the distribution `d`.
"""
function Distributions.support(::T) where {T<:FVectorDistribution}
return error("support not implemented for type $T")
end
function uniform_distribution(M::AbstractManifold)
return uniform_distribution(M, allocate_result(M, uniform_distribution))
end