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

Update pattern #49

Merged
merged 13 commits into from
Feb 26, 2025
Merged

Update pattern #49

merged 13 commits into from
Feb 26, 2025

Conversation

nossleinad
Copy link
Collaborator

@nossleinad nossleinad commented Feb 26, 2025

Novelties

  • This is a continuation of Root optim #40, i.e. we introduce root_optim! and root_update! here, which are similar to branchlength/nni_update! in style/conceptually
  • We enable models-updates, but here we offload to the user and don't implement our own models-updating-algorithm.
  • We develop an "update interface" which makes it easy to define how a phylogenetic tree should be updated by mixing and matching between nni/branchlength/root/model_update!

Modifications

  • In our metropolis_step interface, we can now transform the current value into a convenient parameter-space, which makes it easies to write clean proposal and log_prior definitions.

Arguably sketchy stuff

  • The names for the transformations in metropolis_step, I call tr and invtr which maybe aren't top names.
  • When we want to sample the root K times per MCMC iteration with StandardUpdate, instead of putting root=K in the StandardUpdate-constructor, we let our ConcreteRootSample <: RootSample have Base.length(::ConcreteRootSample) = K. This is a bit hacky and weird but it's because we only need to call felsenstein_roundtrip! once and not K times to do this.
  • If we want to save the models-trace during metropolis_sample, it's currently stored in a Vector{Any}. We can compress the stuff that's stored in that vector by collapse_models, but Vector{Any} is probably quite bad for performance.

@nossleinad nossleinad mentioned this pull request Feb 26, 2025
@nossleinad nossleinad merged commit e14b08f into MurrellGroup:main Feb 26, 2025
4 checks passed
@nossleinad nossleinad deleted the update-pattern branch February 26, 2025 10:48
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.

1 participant