Skip to contents

Draws a single background (accessible-area) sample and returns it so the identical rows can be passed to every species' env_m_list entry in prepare_phylo_niche_data(). Sharing the sample keeps the availability envelope commensurate across tips and avoids the per-species Monte Carlo holes that create a spurious \(\sigma \to 0\) likelihood mode.

Usage

shared_background_sample(env_matrix, n = NULL, seed = NULL)

Arguments

env_matrix

Numeric matrix of environmental values over the clade accessible area (e.g. sampled cells of the biorealm/bioregion).

n

Integer, number of background rows to draw (default: all rows).

seed

Optional integer seed for reproducibility.

Value

A matrix with n rows sampled without replacement from env_matrix.