% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mappers.R
\name{bm_marginal}
\alias{bm_marginal}
\alias{bru_mapper_marginal}
\title{Mapper for marginal distribution transformation}
\usage{
bm_marginal(qfun, pfun = NULL, dfun = NULL, dqfun = NULL, ..., inverse = FALSE)

bru_mapper_marginal(...)
}
\arguments{
\item{qfun}{A quantile function, supporting arguments \code{p}, \code{lower.tail}, and
\code{log.p}, like \code{\link[stats:Normal]{stats::qnorm()}}.}

\item{pfun}{A CDF, supporting arguments \code{q}, \code{lower.tail}, and \code{log.p},
like \code{\link[stats:Normal]{stats::pnorm()}}.  Only needed and used when
\code{xor(mapper[["inverse"]], reverse)} is \code{TRUE} in a method call.
Default \code{NULL}}

\item{dfun}{A pdf, supporting arguments \code{x} and \code{log},
like \code{\link[stats:Normal]{stats::dnorm()}}. If \code{NULL} (default), uses finite
differences on \code{qfun} or \code{pfun} instead.}

\item{dqfun}{A function evaluating the reciprocal of the derivative of
\code{qfun}, i.e. the density at a given CDF value. If \code{NULL} (default), uses
\code{dfun(qfun(...),...)} or finite differences on \code{qfun} or \code{pfun} instead.
Must support the same arguments as \code{qfun}.}

\item{\dots}{Arguments passed on to \code{\link[=bm_marginal]{bm_marginal()}}}

\item{inverse}{logical; If \code{FALSE} (default), \code{\link[=bm_marginal]{bm_marginal()}}
defines a mapping from standard Normal to a specified distribution.
If \code{TRUE}, it defines a mapping from the specified distribution to a standard
Normal.}
}
\description{
Constructs a mapper that transforms the marginal distribution \code{state} from
\eqn{\textrm{N}(0,1)}{N(0, 1)} to the distribution of a given (continuous)
quantile function. The \code{...} arguments are used as parameter arguments to
\code{qfun}, \code{pfun}, \code{dfun}, and \code{dqfun}.
}
\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)

}
\seealso{
\link{bru_mapper}, \link{bru_mapper_generics}

Other mappers: 
\code{\link{bm_aggregate}()},
\code{\link{bm_collect}()},
\code{\link{bm_const}()},
\code{\link{bm_factor}()},
\code{\link{bm_fm_mesh_1d}},
\code{\link{bm_fmesher}()},
\code{\link{bm_harmonics}()},
\code{\link{bm_index}()},
\code{\link{bm_linear}()},
\code{\link{bm_logitaverage}()},
\code{\link{bm_logsumexp}()},
\code{\link{bm_matrix}()},
\code{\link{bm_multi}()},
\code{\link{bm_pipe}()},
\code{\link{bm_reparam}()},
\code{\link{bm_repeat}()},
\code{\link{bm_scale}()},
\code{\link{bm_shift}()},
\code{\link{bm_sum}()},
\code{\link{bm_taylor}()},
\code{\link{bru_get_mapper}()},
\code{\link{bru_mapper}()}
}
\concept{mappers}
