Creates log-likelihood function from the likelihood function apollo_probabilities provided by the user.
apollo_makeLogLike(
apollo_beta,
apollo_fixed,
apollo_probabilities,
apollo_inputs,
apollo_estSet = list(estimationRoutine = "bgw"),
cleanMemory = FALSE
)apollo_logLike function.
Named numeric vector. Names and values for parameters.
Character vector. Names (as defined in apollo_beta) of parameters whose value should not change during estimation.
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".
List grouping most common inputs. Created by function apollo_validateInputs.
List of estimation options. It must contain at least one element called estimationRoutine defining the estimation algorithm. See apollo_estimate.
Logical. If TRUE, then apollo_inputs$draws and apollo_inputs$database are erased
throughout the calling stack. Used to reduce memory usage in case of multithreading and a large
database or number o draws.
Internal use only. Called by apollo_estimate before estimation.
The returned function can be single-threaded or multi-threaded based on the model options.