The function takes the user supplied log-likelihood function and creates convenient wrappers that ensure the function can be evaluated both using a single core and multiple cores.

prepare_log_lik(ll, estim_env, workers)

Arguments

ll

This is the 'raw' log-likelihood function passed to the estimation routine. It is important that the user takes into account whether the optimization routine is a minimizer (e.g. 'ucminf') or a maximizer (e.g. 'maxlik').

estim_env

An estimation environment returned by prepare_estimation_environment

workers

A list of workers created using the parallel package

Value

The estimation-ready log likelihood function