apollo_llCalc function

Calculates log-likelihood of all model components

Calculates log-likelihood of all model components

Calculates the log-likelihood of each model component as well as the whole model.

apollo_llCalc(apollo_beta, apollo_probabilities, apollo_inputs, silent = FALSE)

Arguments

  • apollo_beta: Named numeric vector. Names and values for parameters.

  • apollo_probabilities: Function. Returns probabilities of the model to be estimated. Must receive three arguments:

    • ‘apollo_beta’ : Named numeric vector. Names and values of model parameters.
    • ‘apollo_inputs’ : List containing options of the model. See apollo_validateInputs .
    • ‘functionality’ : Character. Can be either ‘"components"’ , ‘"conditionals"’ , ‘"estimate"’ (default), ‘"gradient"’ , ‘"output"’ , ‘"prediction"’ , ‘"preprocess"’ , ‘"raw"’ , ‘"report"’ , ‘"shares_LL"’ , ‘"validate"’ or ‘"zero_LL"’ .
  • apollo_inputs: List grouping most common inputs. Created by function apollo_validateInputs .

  • silent: Boolean. If TRUE, no information is printed to the console by the function. Default is FALSE.

Returns

A list of vectors. Each vector corresponds to the log-likelihood of the whole model (first element) or a model component.

Details

This function calls apollo_probabilities with functionality="output". It then reorders the list of likelihoods so that "model" goes first.

  • Maintainer: Stephane Hess
  • License: GPL-2
  • Last published: 2025-03-12