Skip to content

Commit

Permalink
Update documentation DAISIE_logp0 and related chances in other functi…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
rsetienne committed Feb 5, 2025
1 parent 424d5dc commit 717cf53
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
9 changes: 9 additions & 0 deletions R/DAISIE_loglik_CS.R
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,15 @@ logcondprob <- function(numcolmin, numimm, logp0, fac = 2) {
#' @description Computes the log probability of no species present under the DAISIE
#' model with clade-specific diversity-dependence. The output is a log value.
#' @inheritParams default_params_doc
#' #' @param pars2 Contains the model settings \cr \cr
#' \code{pars2[1]} corresponds to lx = length of ODE variable x \cr
#' \code{pars2[2]} corresponds to ddmodel = diversity-dependent model, model of diversity-dependence, which can be one
#' of\cr \cr
#' ddmodel = 0 : no diversity dependence \cr
#' ddmodel = 1 : linear dependence in speciation rate \cr
#' ddmodel = 11: linear dependence in speciation rate and in immigration rate \cr
#' ddmodel = 2 : exponential dependence in speciation rate\cr
#' ddmodel = 21: exponential dependence in speciation rate and in immigration rate\cr\cr
#' @param island_age the island age \cr
#' @return The logarithm of the probability
#' @author Rampal S. Etienne & Bart Haegeman
Expand Down
12 changes: 4 additions & 8 deletions tests/testthat/test-DAISIE_loglik_CS.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ test_that("DAISIE_loglik_CS_choice produces correct output for relaxed-rate
skip_if(Sys.getenv("CI") == "", message = "Run only on CI")
skip_on_cran()
pars1 <- c(2.000, 2.700, 20.000, 0.009, 1.010)
pars2 <- c(1.0e+02, 1.1e+01, 0.0e+00, 0.0e+00, NA, 0.0e+00, 1.0e-04,
1.0e-05, 1.0e-07, 3.0e+03, 9.5e-01, 9.8e-01)
pars2 <- c(1.0e+02, 1.1e+01, 0.0e+00, 0.0e+00)
brts <- c(4.0000, 3.0282, 1.3227, 0.8223, 0.4286, 0.3462, 0.2450, 0.0808,
0.0527, 0.0327, 0.0221, 0.1180, 0.0756, 0.0525, 0.0322, 0.0118)
stac <- 2
Expand All @@ -51,8 +50,7 @@ test_that("DAISIE_loglik_CS_choice produces same output for CS_version = 0
skip_on_cran()
skip_if(Sys.getenv("CI") == "", message = "Run only on CI")
pars1 <- c(2.000, 2.700, 20.000, 0.009, 1.010)
pars2 <- c(100, 11, 0, 0, NA, 0.0e+00, 1.0e-04,
1.0e-05, 1.0e-07, 3.0e+03, 9.5e-01, 9.8e-01)
pars2 <- c(100, 11, 0, 0)
brts <- c(4.0000, 3.0282, 1.3227, 0.8223, 0.4286, 0.3462, 0.2450, 0.0808,
0.0527, 0.0327, 0.0221, 0.1180, 0.0756, 0.0525, 0.0322, 0.0118)
stac <- 2
Expand Down Expand Up @@ -168,8 +166,7 @@ test_that("DAISIE_loglik_CS_choice produces equivalent output for ODEINT RKCK54
skip_if(Sys.getenv("CI") == "", message = "Run only on CI")
skip_on_cran()
pars1 <- c(2.000, 2.700, 20.000, 0.009, 1.010)
pars2 <- c(1.0e+02, 1.1e+01, 0.0e+00, 0.0e+00, NA, 0.0e+00, 1.0e-04,
1.0e-05, 1.0e-07, 3.0e+03, 9.5e-01, 9.8e-01)
pars2 <- c(1.0e+02, 1.1e+01, 0.0e+00, 0.0e+00, NA)
brts <- c(4.0000, 3.0282, 1.3227, 0.8223, 0.4286, 0.3462, 0.2450, 0.0808,
0.0527, 0.0327, 0.0221, 0.1180, 0.0756, 0.0525, 0.0322, 0.0118)
stac <- 2
Expand All @@ -195,8 +192,7 @@ test_that("DAISIE_loglik_CS_choice produces equivalent output for ODEINT RKCK54
test_that("DAISIE_loglik_CS_choice produces equivalent
output for ODEINT RKF78 and deSolve lsodes", {
pars1 <- c(2.000, 2.700, 20.000, 0.009, 1.010)
pars2 <- c(1.0e+02, 1.1e+01, 0.0e+00, 0.0e+00, NA, 0.0e+00, 1.0e-04,
1.0e-05, 1.0e-07, 3.0e+03, 9.5e-01, 9.8e-01)
pars2 <- c(1.0e+02, 1.1e+01, 0.0e+00, 0.0e+00, NA)
brts <- c(4.0000, 3.0282, 1.3227, 0.8223, 0.4286, 0.3462, 0.2450, 0.0808,
0.0527, 0.0327, 0.0221, 0.1180, 0.0756, 0.0525, 0.0322, 0.0118)
stac <- 2
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-DAISIE_logp0.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
test_that("DAISIE_logp0 is correct", {
pars1 <- c(2.000, 2.700, 20.000, 0.009, 1.010)
pars2 <- c(1.0e+02, 1.1e+01, 0.0e+00, 0.0e+00, NA, 0.0e+00, 1.0e-04,
1.0e-05, 1.0e-07, 3.0e+03, 9.5e-01, 9.8e-01)
pars2 <- c(1.0e+02, 1.1e+01)
island_age <- 4
logp0 <- DAISIE_logp0(pars1 = pars1,
pars2 = pars2,
Expand Down

0 comments on commit 717cf53

Please sign in to comment.