nll: Negative Log Likelihood Function for Estimating Sigma and...

Description Usage Arguments Value

View source: R/nll.R

Description

function description

Usage

1
nll(par, K, n_dat, W = 20, y_dat, distance_sampling = TRUE)

Arguments

par

parameters to be guessed (in this case c(log(sigma), log(lambda))). The parameters are logged so that they're always positive.

K

The maximum possible true abundance, N. I've been using round(lambda * 10) as a default.

n_dat

matrix of observations at all sites (rows) and samples/replicates (columns)

W

Transect half-width (meters). If not set, it uses the maximum observed distance.

y_dat

vector of distances (meters) for all observations

distance_sampling

logical. Whether or not to incorporate distance data into likelihood.

Value

total negative log likelihood of the data given the parameters.


philipshirk/nmmsims documentation built on Feb. 26, 2020, 11:27 a.m.