Background:
I am using the Ryacas
package, trying to figure out a symbolic expression for a the large-sample variance of an MLE
estimator.
To do that, I need the (inverse of the) Hessian
matrix of the likelihood function. I don't have mathematica (and the online version seems too cumbersome to use to me) and hence I am trying with the Ryacas
package which is an interface to the YACAS
computer algebra system.
Question:
I can't seem to figure out how to compute the Hessian
, however. Using the guide here: https://cran.r-project.org/web/packages/Ryacas/vignettes/high-level.html gives me an error for this. Here is a minimal reproducible example (taken from that guide)
L <- yac_symbol("x^2 * (y/4) - a*(3*x + 3*y/2 - 45)")
Hessian(L)
Error in Hessian(L) : could not find function "Hessian"
When I try in another way, namely using the (new?) interface
L <- yac_symbol("x^2 * (y/4) - a*(3*x + 3*y/2 - 45)")
y_fn(L, "HessianMatrix")
I can't seem to get a usable answer either but just HessianMatrix((x^2*y)/4-a*(3*x+(3*y)/2-45))
Would anybody have an idea how to fix this? Would be greatly appreciated!
Thanks