numScore | R Documentation |
Calculate a numerical approximation to the Score function of a function at a parameter value.
numScore(func, theta, h = 0.0001, ...)
numJacobian(func, theta, h = 0.0001, m = 2, ...)
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 |
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.
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.
numHessian
multiRoot
g = function(x, a) (x[1]+2*x[2]^3 - x[3]^3 + a*sin(x[1]*x[2]))
x0 = c(1, 2, 3)
numScore(g, x0, a = -3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.