Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extract_attr_deriv

extract_attr_deriv converts attributes(hessian/gradient) of deriv() into a matrix of character strings.


Description

extract_attr_deriv converts attributes(hessian/gradient) of deriv() into a matrix of character strings.

Usage

extract_attr_deriv(ex, attribute)

Arguments

ex

Expression of derivative. Results of deriv().

attribute

"grad" for gradient or "hessian" for the Hessian matrix.

Value

Returns a matrix of character strings.

Examples

eq <- parse(text="2*(log(sin(x)/log(x)))+x^4*log(x)+cos(y+x)")
tt <- deriv(eq, c("x", "y"), hessian=TRUE)
g <- tt%>%extract_attr_deriv(., attribute = "grad")
h <- tt%>%extract_attr_deriv(., attribute = "hessian")

nmm

Nonlinear Multivariate Models

v0.9
GPL (>= 2)
Authors
Simona Jokubauskaite [aut, cre], Reinhard Hoessinger [aut], Friedrich Leisch [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.