negLL.PLB.bins.species: Calculate the negative log-likelihood of 'b' for the PLB...

View source: R/likelihood.R

negLL.PLB.bins.speciesR Documentation

Calculate the negative log-likelihood of b for the PLB model, given species-specific binned data (MLEbins method)

Description

Calculate the negative log-likelihood of b for the PLB model, given binned data where the bins can be different for each species, namely the MLEbins method derived as equations (S.18) and (S.26) in MEPS paper. Returns the negative log-likelihood. Will be called by nlm() or similar, but xmin and xmax will just be estimated as the min of lowest bin and max of the largest bin (i.e. their MLEs), no need to do numerically. See Supplementary Material of MEPS paper for derivation, and the vignettes for example use.

Usage

negLL.PLB.bins.species(b, dataBinForLike, n, xmin, xmax)

Arguments

b

value of b for which to calculate the negative log-likelihood

dataBinForLike

table data frame (tbl_df) where each row is the count in a bin of a species, and columns (and corresponding mathematical notation in MEPS Supplementary Material) are:

  • SpecCode: code for each species, s

  • wmin: lower bound of the bin, ⁠w_\{sj\}⁠ where j is the bin number

  • wmax: upper bound of the bin, ⁠w_\{s, j+1\}⁠

  • Number: count in that bin for that species, ⁠d_\{sj\}⁠ For each species the first and last bins must be non-empty, i.e. ⁠w_\{s1\}, w_\{s,J_s +1\} > 0⁠.

n

total number of counts ⁠n = \sum_\{sj\} d_\{sj\}⁠ over all s and j

xmin

maximum likelihood estimate for xmin, ⁠xmin = min_\{sj\} w_\{s, 1\}⁠

xmax

maximum likelihood estimate for xmax, ⁠xmax = max_\{sj\} w_\{s, J_s+1\}⁠

Value

negative log-likelihood of the parameters given the data

Author(s)

Andrew Edwards


andrew-edwards/sizeSpectra documentation built on June 28, 2023, 7:09 p.m.