probability_matrix_model: Construct a species-level probability-matrix model

View source: R/inference.R

probability_matrix_modelR Documentation

Construct a species-level probability-matrix model

Description

Use this backend when an external model returns probabilities for named species pairs directly, including ensemble-averaged predictions for which no single coherent block partition exists.

Usage

probability_matrix_model(
  probability_matrix,
  row_group,
  column_group,
  name = "species probability matrix"
)

Arguments

probability_matrix

Numeric species-by-species probability matrix. Row and column names are required and must be unique.

row_group

Assemblage group corresponding to matrix rows.

column_group

Assemblage group corresponding to matrix columns.

name

Descriptive model name stored in outputs.

Value

An inference_model with subclass probability_matrix_model. Prediction subsets the supplied matrix to locally present, matched species. Unmatched local species are listed in the resulting network's metadata$excluded_rows and metadata$excluded_columns.

Examples

p <- matrix(c(0.8, 0.3), 2, dimnames = list(c("a", "b"), "x"))
model <- probability_matrix_model(p, "plants", "animals")
site <- new_assemblage(list(plants = "a", animals = "x"))
infer_network(site, model)$matrix

metaweave documentation built on Nov. 3, 2026, 9:06 a.m.