bm_marginal {inlabru} | R Documentation |
Mapper for marginal distribution transformation
Description
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
.
Usage
bm_marginal(qfun, pfun = NULL, dfun = NULL, dqfun = NULL, ..., inverse = FALSE)
bru_mapper_marginal(...)
## S3 method for class 'bm_marginal'
ibm_n(mapper, ..., state = NULL, n_state = NULL)
## S3 method for class 'bm_marginal'
ibm_n_output(mapper, input, state = NULL, ..., n_state = NULL)
## S3 method for class 'bm_marginal'
ibm_values(mapper, ..., state = NULL, n_state = NULL)
## S3 method for class 'bm_marginal'
ibm_jacobian(mapper, input, state = NULL, ..., reverse = FALSE)
## S3 method for class 'bm_marginal'
ibm_eval(mapper, input, state = NULL, ..., reverse = FALSE)
Arguments
qfun |
A quantile function, supporting |
pfun |
A CDF, supporting |
dfun |
A pdf, supporting |
dqfun |
A function evaluating the reciprocal of the derivative of
|
... |
Arguments passed on to other methods |
inverse |
logical; If |
mapper |
A mapper S3 object, inheriting from |
state |
A vector of latent state values for the mapping,
of length |
n_state |
integer giving the length of the state vector for mappers that have state dependent output size. |
input |
Data input for the mapper. |
reverse |
logical; control |
Methods (by generic)
-
ibm_jacobian(bm_marginal)
: Non-NULLinput
values are interpreted as a parameter list forqfun
, overriding that of the mapper itself. -
ibm_eval(bm_marginal)
: Whenxor(mapper[["inverse"]], reverse)
isFALSE
,ibm_eval()
formarginal
returnsqfun(pnorm(x), param)
, evaluated in a numerically stable way. Otherwise, evaluates the inverseqnorm(pfun(x, param))
instead.
See Also
bru_mapper, bru_mapper_generics
Other mappers:
bm_aggregate()
,
bm_collect()
,
bm_const()
,
bm_factor()
,
bm_fmesher()
,
bm_harmonics()
,
bm_index()
,
bm_linear()
,
bm_logsumexp()
,
bm_matrix()
,
bm_mesh_B()
,
bm_multi()
,
bm_pipe()
,
bm_repeat()
,
bm_scale()
,
bm_shift()
,
bm_sum()
,
bm_taylor()
,
bru_get_mapper()
,
bru_mapper()
,
bru_mapper.fm_mesh_1d()
,
bru_mapper.fm_mesh_2d()
,
bru_mapper_generics
Examples
m <- bm_marginal(qexp, pexp, rate = 1 / 8)
(val <- ibm_eval(m, state = -5:5))
ibm_eval(m, state = val, reverse = TRUE)
m <- bm_marginal(qexp, pexp, dexp, rate = 1 / 8)
ibm_eval2(m, state = -3:3)