You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Samples tree topologies from a posterior distribution.
14
+
Samples tree topologies from a posterior distribution using a custom `update!` function.
14
15
15
16
# Arguments
17
+
- `update!`: A function that takes (tree::FelNode, models::Vector{<:BranchModel}) and updates `tree`. `update!` takes (tree::FelNode, models::Vector{<:BranchModel}) and updates `tree`. One call to `update!` corresponds to one iteration of the Metropolis algorithm.
16
18
- `initial_tree`: An initial tree topology with the leaves populated with data, for the likelihood calculation.
17
19
- `models`: A list of branch models.
18
20
- `num_of_samples`: The number of tree samples drawn from the posterior.
19
-
- `bl_sampler`: Sampler used to drawn branchlengths from the posterior.
20
21
- `burn_in`: The number of samples discarded at the start of the Markov Chain.
21
22
- `sample_interval`: The distance between samples in the underlying Markov Chain (to reduce sample correlation).
22
23
- `collect_LLs`: Specifies if the function should return the log-likelihoods of the trees.
@@ -30,16 +31,16 @@ Samples tree topologies from a posterior distribution.
30
31
- `sample_LLs`: The associated log-likelihoods of the tree (optional).
A convenience method. One step of the Metropolis algorithm is performed by calling [`nni_update!`](@ref) with `softmax_sampler` and [`branchlength_update!`](@ref) with `bl_sampler`.
102
+
103
+
# Additional Arguments
104
+
- `bl_sampler`: Sampler used to drawn branchlengths from the posterior.
Uses golden section search, or optionally Brent's method, to optimize all branches recursively, maintaining the integrity of the messages.
137
-
Requires felsenstein!() to have been run first.
138
-
models can either be a single model (if the messages on the tree contain just one Partition) or an array of models, if the messages have >1 Partition, or
139
-
a function that takes a node, and returns a Vector{<:BranchModel} if you need the models to vary from one branch to another.
155
+
A more general version of [`branchlength_optim!`](@ref). Here `bl_modifier` can be either an optimizer or a sampler (or more generally, a UnivariateModifier).
140
156
141
157
# Keyword Arguments
142
-
- `partition_list=nothing`: (eg. 1:3 or [1,3,5]) lets you choose which partitions to run over (but you probably want to optimize branch lengths with all models, the default option).
143
-
- `tol=1e-5`: absolute tolerance for the `bl_modifier`.
144
-
- `bl_modifier=GoldenSectionOpt()`: can either be a optimizer or a sampler (subtype of UnivariateModifier). For optimization, in addition to golden section search, Brent's method can be used by setting bl_modifier=BrentsMethodOpt().
145
-
- `sort_tree=false`: determines if a [`lazysort!`](@ref) will be performed, which can reduce the amount of temporary messages that has to be initialized.
146
-
- `traversal=Iterators.reverse`: a function that determines the traversal, permutes an iterable.
147
-
- `shuffle=false`: do a randomly shuffled traversal, overrides `traversal`.
158
+
See [`branchlength_optim!`](@ref).
159
+
!!! note
160
+
`bl_modifier` is a positional argument here, and not a keyword argument.
Uses golden section search, or optionally Brent's method, to optimize all branches recursively, maintaining the integrity of the messages.
191
+
Requires felsenstein!() to have been run first.
192
+
models can either be a single model (if the messages on the tree contain just one Partition) or an array of models, if the messages have >1 Partition, or
193
+
a function that takes a node, and returns a Vector{<:BranchModel} if you need the models to vary from one branch to another.
194
+
195
+
# Keyword Arguments
196
+
- `partition_list=nothing`: (eg. 1:3 or [1,3,5]) lets you choose which partitions to run over (but you probably want to optimize branch lengths with all models, the default option).
197
+
- `tol=1e-5`: absolute tolerance for the `bl_optimizer`.
198
+
- `bl_optimizer::UnivariateModifier=GoldenSectionOpt()`: the algorithm used to optimize the log likelihood of a branch length. In addition to golden section search, Brent's method can be used by setting `bl_optimizer=BrentsMethodOpt()`.
199
+
- `sort_tree=false`: determines if a [`lazysort!`](@ref) will be performed, which can reduce the amount of temporary messages that has to be initialized.
200
+
- `traversal=Iterators.reverse`: a function that determines the traversal, permutes an iterable.
201
+
- `shuffle=false`: do a randomly shuffled traversal, overrides `traversal`.
0 commit comments