hessian.graphpcor: Evaluate the hessian of the KLD for a 'graphpcor' correlation...

View source: R/graphpcor.R

hessian.graphpcorR Documentation

Evaluate the hessian of the KLD for a graphpcor correlation model around a base model.

Description

Evaluate the hessian of the KLD for a graphpcor correlation model around a base model.

Usage

## S3 method for class 'graphpcor'
hessian(func, x, method = "Richardson", method.args = list(), ...)

Arguments

func

model definition of a graphical model. This can be either a matrix or a 'graphpcor'.

x

either a reference correlation matrix or a numeric vector with the parameters for the reference 'graphpcor' model.

method

see numDeriv::hessian()

method.args

see 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).

Value

list containing the hessian, its 'square root', inverse 'square root' along with the decomposition used

Examples

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)

graphpcor documentation built on June 8, 2025, 10:37 a.m.