Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HierarchicalDistributions w/ dof smaller than length #415

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

waldie11
Copy link
Collaborator

@waldie11 waldie11 commented Jul 10, 2023

For some distributions length and dof do not coincide. This enables usage of e.g. Dirichlet distributions in HierarchicalDistributions

For some distributions length and dof do not coincide. This enables usage of i.e. Dirichlet distributions in HierarchicalDistributions
@waldie11
Copy link
Collaborator Author

Example:

using BAT
using ValueShapes
using Distributions
using InverseFunctions

d = HierarchicalDistribution(NamedTupleDist(
       a=truncated(Logistic(),0,Inf),
)) do v
       NamedTupleDist(
             b=Dirichlet(10,1/v.a),
       )
end

inverse(BAT.DistributionTransform(Normal,d))(zeros(1+9))

@waldie11 waldie11 requested a review from oschulz July 10, 2023 19:08
@oschulz oschulz merged commit 1cc4f7a into main Jul 10, 2023
@oschulz
Copy link
Member

oschulz commented Jul 10, 2023

Thanks!

@waldie11 waldie11 deleted the fix_eff_totalndof_hd branch July 11, 2023 08:50
@waldie11
Copy link
Collaborator Author

With pleasure 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants