powered by
graphpcor
Evaluate the hessian of the KLD for a graphpcor correlation model around a base model.
# S3 method for graphpcor hessian(func, x, method = "Richardson", method.args = list(), ...)
list containing the hessian, its 'square root', inverse 'square root' along with the decomposition used
model definition of a graphical model. This can be either a matrix or a 'graphpcor'.
either a reference correlation matrix or a numeric vector with the parameters for the reference 'graphpcor' model.
see numDeriv::hessian()
numDeriv::hessian()
use to pass the decomposition method, as a character to specify which one is to be used to compute H^0.5 and H^(1/2).
g <- graphpcor(x1 ~ x2 + x3, x2 ~ x4, x3 ~ x4) ne <- dim(g) gH0 <- hessian(g, rep(-1, ne[2])) ## alternatively C0 <- vcov(g, theta = rep(c(0,-1), ne)) all.equal(hessian(g, C0), gH0)
Run the code above in your browser using DataLab