Laplace fit of the binned distance-sampling abundance model
Source:R/distance.R
distance_laplace.RdMaximum-likelihood fit (non-spatial, fixed effects only) of a binned
distance-sampling abundance model with a Poisson or negative-binomial
abundance mixing distribution and a half-normal or hazard-rate detection key.
Latent abundance N_i ~ Poisson(lambda_i) (or NegBin(lambda_i, r)) is summed
out in closed form (truncation K_max); the detection integrals over distance
bins are evaluated by Gauss-Legendre quadrature.
Usage
distance_laplace(
y,
X_lambda,
X_sigma,
cutpoints,
key = c("halfnorm", "hazard"),
transect = c("line", "point"),
mixture = c("P", "NB"),
beta_lambda_init = NULL,
beta_sigma_init = NULL,
eta_b_init = NULL,
log_r_init = NULL,
r_max = 1e+05,
K_max = NULL,
headroom = NULL,
quad_order = 64L,
max_iter = 100L,
tol = 1e-06,
verbose = FALSE,
quad_xptr = NULL
)Arguments
- y
Integer matrix
[n_sites x n_bins]of per-bin detected counts.- X_lambda
Numeric matrix
[n_sites x p_lambda]of abundance covariates.- X_sigma
Numeric matrix
[n_sites x p_sigma]of detection-scale covariates (thelog sigmalinear predictor).- cutpoints
Numeric bin edges, length
n_bins + 1(0 = c_0 < c_1 < ... < c_B).- key
"halfnorm"(default) or"hazard"detection key.- transect
"line"(default, distances uniform) or"point"(radial, density proportional to distance).- mixture
"P"(Poisson, default) or"NB"(negative binomial).- beta_lambda_init, beta_sigma_init, eta_b_init, log_r_init
Optional warm starts.
- r_max
Upper bound on the NB size
r(NB only, default1e5).- K_max
Marginal-sum truncation; defaults to
3 * max(site total) + 100(applied per site, seeheadroom).- headroom
Latent-N states summed above each site's own detected total.
NULL(default) derives it fromK_max: an unsetK_maxcaps each site at its own total plus2 * max(site total) + 100, an explicitK_maxtruncates globally and uncapped. A negative value disables the per-site cap.- quad_order
Gauss-Legendre nodes per bin (default 64).
- max_iter
Newton iteration budget (default 100).
- tol
Gradient-norm convergence tolerance (default 1e-6).
- verbose
Print per-iteration progress.
- quad_xptr
Optional pre-built quadrature (from
cpp_distance_build_quad()) for a caller fitting several species/starts against the samecutpoints/transect/quad_order; built once and reused instead of every call rebuilding it. Internal; defaults to building it fresh.