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

Add base class for distributions with non-conjugate priors and an example use #67

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

ThomasColthurst
Copy link
Collaborator

No description provided.

// Transition the current latent values.
virtual void transition_theta(std::mt19937* prng) = 0;

void incorporate(const T& x) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general we'll want to override incorporate/unincorporate to maintain sufficient statistics and avoid the loop at each call to logp_score, right? Is that not possible for Skellam, or is this more efficient?

For distributions with mostly unique samples, keeping a running tally of logp_score at each call to incorporate/unincorporate could be better as it would avoid looping over all the data in logp_score. Ultimately I think we might want to leave incorporate/unincorporate/logp_score undefined in the base class and have each distribution explicitly do what's best, but I think this is fine for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been told in places like https://www.johndcook.com/CompendiumOfConjugatePriors.pdf (bottom of page 2) that having fixed dimensional sufficient statistics implies the existence of a conjugate prior family. That said, I've never actually read the precise statement or proof of that claim.

I'm fine with a running tally, though. I'll upgrade the code to do that now.

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.

None yet

2 participants