klinfo: Kullback-Leibler Information

View source: R/klinfo.R

klinfoR Documentation

Kullback-Leibler Information

Description

Compute Kullback-Leibler information.

Usage

klinfo(distg = 1, paramg = c(0, 1), distf = 1, paramf, xmax = 10)

Arguments

distg

function for the true density (1 or 2).

1 : Gaussian (normal) distribution
paramg(1): mean
paramg(2): variance
2 : Cauchy distribution
paramg(1): \mu (location parameter)
paramg(2): \tau^2 (dispersion parameter)
paramg

parameter vector of true density.

distf

function for the model density (1 or 2).

1 : Gaussian (normal) distribution
paramf(1): mean
paramf(2): variance
2 : Cauchy distribution
paramf(1): \mu (location parameter)
paramf(2): \tau^2 (dispersion parameter)
paramf

parameter vector of the model density.

xmax

upper limit of integration. lower limit xmin = -xmax.

Value

nint

number of function evaluation.

dx

delta.

KLI

Kullback-Leibler information, I(g;f).

gint

integration of g(y) over [-xmax, xmax].

References

Kitagawa, G. (2020) Introduction to Time Series Modeling with Applications in R. Chapman & Hall/CRC.

Examples

# g:Gauss, f:Gauss
klinfo(distg = 1, paramg = c(0, 1), distf = 1, paramf = c(0.1, 1.5), xmax = 8)

# g:Gauss, f:Cauchy
klinfo(distg = 1, paramg = c(0, 1), distf = 2, paramf = c(0, 1), xmax = 8)

TSSS documentation built on Sept. 29, 2023, 9:07 a.m.