dMGF: Moment generating functions (MGF) of standard normal...

View source: R/dMGF.R

dMGFR Documentation

Moment generating functions (MGF) of standard normal distribution.

Description

Get the polynomial term in the expression of derivatives of moment generating function of N_p(0, I_p), with respect to a given component and its exponent. Up to eighth order.

Usage

dMGF(tab, t, coef = TRUE)

Arguments

tab

a dataframe with the first column contain indices of components of a multivariate random vector \bold{X}, and the second column is the order derivatives with respect to that components.

t

vector in \mathbb{R}^p.

coef

take TRUE or FALSE value to obtain only polynomial or whole expression by multiplying the polynomial term with the exponent term \exp(.5 t't).

Details

For a standard multivariate normal random variables Y \sim N_p(0, I_p)

\mathbb{E}\left(Y_1^{k_1} ... Y_p^{k_p} \exp(t'X)\right) = \dfrac{\partial^{k_1}\dots \partial^{k_p}}{t_1^{k_1} \dots t_p^{k_p}} \exp(t't/2) = \mu^{(k_1)} (t_1) ... \mu^{(k_p)}(t_p) \exp(t't/2)

For example, \mathbb{E}Y_2^4 \exp(t'Y) = \dfrac{\partial^4}{\partial t_2^4} \exp(t't/2) = \mu^{(4)}(t_2) \exp(t't/2).

Value

Value of derivatives.

Examples

#Calculation of above example
t <- rep(.2, 7)
tab <- data.frame(j = 2, exponent = 4)
dMGF(tab, t = t)
dMGF(tab, t = t, coef = FALSE)


PlotNormTest documentation built on April 12, 2025, 9:14 a.m.