Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ExponentialFamilyManifolds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ include("natural_manifolds/geometric.jl")
include("natural_manifolds/laplace.jl")
include("natural_manifolds/lognormal.jl")
include("natural_manifolds/normal.jl")
include("natural_manifolds/normal_gamma.jl")

end
19 changes: 19 additions & 0 deletions src/natural_manifolds/normal_gamma.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
get_natural_manifold_base(::Type{NormalGamma}, ::Tuple{}, conditioner=nothing)

Get the natural manifold base for the `NormalGamma` distribution.
"""
function get_natural_manifold_base(::Type{NormalGamma}, ::Tuple{Int}, conditioner=nothing)
return ProductManifold(
Euclidean(1), ShiftedNegativeNumbers(static(0)), ShiftedPositiveNumbers(static(-1/2)),ShiftedNegativeNumbers(static(0))
)
end

"""
partition_point(::Type{NormalGamma}, ::Tuple{}, p, conditioner=nothing)

Converts the `point` to a compatible representation for the natural manifold of type `NormalGamma`.
"""
function partition_point(::Type{NormalGamma}, ::Tuple{Int}, p, conditioner=nothing)
return ArrayPartition(view(p, 1:1), view(p, 2:2), view(p, 3:3), view(p, 4:4))
end
7 changes: 7 additions & 0 deletions test/natural_manifolds/normal_gamma_tests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@testitem "Check `NormalGamma` natural manifold" begin
include("natural_manifolds_setuptests.jl")

test_natural_manifold() do rng
return NormalGamma(10rand(rng), 10rand(rng), 10rand(rng), 10rand(rng))
end
end