Skip to contents

Register a reducer kernel

Usage

register_reducer(
  name,
  fun,
  requires,
  provides,
  options_schema = list(),
  input_shape = c("contrastwise", "joint_contrast"),
  model_contract = NULL,
  diagnostics = NULL,
  frame_fun = NULL
)

Arguments

name

String identifier, e.g., "meta:fe"

fun

Function(beta, var, X, z, p, df, df1, df2, opts) -> named list

requires

Character vector of required inputs, e.g., c("beta","var")

provides

Character vector of outputs to be written

options_schema

Optional schema for options

input_shape

Reducer execution mode: "contrastwise" (default) or "joint_contrast" for reducers that consume the full contrast axis jointly

model_contract

Optional declarative description of the reducer's design, weighting, missingness, variance, estimand, and deletion semantics. Custom reducers may omit this, in which case model-conditioned examination diagnostics are reported as unavailable.

diagnostics

Optional diagnostic implementation declaration. This is a list containing fun, capabilities, and modes; fun may be NULL while a capability is declared but not yet implemented.

frame_fun

Optional feature-block kernel for fmri_frame execution. It must accept arrays, design, and options, and return aligned result assays, result-observation metadata, and per-feature diagnostics.

Value

Invisibly, the registered reducer name.