DerivLogf returns function(y, theta, i, ...) which evaluates to the first derivative of log(f(y, theta, ...)) with respect to theta[[i]].
The attribute "d" contains the list of sub functions.
Deriv2Logf returns function(y, theta, i, j, ...) which evaluates to the second derivative of log(f(y, theta, ...)) with respect to theta[[i]] and theta[[j]].
The attribute "d2" contains the list of sub functions.