Skip to content

Different numeric types for the GammaShapeLikelihood constructor? #538

@abpolym

Description

@abpolym

In my new branch I am currently making some tests for the rules of the GammaMixture node, because there are none.

I encountered the following error:

MethodError: no method matching ReactiveMP.GammaShapeLikelihood(::Float32, ::Float64)
Closest candidates are:
  ReactiveMP.GammaShapeLikelihood(::T, ::T) where T<:Real

Do we want GammaShapeLikelihood to be also defined for different float numeric types ?

GammaShapeLikelihood(p::Real, γ::Real) = GammaShapeLikelihood(promote(p, γ)...)

We could also just enforce consistent floating type inside the rule but that sounds kind of sus:

@rule GammaMixture((:a, k), Marginalisation) (q_out::Any, q_switch::Any, q_b::GammaDistributionsFamily) = begin
    p = Float64(probvec(q_switch)[k])
    [...]

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions