Skip to content

Commit

Permalink
Merge pull request #152 from biaslab/gradlogpartition_exponential
Browse files Browse the repository at this point in the history
add getgradlogpartition Exponential
  • Loading branch information
Nimrais authored Dec 15, 2023
2 parents 65f5e6b + 9ad7b0a commit decb514
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/distributions/exponential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ getlogpartition(::NaturalParametersSpace, ::Type{Exponential}) = (η) -> begin
return -log(-η₁)
end

getgradlogpartition(::NaturalParametersSpace, ::Type{Exponential}) = (η) -> begin
(η₁,) = unpack_parameters(Exponential, η)
return SA[-1/η₁]
end

getfisherinformation(::NaturalParametersSpace, ::Type{Exponential}) = (η) -> begin
(η₁,) = unpack_parameters(Exponential, η)
SA[inv(η₁^2);;]
Expand Down

0 comments on commit decb514

Please sign in to comment.