Skip to contents

Implementations must return a vector of length ibm_n_output(). The input contents must be in a format accepted by ibm_jacobian() for the mapper.

Usage

ibm_eval(mapper, input, state = NULL, ...)

# Default S3 method
ibm_eval(mapper, input, state = NULL, ..., jacobian = NULL)

# S3 method for class 'bm_taylor'
ibm_eval(mapper, input = NULL, state = NULL, ...)

# S3 method for class 'bm_const'
ibm_eval(mapper, input, state = NULL, ...)

# S3 method for class 'bm_shift'
ibm_eval(mapper, input, state = NULL, ..., sub_lin = NULL)

# S3 method for class 'bm_scale'
ibm_eval(mapper, input, state = NULL, ..., sub_lin = NULL)

# S3 method for class 'bm_aggregate'
ibm_eval(mapper, input, state = NULL, ..., sub_lin = NULL)

# S3 method for class 'bm_logsumexp'
ibm_eval(mapper, input, state = NULL, log = TRUE, ..., sub_lin = NULL)

# S3 method for class 'bm_marginal'
ibm_eval(mapper, input, state = NULL, ..., reverse = FALSE)

# S3 method for class 'bm_pipe'
ibm_eval(mapper, input, state = NULL, ...)

# S3 method for class 'bm_multi'
ibm_eval(
  mapper,
  input,
  state = NULL,
  inla_f = FALSE,
  ...,
  jacobian = NULL,
  pre_A = deprecated()
)

# S3 method for class 'bm_collect'
ibm_eval(
  mapper,
  input,
  state,
  inla_f = FALSE,
  multi = FALSE,
  ...,
  sub_lin = NULL
)

# S3 method for class 'bm_repeat'
ibm_eval(mapper, input, state, multi = FALSE, ..., sub_lin = NULL)

# S3 method for class 'bm_sum'
ibm_eval(mapper, input, state, multi = FALSE, ..., sub_lin = NULL)

Arguments

mapper

A mapper S3 object, inheriting from bru_mapper.

input

Data input for the mapper.

state

A vector of latent state values for the mapping, of length ibm_n(mapper, inla_f = FALSE)

...

Arguments passed on to other methods

jacobian

For ibm_eval() methods, an optional pre-computed Jacobian, typically supplied by internal methods that already have the Jacobian.

sub_lin

Internal, optional pre-computed sub-mapper information

log

logical; control log output. Default TRUE, see the ibm_eval() details for logsumexp mappers.

reverse

logical; control bm_marginal evaluation. Default FALSE. When TRUE, reverses the direction of the mapping, see details for marginal mappers.

inla_f

logical; when TRUE for ibm_n() and ibm_values(), the result must be compatible with the INLA::f(...) and corresponding INLA::inla.stack(...) constructions. For ibm_{eval,jacobian,linear}, the input interpretation may be different. Implementations do not normally need to do anything different, except for mappers of the type needed for hidden multicomponent models such as "bym2", which can be handled by bm_collect.

pre_A

[Deprecated] in favour of jacobian.

multi

logical; If TRUE (or positive), recurse one level into sub-mappers

Methods (by class)

  • ibm_eval(default): Verifies that the mapper is linear with ibm_is_linear(), and then computes a linear mapping as ibm_jacobian(...) %*% state. When state is NULL, a zero vector of length ibm_n_output() is returned.

  • ibm_eval(bm_taylor): Evaluates linearised mapper information at the given state. The input argument is ignored, so that the usual argument order ibm_eval(mapper, input, state) syntax can be used, but also ibm_eval(mapper, state = state). For a mapper with a named jacobian list, the state argument must also be a named list. If state is NULL, all-zero is assumed.

  • ibm_eval(bm_const): Returns the input values, with NA replaced by 0.

  • ibm_eval(bm_logsumexp): When log is TRUE (default), ibm_eval() for logsumexp returns the log-sum-weight-exp value. If FALSE, the sum-weight-exp value is returned.

  • ibm_eval(bm_marginal): When xor(mapper[["inverse"]], reverse) is FALSE, ibm_eval() for marginal returns qfun(pnorm(x), param), evaluated in a numerically stable way. Otherwise, evaluates the inverse qnorm(pfun(x, param)) instead.

See also

Other mapper methods: bru_mapper_generics, ibm_eval2(), ibm_inla_subset(), ibm_invalid_output(), ibm_is_linear(), ibm_jacobian(), ibm_linear(), ibm_n(), ibm_n_output(), ibm_names(), ibm_simplify(), ibm_values()

Other specific bm_taylor method implementations: bm_taylor(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_values()

Other specific bm_const method implementations: bm_const(), ibm_jacobian(), ibm_n(), ibm_values()

Other specific bm_shift method implementations: bm_shift(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_values()

Other specific bm_scale method implementations: bm_scale(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_values()

Other specific bm_aggregate method implementations: bm_aggregate(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_values()

Other specific bm_logsumexp method implementations: bm_logsumexp(), ibm_jacobian()

Other specific bm_marginal method implementations: bm_marginal(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_values()

Other specific bm_pipe method implementations: bm_pipe(), ibm_eval2(), ibm_jacobian(), ibm_n(), ibm_n_output(), ibm_simplify(), ibm_values()

Other specific bm_multi method implementations: bm_multi(), ibm_invalid_output(), ibm_is_linear(), ibm_jacobian(), ibm_linear(), ibm_n(), ibm_n_output(), ibm_names(), ibm_values()

Other specific bm_collect method implementations: bm_collect(), ibm_invalid_output(), ibm_is_linear(), ibm_jacobian(), ibm_linear(), ibm_n(), ibm_n_output(), ibm_names(), ibm_values()

Other specific bm_repeat method implementations: bm_repeat(), ibm_invalid_output(), ibm_jacobian(), ibm_linear(), ibm_n(), ibm_n_output(), ibm_values()

Other specific bm_sum method implementations: bm_sum(), ibm_invalid_output(), ibm_is_linear(), ibm_jacobian(), ibm_linear(), ibm_n(), ibm_n_output(), ibm_names(), ibm_values()