The function calculates the numerical derivate of an objective function using central difference. It is a relatively quick way to obtain the score contribution of each observation when the optimizer requires a single value.
num_deriv(param, log_lik, N, eps)
A vector of parameters
The log-likelihood function
The number of observations, e.g. individuals
The precision level
A matrix with rows equal to N and columns equal to the number of parameters