Learn R Programming

bdsm (version 0.1.1)

hessian: Hessian matrix

Description

Creates the hessian matrix for a given likelihood function.

Usage

hessian(lik, theta, ...)

Value

Hessian kxk matrix where k is the number of parameters included in the theta matrix

Arguments

lik

function

theta

kx1 matrix

...

other parameters passed to lik function.

Examples

Run this code
lik <- function(theta) {
 return(theta[1]^2 + theta[2]^2)
}

hessian(lik, c(1, 1))

Run the code above in your browser using DataLab