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

Use moment constraints to choose timepoints for prior? #250

Closed
nspope opened this issue Jan 27, 2023 · 1 comment
Closed

Use moment constraints to choose timepoints for prior? #250

nspope opened this issue Jan 27, 2023 · 1 comment

Comments

@nspope
Copy link
Contributor

nspope commented Jan 27, 2023

While working on #248 I noticed that the "discretized" priors for older nodes generally have moments that are less than their undiscretized counterparts. Currently, the way the timegrid is constructed is from evenly spaced quantiles of the undiscretized prior. This results in discretized priors that underestimate the upper tail, especially when there's a demographic history that "stretches" the time distribution.

It's probably possible to come up with a heuristic that samples the upper tail more densely, but an alternative would be to choose the timepoints so that the discretized priors have moments that are as close as possible to the originals. One way to do this would be to treat it as an optimization problem for the differences between adjacent timepoints, where the loss criterion is something like squared error between discretized/undiscretized moments, and each observation is the prior for a node. This would also enforce a hard constraint on the number of timepoints, which might be necessary if the demographic history is allowed to vary across nodes (b/c the union-of-quantiles approach won't be able to "thin" as effectively).

@nspope
Copy link
Contributor Author

nspope commented Feb 21, 2023

I played around with this idea a little bit -- seems like a no-go, as it takes awhile and doesn't seem to improve inference at all. Instead, modifying the upper timepoint as in #233 seems to have much more of impact (interestingly, #233 biases the moments upwards, but improves posterior inference).

@nspope nspope closed this as completed Feb 21, 2023
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

No branches or pull requests

1 participant