negLL.PLB: Calculate negative log-likelihood for the bounded power-law...

View source: R/likelihood.R

negLL.PLBR Documentation

Calculate negative log-likelihood for the bounded power-law distribution

Description

Calculate the negative log-likelihood of the parameters b, xmin and xmax given data x for the PLB model. Returns the negative log-likelihood. Will be called by nlm() or similar. xmin and xmax are just estimated as the min and max of the data, not numerically using likelihood.

Usage

negLL.PLB(b, x, n, xmin, xmax, sumlogx)

Arguments

b

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

x

vector of values of data (e.g. masses of individual fish)

n

length(x), have as an input to avoid repeatedly calculating it when function is called multiple times in an optimization routine

xmin

minimum value of x to avoid repeatedly calculating

xmax

maximum value of x to avoid repeatedly calculating

sumlogx

sum(log(x)) to avoid repeatedly calculating

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.