DerivLogf {docopulae} | R Documentation |
DerivLogf
/Deriv2Logf
builds a function that evaluates to the first/second derivative of log(f(y, theta, ...))
with respect to theta[[i]]
/theta[[i]]
and theta[[j]]
.
DerivLogf(f, parNames, preSimplify = T, ...)
Deriv2Logf(f, parNames, preSimplify = T, ...)
f |
|
parNames |
a vector of names or indices, the subset of parameters to use. |
preSimplify |
simplify the body of |
... |
other arguments passed to |
While numDerivLogf
relies on the package numDeriv and therefore uses finite differences to evaluate the derivatives, DerivLogf
utilizes the package Deriv to build sub functions for each parameter in parNames
.
The same is true for Deriv2Logf
.
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.
Deriv, Deriv
in package Deriv, buildf
, numDerivLogf
, fisherI
## see examples for param
## mind the gain regarding runtime compared to numDeriv