Skip to contents

Returns a closure function(df, par) that computes the Hessian matrix of the log-likelihood with respect to the rate parameters.

Usage

# S3 method for class 'exp_kofn'
hess_loglik(model, ...)

Arguments

model

An exp_kofn object created by kofn().

...

Additional arguments (ignored).

Value

A function function(df, par) returning an m x m Hessian matrix.

Details

Uses numerical differentiation via numDeriv::hessian() applied to the log-likelihood closure.

Examples

model <- kofn(k = 2, m = 2, component = dfr_exponential())
#> Error in dfr_exponential(): could not find function "dfr_exponential"
H <- hess_loglik(model)
#> Error: object 'model' not found
set.seed(1)
df <- rdata(model)(c(1, 2), n = 30)
#> Error: object 'model' not found
H(df, c(1, 2))  # 2x2 Hessian matrix
#> Error in H(df, c(1, 2)): could not find function "H"