Constructs a mapper that transforms the marginal distribution state
from
\(\textrm{N}(0,1)\) to the distribution of a given (continuous)
quantile function. The ...
arguments are used as parameter arguments to
qfun
, pfun
, dfun
, and dqfun
.
bru_mapper_marginal(
qfun,
pfun = NULL,
dfun = NULL,
dqfun = NULL,
...,
inverse = FALSE
)# S3 method for bru_mapper_marginal
ibm_n(mapper, ..., state = NULL, n_state = NULL)
# S3 method for bru_mapper_marginal
ibm_n_output(mapper, input, state = NULL, ..., n_state = NULL)
# S3 method for bru_mapper_marginal
ibm_values(mapper, ..., state = NULL, n_state = NULL)
# S3 method for bru_mapper_marginal
ibm_jacobian(mapper, input, state = NULL, ..., reverse = FALSE)
# S3 method for bru_mapper_marginal
ibm_eval(mapper, input, state = NULL, ..., reverse = FALSE)
A quantile function, supporting lower.tail
and log.p
arguments,
like stats::qnorm()
.
A CDF, supporting lower.tail
and log.p
arguments,
like stats::pnorm()
. Only needed and used when
xor(mapper[["inverse"]], reverse)
is TRUE
in a method call.
Default NULL
A pdf, supporting log
argument,
like stats::dnorm()
. If NULL
(default), uses finite
differences on qfun
or pfun
instead.
A function evaluating the reciprocal of the derivative of qfun
.
If NULL
(default), uses dfun(qfun(...),...)
or finite
differences on qfun
or pfun
instead.
Arguments passed on to other methods
logical; If FALSE
(default), bru_mapper_marginal()
defines a mapping from standard Normal to a specified distribution.
If TRUE
, it defines a mapping from the specified distribution to a standard
Normal.
A mapper S3 object, inheriting from bru_mapper
.
A vector of latent state values for the mapping,
of length ibm_n(mapper, inla_f = FALSE)
integer giving the length of the state vector for mappers that have state dependent output size.
Data input for the mapper.
logical; control bru_mapper_marginal
evaluation. Default FALSE
.
When TRUE
, reverses the direction of the mapping, see details for marginal
mappers.
ibm_eval(bru_mapper_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.
For bru_mapper_marginal
, non-NULL input
values are interpreted
as a parameter list for qfun
, overriding that of the mapper itself.
bru_mapper, bru_mapper_generics
Other mappers:
bru_get_mapper()
,
bru_mapper()
,
bru_mapper.fm_mesh_1d()
,
bru_mapper.fm_mesh_2d()
,
bru_mapper_aggregate()
,
bru_mapper_collect()
,
bru_mapper_const()
,
bru_mapper_factor()
,
bru_mapper_generics
,
bru_mapper_harmonics()
,
bru_mapper_index()
,
bru_mapper_linear()
,
bru_mapper_logsumexp()
,
bru_mapper_matrix()
,
bru_mapper_mesh_B()
,
bru_mapper_multi()
,
bru_mapper_pipe()
,
bru_mapper_scale()
,
bru_mapper_shift()
,
bru_mapper_taylor()
m <- bru_mapper_marginal(qexp, pexp, rate = 1 / 8)
(val <- ibm_eval(m, state = -5:5))
ibm_eval(m, state = val, reverse = TRUE)
m <- bru_mapper_marginal(qexp, pexp, dexp, rate = 1 / 8)
ibm_eval2(m, state = -3:3)
Run the code above in your browser using DataLab