| 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": ReturnsPwithout changes. -
"conditionals": ReturnsPwith an extra component called"model", which is the product of all other elements ofP. -
"estimate": ReturnsPwith an extra component called"model", which is the product of all other elements ofP. -
"gradient": ReturnsPcontaining the gradient of the likelihood after applying the product rule across model components. -
"output": ReturnsPwith an extra component called"model", which is the product of all other elements ofP. -
"prediction": ReturnsPwithout changes. -
"preprocess": ReturnsPwithout changes. -
"raw": ReturnsPwithout changes. -
"shares_LL": ReturnsPwith an extra component called"model", which is the product of all other elements ofP. -
"validate": ReturnsPwith an extra component called"model", which is the product of all other elements ofP. -
"zero_LL": ReturnsPwith an extra component called"model", which is the product of all other elements ofP.