% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mappers.R, R/mapper_collect.R,
%   R/mapper_repeat.R, R/mapper_sum.R, R/model.R
\name{ibm_linear}
\alias{ibm_linear}
\alias{ibm_linear.default}
\alias{ibm_linear.bm_multi}
\alias{ibm_linear.bm_collect}
\alias{ibm_linear.bm_repeat}
\alias{ibm_linear.bm_sum}
\alias{ibm_linear.bru_comp}
\title{Compute a mapper linearisation}
\usage{
ibm_linear(mapper, input, state = NULL, ...)

\method{ibm_linear}{default}(mapper, input, state, ...)

\method{ibm_linear}{bm_multi}(mapper, input, state, inla_f = FALSE, ...)

\method{ibm_linear}{bm_collect}(mapper, input, state, inla_f = FALSE, ...)

\method{ibm_linear}{bm_repeat}(mapper, input, state, ...)

\method{ibm_linear}{bm_sum}(mapper, input, state, ...)

\method{ibm_linear}{bru_comp}(mapper, input, state = NULL, ...)
}
\arguments{
\item{mapper}{A mapper S3 object, inheriting from \code{bru_mapper}.}

\item{input}{Data input for the mapper.}

\item{state}{A vector of latent state values for the mapping,
of length \code{ibm_n(mapper, inla_f = FALSE)}}

\item{...}{Arguments passed on to other methods}

\item{inla_f}{logical; when \code{TRUE} for \code{ibm_n()} and \code{ibm_values()}, the
result must be compatible with the \code{INLA::f(...)} and corresponding
\code{INLA::inla.stack(...)} constructions.  For \verb{ibm_\{eval,jacobian,linear\}},
the \code{input} interpretation may be different.
Implementations do not normally need to do anything different, except
for mappers of the type needed for hidden multicomponent models such
as "bym2", which can be handled by \code{bm_collect}.}
}
\value{
A \link{bm_taylor} object.
The \code{state0} information in the affine mapper indicates for which state
the \code{offset} was evaluated; The affine mapper output is defined as

\if{html}{\out{<div class="sourceCode">}}\preformatted{effect(input, state) =
  offset(input, state0) + jacobian(input, state0) \%*\% (state - state0)
}\if{html}{\out{</div>}}
}
\description{
Implementations must return a \link{bm_taylor} object
The linearisation information includes \code{offset}, \code{jacobian}, and \code{state0}.
The state information indicates for which state the \code{offset} was evaluated,
with \code{NULL} meaning all-zero.
The linearised mapper output is defined as

\if{html}{\out{<div class="sourceCode">}}\preformatted{effect(input, state) =
  offset(input, state0) + jacobian(input, state0) \%*\% (state - state0)
}\if{html}{\out{</div>}}

The default method calls \code{\link[=ibm_eval]{ibm_eval()}} and \code{\link[=ibm_jacobian]{ibm_jacobian()}} to generate
the needed information.
}
\section{Methods (by class)}{
\itemize{
\item \code{ibm_linear(default)}: Calls \code{\link[=ibm_eval2]{ibm_eval2()}} and returns a \link{bm_taylor} object.

}}
\seealso{
Other mapper methods: 
\code{\link{bru_mapper_generics}},
\code{\link{ibm_eval}()},
\code{\link{ibm_eval2}()},
\code{\link{ibm_inla_subset}()},
\code{\link{ibm_invalid_output}()},
\code{\link{ibm_is_linear}()},
\code{\link{ibm_is_rowwise}()},
\code{\link{ibm_jacobian}()},
\code{\link{ibm_n}()},
\code{\link{ibm_n_output}()},
\code{\link{ibm_names}()},
\code{\link{ibm_simplify}()},
\code{\link{ibm_values}()}
}
\concept{mapper methods}
