Skip to content

Commit

Permalink
Make DAISIE_ML1 flexible to allow another loglik function to be optim…
Browse files Browse the repository at this point in the history
…ized.
  • Loading branch information
rsetienne committed Oct 23, 2024
1 parent 6a753cd commit 43e37e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/DAISIE_ML1.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ DAISIE_ML1 <- function(
tolint = c(1E-16, 1E-10),
island_ontogeny = NA,
jitter = 0,
num_cycles = 1) {
num_cycles = 1,
function_to_optimize = DAISIE_loglik_all_choosepar) {
# datalist = list of all data: branching times, status of clade, and numnber of missing species
# datalist[[,]][1] = list of branching times (positive, from present to past)
# - max(brts) = age of the island
Expand Down Expand Up @@ -288,7 +289,7 @@ DAISIE_ML1 <- function(
)

optimpars <- c(tol, maxiter)
initloglik <- DAISIE_loglik_all_choosepar(
initloglik <- function_to_optimize(
trparsopt = trparsopt,
trparsfix = trparsfix,
idparsopt = idparsopt,
Expand Down

0 comments on commit 43e37e1

Please sign in to comment.