Skip to content

Beta-Bernoulli model #434

Answered by bvdmitri
mateusjoffily asked this question in Q&A
Feb 25, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey, yes this is a consequence of default variational factorization for the data points, RxInfer treats y as actual data point, thus it is not being included in the resulting variational distributions and you get "worse" estimate. If you want to change that you should use y = UnfactorizedData(missing), e.g.

julia> result = infer(
           model = beta_bernoulli(a = 2, b = 1),
           data  = (y =  UnfactorizedData(missing), )
       )
Inference results:
  Posteriors       | available for (θ)
  Predictions      | available for (y)


julia> println(result.posteriors[])
Beta{Float64}=2.0, β=1.0)

julia> println(result.predictions[:y])
Bernoulli{Float64}(p=0.6666666666666666)

Long st…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mateusjoffily
Comment options

Answer selected by mateusjoffily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants