evaluate_predictor: Evaluate component effects or expressions

View source: R/model.R

evaluate_predictorR Documentation

Evaluate component effects or expressions

Description

Evaluate component effects or expressions, based on a bru model and one or several states of the latent variables and hyperparameters.

Usage

evaluate_predictor(
  model,
  state,
  data,
  effects,
  predictor,
  used = NULL,
  format = "auto"
)

Arguments

state

A list where each element is a list of named latent state information, as produced by evaluate_state()

data

A list, data.frame, or Spatial*DataFrame, with coordinates and covariates needed to evaluate the model.

effects

A list where each element is list of named evaluated effects, as computed by evaluate_effect_multi_state.component_list()

predictor

Either a formula or expression

used

A bru_used() object, or NULL (default)

format

character; determines the storage format of the output. Available options:

  • "auto" If the first evaluated result is a vector or single-column matrix, the "matrix" format is used, otherwise "list".

  • "matrix" A matrix where each column contains the evaluated predictor expression for a state.

  • "list" A list where each column contains the evaluated predictor expression for a state.

Default: "auto"

Details

For each component, e.g. "name", the state values are available as name_latent, and arbitrary evaluation can be done with name_eval(...), see component_eval().

Value

A list or matrix is returned, as specified by format


inlabru documentation built on Nov. 2, 2023, 6:07 p.m.