nobs.xnicher: Number of observations used to fit a xnicher model

View source: R/ic.R

nobs.xnicherR Documentation

Number of observations used to fit a xnicher model

Description

Returns the number of presence rows (nrow(env_occ)) that were passed to optimize_niche. This is the sample size used by BIC and is the conventional choice for the presence-only and weighted families: even though the weighted likelihood includes a denominator over background points, the observed quantities being modeled are the n_{occ} occurrences.

Usage

## S3 method for class 'xnicher'
nobs(object, ...)

Arguments

object

A "xnicher" object.

...

Ignored.

Value

Integer scalar.

Examples


fit <- optimize_niche(env_occ = example_env_occ_2d,
                      env_m   = example_env_m_2d,
                      num_starts = 5L, likelihood = "weighted")
nobs(fit)


xnicher documentation built on Sept. 15, 2026, 5:08 p.m.