Skip to content

Suggestion: pbd_sim supports SCR of Inf #16

@richelbilderbeek

Description

@richelbilderbeek

When the speciation completion rate (SCR) is set to infinity, the PBD model falls back to a BD model. The current version of PBD::pbd_sim does not provide for this. A high value for the SCR is allowed, but setting it to Inf results in an error (see code below).

Allowing Inf would result in manuscripts in which authors need not specify an arbitrary high value for SCR.

Works today

set.seed(42)
pbd_parameters <- c(
  1.0, # speciation_initiation_rate
  1000000000, # speciation_completion_rate, suggest to allow Inf
  1.0, # speciation_initiation_rate
  0.1, # extinction_rate
  0.1# extinction_rate
)

PBD::pbd_sim(
  pbd_parameters,
  age = 1,
  soc = 2 # crown
)

Suggestion

set.seed(42)
pbd_parameters <- c(
  1.0, # speciation_initiation_rate
  Inf, # speciation_completion_rate
  1.0, # speciation_initiation_rate
  0.1, # extinction_rate
  0.1# extinction_rate
)

PBD::pbd_sim(
  pbd_parameters,
  age = 1,
  soc = 2 # crown
)

Error message:

Error in while (t <= age) { : missing value where TRUE/FALSE needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions