Skip to content

Issue when defining own prior #141

@JackStorrorCarter

Description

@JackStorrorCarter

I encountered a problem when trying to define my own prior distribution for the transition probabilities. I created a dictionary 'prior' which is of the same form as the default prior. However, when using this new prior I get the error 'Number of sub-lists in the list of priors must agree with the number of situations.' I think that the prior should be the same length as the number of edges, rather than the number of situations. If so then in the check_prior function, the line

if len(node_priors_list) != len(self.edge_countset):

should be changed to

if len(node_priors_list) != len(self.edges):

Of course I'm not sure of this so didn't want to change it directly - maybe it's the case that user defined priors have a different form to the default prior?

To recreate the issue, try the following
st = StagedTree(df)
st.calculate_AHC_transitions()
prior = st.prior
st = StagedTree(df)
st.calculate_AHC_transitions(prior=prior)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions