Calculate a numerical approximation to the Score function of a
function at a parameter value.
Usage
numScore(func, theta, h = 0.0001, ...)
numJacobian(func, theta, m, h = 0.0001, ...)
Value
An p by 1 vector of the score of the function calculated at the
point theta. If the func is a log likelihood function,
then the p by 1 vector is the score function.
Arguments
func
a function for which the first (vector) argument
is used as a parameter vector.
theta
the parameter vector first argument to func.
h
the step used in the numerical calculation.
m
the dimension of the function f(theta), default is 2.
...
additional named or unmaned arguments to be passed to func.
Details
The function numScore calculates an numerical approximation to
the p by 1 first order derivative of a scalar real valued function with p-vector
argument theta.
This function can be used to check if the score function of a log likelihood is correct or not.
The function numJacobian calculates an numerical approximation to
the m by p first order derivative of a m-vector real valued function
with p-vector
argument theta.
This function can be used to find the solution of score functions for
a log likelihood using the multiRoot function.