Skip to content

Support for multiple dependency/parent nodes in AutoStructured [feature request] #2950

@vitkl

Description

@vitkl

Often in hierarchical models, the prior value of a site depends on the value of several parent nodes via a specific computation (such as matrix multiplication).

For example in this case, the value of w_sf depend on k_sr and q_rf:

d_sg ~ Poisson(mu_sg)
mu_sg = sum_f w_sf * g_fg
w_sf ~ Gamma(10, 10 / mu_sf)
mu_sf = sum_r k_sr * q_rf
k_sr ~ Gamma(1, 1)
q_rf ~ Gamma(1, 1)

Would be great if it was possible to not only say that w_sf depend on k_sr and q_rf but specify a function that gives a hierarchical component of w_sf:

AutoStructured(dependencies={'w_sf': {['k_sr', 'q_rf']: lambda k_sr, q_rf: k_sr @ q_rf})

This probably also needs the site to be available in a non-flattened format.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions