trind {dsfa} | R Documentation |
Provides the column index of the required derivative for the specified order of a derivs
object.
trind(tri, part_deriv_var)
tri |
list; created by the function |
part_deriv_var |
integer vector; specifies |
Let f:\mathbb{R}^K \to \mathbb{R}^L, (x_{n1},x_{n2},...,x_{nK}) \mapsto f(x_{n1},x_{n2},...,x_{nK})
be differentiable up to order four w.r.t all parameters x_{nk}
, where k \in \{1,...,K\}
and n \in \{1,...,N\}
.
Then a derivs
class object is a numeric matrix with N
rows and L
columns. N
is the length of the input vectors. Further, it has the following attributes:
d1
: a numeric matrix of the first derivatives w.r.t all parameters,
where the nth
row corresponds to: (\frac{\partial f(\cdot)}{\partial x_{n1}}, \frac{\partial f(\cdot)}{\partial x_{n1}},...,\frac{\partial f(\cdot)}{\partial x_{nK}})
d2
: a numeric matrix of the second derivatives w.r.t all parameters,
where the nth
row corresponds to: (\frac{\partial^2 f(\cdot)}{\partial x_{n1} \partial x_{n1}}, \frac{\partial^2 f(\cdot)}{\partial x_{n1} \partial x_{n2}},...,\frac{\partial^2 f(\cdot)}{\partial x_{nK} \partial x_{nK}})
d3
: a numeric matrix of the third derivatives w.r.t all parameters,
where the nth
row corresponds to: (\frac{\partial^3 f(\cdot)}{\partial x_{n1} \partial x_{n1} \partial x_{n1}}, \frac{\partial^3 f(\cdot)}{\partial x_{n1} \partial x_{n1} \partial x_{n2}},...,\frac{\partial^3 f(\cdot)}{\partial x_{nK} \partial x_{nK} \partial x_{nK}})
d4
: a numeric matrix of the fourth derivatives w.r.t all parameters,
where the nth
row corresponds to: (\frac{\partial^4 f(\cdot)}{\partial x_{n1} \partial x_{n1} \partial x_{n1} \partial x_{n1}}, \frac{\partial^4 f(\cdot)}{\partial x_{n1} \partial x_{n1} \partial x_{n1} \partial x_{n2}},...,\frac{\partial^4 f(\cdot)}{\partial x_{nK} \partial x_{nK} \partial x_{nK} \partial x_{nK}})
The function trind()
provides the index for the corresponding derivatives. The derivs
class object allows for a modular system which can be easily extended and is faster than numerical derivatives.
The advantage compared to analytical derivatives provided by 'mathematica' or deriv()
is that asymptotics and approximations can be used for individual parts.
Handwritten derivatives can be tedious at times and may be prone to errors. Thus, the derivs
class object can be used by lazy users.
Mainly intended for internal use.
Integer, the index for a derivs object.
Other derivs:
chainrule()
,
derivs_transform()
,
differencerule()
,
ind2joint()
,
list2derivs()
,
productrule()
,
quotientrule()
,
sumrule()
,
trind_generator()
tri=trind_generator(3)
trind(tri, c(2,1))