bm_logitaverage: Mapper for logit-sum-inverse-logit aggregation

View source: R/mappers.R

bm_logitaverageR Documentation

Mapper for logit-sum-inverse-logit aggregation

Description

[Experimental] Constructs a mapper that averages elements of plogis(state), with optional non-negative weighting, and then takes the qlogis(). Relies on the input handling methods for bm_aggregate. To avoid numerical issues, it uses plogis(x, log.p = TRUE), plogis(-x, log.p = TRUE), and the equivalent of two applications of bm_logsumexp() to evaluate \log(p_k)-\log(1-p_k), where

p_k=\sum_{i\in I_k} w_i / (1+e^{-\eta_i}) / \sum_{i\in I_k} w_i

Usage

bm_logitaverage(n_block = NULL)

Arguments

n_block

Predetermined number of output blocks. If NULL, overrides the maximum block index in the inputs. The priority order is input$n_block, the mapper definition n_block, then max(input$block).

Value

A bm_logitaverage/bm_aggregate mapper object.

See Also

bru_mapper, bru_mapper_generics

Other mappers: bm_aggregate(), bm_collect(), bm_const(), bm_expr(), bm_factor(), bm_fm_mesh_1d, bm_fmesher(), bm_harmonics(), bm_index(), bm_linear(), bm_logsumexp(), bm_marginal(), bm_matrix(), bm_multi(), bm_pipe(), bm_reparam(), bm_repeat(), bm_scale(), bm_shift(), bm_sum(), bm_taylor(), bru_get_mapper(), bru_mapper()

Examples

m <- bm_logitaverage()
ibm_eval2(m, list(block = c(1, 2, 1, 2), weights = 1:4), 11:14)
ibm_eval2(m, list(block = c(1, 2, 1, 2), weights = 1:4, n_block = 3), 11:14)


inlabru documentation built on July 28, 2026, 9:07 a.m.