draw_init_params_dd_ml: Draw a set of initial parameter values for a DD model

View source: R/draw_init_params_dd_ml.R

draw_init_params_dd_mlR Documentation

Draw a set of initial parameter values for a DD model

Description

Draw a set of initial parameter values for a DD model

Usage

draw_init_params_dd_ml(nb_sets, phylos, dd_model)

Arguments

nb_sets

integer, the number of sets desired.

phylos

the list of phylo class objects on which the DD model is going to be fit.

dd_model

a list with five named elements that together specify the diversity-dependent model:

  • name a two-letter code, the name of the model. First letter specifies the form of the speciation function, second letter the form of the extinction function: "l" for "linear", "x" for exponential, "c" for constant.

  • speciation_func, a function specifying the diversity-dependent speciation rate. Must take arguments params and N.

  • extinction_func, a function specifying the diversity-dependent extinction rate. Must take arguments params and N.

  • constraints a list of conditions that parameter values must satisfy. Each element is a function that takes arguments params and ..., and returns TRUE if the constraint is satisfied, FALSE if it isn't.

  • params_check a function that controls the format of params. Returns an error if the elements of params are named differently from what is expected or if the length differs from the expectation.

Value

a list of length-4 vectors containing initial values for lambda_0, mu_0 and K and alpha

Author(s)

Theo Pannetier


TheoPannetier/comrad documentation built on April 8, 2023, 8:06 a.m.