hess_l_mvn: Hessian Matrix of the Multivariate Normal Distribution

Description Usage Arguments Value See Also Examples

View source: R/multiNorm-hess_l_mvn.R

Description

Calculates hessian matrix of the log of the likelihood function of the multivariate normal distribution for the ith observation.

Usage

1
hess_l_mvn(x, theta)

Arguments

x

Numeric vector of length k. The ith vector of observations.

theta

Numeric vector. Parameter vector \boldsymbol{θ} = ≤ft\{ \boldsymbol{μ}, \mathrm{vech} ≤ft( \boldsymbol{Σ} \right) \right\}^{\prime}

Value

A matrix

See Also

Other Multivariate Normal Distribution Functions: grad_l_mvn_generic(), grad_l_mvn(), hess_l_mvn_generic(), l_mvn_generic(), l_mvn(), mvn_theta_helper(), negl_mvn(), rmvn_chol()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
n <- 5
mu <- c(0, 0)
sigmacap <- matrix(
  data = c(
    1, 0.5, 0.5, 1
  ),
  nrow = 2
)

xcap <- as.data.frame(
  t(
    rmvn_chol(
      n = n,
      mu = mu,
      sigmacap = sigmacap
    )
  )
)

theta <- c(
  mu,
  vech(sigmacap)
)

lapply(
  X = xcap,
  FUN = hess_l_mvn,
  theta = theta
)

jeksterslab/gammaMatrix documentation built on Dec. 20, 2021, 10:10 p.m.