dd_loglik_func: Log-likelihood function of a diversity-dependent model given...

View source: R/dd_loglik_func.R

dd_loglik_funcR Documentation

Log-likelihood function of a diversity-dependent model given waiting times

Description

Compute the log-likelihood of athe diversity-dependent model specified by speciation_func, extinction_func, and params given a set of waiting times to next events and associated diversity. Meant to be called internally by fit_dd_model_with_fossil().

Usage

dd_loglik_func(params, waiting_times_tbl, speciation_func, extinction_func)

Arguments

params

a named vector containing the values of the parameters of speciation_func and extinction_func.

waiting_times_tbl

the output of waiting_times(), a table containing the waiting times to a next event, type of events, and species diversity.

speciation_func

a function describing how the rate of speciation varies with the number of species N. Must take arguments params and N. Inside the function, parameters must be referred as params$param_name.

extinction_func

a function describing how the rate of extinction varies with the number of species N. Must take arguments params and N. Inside the function, parameters must be referred as params$param_name.

Value

a unique log-likelihood value

Author(s)

Theo Pannetier


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