apollo_combineModels {apollo} | R Documentation |
Combines separate model components.
Description
Combines model components to create likelihood for overall model.
Usage
apollo_combineModels(
P,
apollo_inputs,
functionality,
components = NULL,
asList = TRUE
)
Arguments
P |
List of vectors, matrices or 3-dim arrays. Likelihood of the model components. |
apollo_inputs |
List grouping most common inputs. Created by function apollo_validateInputs. |
functionality |
Character. Setting instructing Apollo what processing to apply to the likelihood function. This is in general controlled by the functions that call
|
components |
Character vector. Optional argument. Names of elements in P that should be multiplied to construct the whole model likelihood. If a single element is provided, it is interpreted as a regular expression. Default is to include all components in P. |
asList |
Logical. Only used if |
Details
This function should be called inside apollo_probabilities after all model components have been produced.
It should be called before apollo_avgInterDraws, apollo_avgIntraDraws, apollo_panelProd and apollo_prepareProb, whichever apply, except where these functions are called inside any latent class components of the overall model.
Value
Argument P
with (for most functionalities) an extra element called "model", which is the product of all the other elements. Shape depends on argument functionality
.
-
"components"
: ReturnsP
without changes. -
"conditionals"
: ReturnsP
with an extra component called"model"
, which is the product of all other elements ofP
. -
"estimate"
: ReturnsP
with an extra component called"model"
, which is the product of all other elements ofP
. -
"gradient"
: ReturnsP
containing the gradient of the likelihood after applying the product rule across model components. -
"output"
: ReturnsP
with an extra component called"model"
, which is the product of all other elements ofP
. -
"prediction"
: ReturnsP
without changes. -
"preprocess"
: ReturnsP
without changes. -
"raw"
: ReturnsP
without changes. -
"shares_LL"
: ReturnsP
with an extra component called"model"
, which is the product of all other elements ofP
. -
"validate"
: ReturnsP
with an extra component called"model"
, which is the product of all other elements ofP
. -
"zero_LL"
: ReturnsP
with an extra component called"model"
, which is the product of all other elements ofP
.