new_xnicher: Create a xnicher optimization result object

View source: R/xnicher_class.R

new_xnicherR Documentation

Create a xnicher optimization result object

Description

Constructs an S3 object of class "xnicher" from the outputs of optimize_niche.

Usage

new_xnicher(solutions, best, likelihood, n_starts, var_names = NULL, eta = 1)

Arguments

solutions

A data frame with columns start_id, loglik, convergence, and full_par (list column).

best

A list with the best solution: theta, loglik, convergence.

likelihood

Character. One of "ip_weighted" or "presence_only".

n_starts

Integer. Total number of starting points used.

var_names

Optional character vector of length p naming the environmental variables in the order assumed by best$theta. Stored on the object so predict.xnicher can reorder a future SpatRaster by layer name.

eta

Numeric scalar. The Beta-shape parameter passed to cvine_cholesky during fitting (default 1.0). Stored on the object so predict.xnicher reconstructs the same correlation matrix from best$theta that the optimizer used. Defaults to 1.0 (the LKJ-uniform prior), matching optimize_niche.

Value

An object of class "xnicher".


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