Jacobian of a mapper
Source:R/mappers.R, R/mapper_collect.R, R/mapper_repeat.R, and 1 more
ibm_jacobian.RdImplementations must return a (sparse) matrix of size
ibm_n_output(mapper, input, inla_f)
by ibm_n(mapper, inla_f = FALSE). The inla_f=TRUE argument should
only affect the allowed type of input format.
Usage
ibm_jacobian(mapper, input, state = NULL, inla_f = FALSE, ...)
# Default S3 method
ibm_jacobian(mapper, input, state = NULL, ...)
# S3 method for class 'bm_fmesher'
ibm_jacobian(mapper, input, ...)
# S3 method for class 'bm_fm_mesh_1d'
ibm_jacobian(mapper, input, ...)
# S3 method for class 'bm_index'
ibm_jacobian(mapper, input, state, ...)
# S3 method for class 'bm_taylor'
ibm_jacobian(mapper, ..., multi = FALSE)
# S3 method for class 'bm_linear'
ibm_jacobian(mapper, input, ...)
# S3 method for class 'bm_matrix'
ibm_jacobian(mapper, input, state = NULL, inla_f = FALSE, ...)
# S3 method for class 'bm_factor'
ibm_jacobian(mapper, input, ...)
# S3 method for class 'bm_const'
ibm_jacobian(mapper, input, ...)
# S3 method for class 'bm_shift'
ibm_jacobian(mapper, input, state = NULL, ...)
# S3 method for class 'bm_scale'
ibm_jacobian(mapper, input, state = NULL, ...)
# S3 method for class 'bm_aggregate'
ibm_jacobian(mapper, input, state = NULL, ...)
# S3 method for class 'bm_logsumexp'
ibm_jacobian(mapper, input, state = NULL, ...)
# S3 method for class 'bm_logitaverage'
ibm_jacobian(mapper, input, state = NULL, ...)
# S3 method for class 'bm_marginal'
ibm_jacobian(mapper, input, state = NULL, ..., reverse = FALSE)
# S3 method for class 'bm_pipe'
ibm_jacobian(mapper, input, state = NULL, ...)
# S3 method for class 'bm_multi'
ibm_jacobian(
mapper,
input,
state = NULL,
inla_f = FALSE,
multi = FALSE,
...,
sub_A = NULL
)
# S3 method for class 'bm_harmonics'
ibm_jacobian(mapper, input, state = NULL, inla_f = FALSE, ...)
# S3 method for class 'bm_collect'
ibm_jacobian(
mapper,
input,
state = NULL,
inla_f = FALSE,
multi = FALSE,
...,
sub_lin = NULL
)
# S3 method for class 'bm_repeat'
ibm_jacobian(
mapper,
input,
state = NULL,
inla_f = FALSE,
multi = FALSE,
...,
sub_lin = NULL
)
# S3 method for class 'bm_sum'
ibm_jacobian(
mapper,
input,
state = NULL,
inla_f = FALSE,
multi = FALSE,
...,
sub_lin = NULL
)Arguments
- mapper
A mapper S3 object, inheriting from
bru_mapper.- input
Data input for the mapper.
- state
A vector of latent state values for the mapping, of length
ibm_n(mapper, inla_f = FALSE)- inla_f
logical; when
TRUEforibm_n()andibm_values(), the result must be compatible with theINLA::f(...)and correspondingINLA::inla.stack(...)constructions. Foribm_{eval,jacobian,linear}, theinputinterpretation 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 bybm_collect.- ...
Arguments passed on to other methods
- multi
logical; If
TRUE(or positive), recurse one level into sub-mappers- reverse
logical; control
bm_marginalevaluation. DefaultFALSE. WhenTRUE, reverses the direction of the mapping, see details formarginalmappers.- sub_A
Internal; precomputed Jacobian matrices.
- sub_lin
Internal, optional pre-computed sub-mapper information
Methods (by class)
ibm_jacobian(default): Mapper classes must implement their ownibm_jacobianmethod.ibm_jacobian(bm_fmesher): Returns thefmesher::fm_basis()matrix of the mesh being mapped.ibm_jacobian(bm_fm_mesh_1d): Returns thefmesher::fm_basis()matrix of the mesh being mapped.ibm_jacobian(bm_matrix): Acceptsinputas a matrix,Matrix,Spatial, orsfc_POINTobject.ibm_jacobian(bm_shift):inputNULL values are interpreted as no shift.ibm_jacobian(bm_scale):inputNULL values are interpreted as no scaling.ibm_jacobian(bm_aggregate):inputshould be a list with elementsblockandweights.blockshould be a vector of the same length as thestate, orNULL, withNULLequivalent to all-1. IfweightsisNULL, it's interpreted as all-1.ibm_jacobian(bm_logsumexp):inputshould be a list with elementsblockandweights.blockshould be a vector of the same length as thestate, orNULL, withNULLequivalent to all-1. IfweightsisNULL, it's interpreted as all-1.ibm_jacobian(bm_logitaverage):inputshould be a list with elementsblockandweights.blockshould be a vector of the same length as thestate, orNULL, withNULLequivalent to all-1. IfweightsisNULL, it's interpreted as all-1.ibm_jacobian(bm_marginal): Non-NULLinputvalues are interpreted as a parameter list forqfun, overriding that of the mapper itself.ibm_jacobian(bm_multi): Accepts a list with named entries, or a list with unnamed but ordered elements. The names must match the sub-mappers, seeibm_names.bm_multi(). Each list element should take a format accepted by the corresponding sub-mapper. In case each element is a vector, the input can be given as a data.frame with named columns, a matrix with named columns, or a matrix with unnamed but ordered columns.ibm_jacobian(bm_collect): Accepts a list with named entries, or a list with unnamed but ordered elements. The names must match the sub-mappers, seeibm_names.bm_collect(). Each list element should take a format accepted by the corresponding sub-mapper. In case each element is a vector, the input can be given as a data.frame with named columns, a matrix with named columns, or a matrix with unnamed but ordered columns. Wheninla_f=TRUEandhidden=TRUEin the mapper definition, the input format should instead match that of the first, non-hidden, sub-mapper.ibm_jacobian(bm_repeat): The input should take the format of the repeated submapper.ibm_jacobian(bm_sum): Accepts a list with named entries, or a list with unnamed but ordered elements. The names must match the sub-mappers, seeibm_names.bm_sum(). Each list element should take a format accepted by the corresponding sub-mapper. In case each element is a vector, the input can be given as a data.frame with named columns, a matrix with named columns, or a matrix with unnamed but ordered columns.
See also
Other mapper methods:
bru_mapper_generics,
ibm_eval(),
ibm_eval2(),
ibm_inla_subset(),
ibm_invalid_output(),
ibm_is_linear(),
ibm_linear(),
ibm_n(),
ibm_n_output(),
ibm_names(),
ibm_simplify(),
ibm_values()
Other specific bm_fmesher method implementations:
bm_fmesher(),
ibm_n(),
ibm_values()
Other specific bm_fm_mesh_1d method implementations:
bm_fm_mesh_1d,
ibm_n(),
ibm_values()
Other specific bm_index method implementations:
bm_index(),
ibm_invalid_output()
Other specific bm_taylor method implementations:
bm_taylor(),
ibm_eval(),
ibm_n(),
ibm_n_output(),
ibm_values()
Other specific bm_linear method implementations:
bm_linear(),
ibm_n(),
ibm_values()
Other specific bm_matrix method implementations:
bm_matrix(),
ibm_n(),
ibm_values()
Other specific bm_factor method implementations:
bm_factor(),
ibm_n(),
ibm_values()
Other specific bm_const method implementations:
bm_const(),
ibm_eval(),
ibm_n(),
ibm_values()
Other specific bm_shift method implementations:
bm_shift(),
ibm_eval(),
ibm_n(),
ibm_n_output(),
ibm_values()
Other specific bm_scale method implementations:
bm_scale(),
ibm_eval(),
ibm_n(),
ibm_n_output(),
ibm_values()
Other specific bm_aggregate method implementations:
bm_aggregate(),
ibm_eval(),
ibm_n(),
ibm_n_output(),
ibm_values()
Other specific bm_logsumexp method implementations:
bm_logsumexp(),
ibm_eval()
Other specific bm_logitaverage method implementations:
bm_logitaverage(),
ibm_eval()
Other specific bm_marginal method implementations:
bm_marginal(),
ibm_eval(),
ibm_n(),
ibm_n_output(),
ibm_values()
Other specific bm_pipe method implementations:
bm_pipe(),
ibm_eval(),
ibm_eval2(),
ibm_n(),
ibm_n_output(),
ibm_simplify(),
ibm_values()
Other specific bm_multi method implementations:
bm_multi(),
ibm_eval(),
ibm_invalid_output(),
ibm_is_linear(),
ibm_linear(),
ibm_n(),
ibm_n_output(),
ibm_names(),
ibm_values()
Other specific bm_harmonics method implementations:
bm_harmonics(),
ibm_n()
Other specific bm_collect method implementations:
bm_collect(),
ibm_eval(),
ibm_invalid_output(),
ibm_is_linear(),
ibm_linear(),
ibm_n(),
ibm_n_output(),
ibm_names(),
ibm_values()
Other specific bm_repeat method implementations:
bm_repeat(),
ibm_eval(),
ibm_invalid_output(),
ibm_linear(),
ibm_n(),
ibm_n_output(),
ibm_values()
Other specific bm_sum method implementations:
bm_sum(),
ibm_eval(),
ibm_invalid_output(),
ibm_is_linear(),
ibm_linear(),
ibm_n(),
ibm_n_output(),
ibm_names(),
ibm_values()