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 \)
See also
bru_mapper, bru_mapper_generics
Other mappers:
bm_aggregate(),
bm_collect(),
bm_const(),
bm_factor(),
bm_fm_mesh_1d,
bm_fmesher(),
bm_harmonics(),
bm_index(),
bm_linear(),
bm_logsumexp(),
bm_marginal(),
bm_matrix(),
bm_mesh_B(),
bm_multi(),
bm_pipe(),
bm_repeat(),
bm_scale(),
bm_shift(),
bm_sum(),
bm_taylor(),
bru_get_mapper(),
bru_mapper()
Other specific bm_logitaverage method implementations:
ibm_eval(),
ibm_jacobian()
Examples
m <- bm_logitaverage()
ibm_eval2(m, list(block = c(1, 2, 1, 2), weights = 1:4), 11:14)
#> $offset
#> [1] 12.04555 12.85907
#>
#> $jacobian
#> 2 x 4 sparse Matrix of class "dgCMatrix"
#>
#> [1,] 0.7112239 . 0.2887761 .
#> [2,] . 0.7869824 . 0.2130176
#>
ibm_eval2(m, list(block = c(1, 2, 1, 2), weights = 1:4, n_block = 3), 11:14)
#> $offset
#> [1] 12.04555 12.85907 NaN
#>
#> $jacobian
#> 3 x 4 sparse Matrix of class "dgCMatrix"
#>
#> [1,] 0.7112239 . 0.2887761 .
#> [2,] . 0.7869824 . 0.2130176
#> [3,] . . . .
#>