Skip to contents

The Fisher information is the Riemannian metric on the parameter manifold. The expectation is taken by summing over a discrete support or by the midpoint rule on a continuous grid, and the score is a central difference of the log density. For N(theta, sigma^2) the metric is 1/sigma^2 and for Bernoulli(theta) it is 1/(theta(1 - theta)); both closed forms are what the tests check.

Usage

Infgnt(log_p, theta, support, discrete = TRUE, h = 1e-05)

Arguments

log_p

Function log_p(x, theta).

theta

Parameter value.

support

Sample points, or midpoints of a continuous grid.

discrete

TRUE sums over the support, FALSE applies the midpoint rule.

h

Central-difference step for the score.

Value

List with estimate, metric, total_mass, n, method.

Details

Formula: g_ij(theta) = E[d_i log p d_j log p].

References

Amari (1985), Differential-Geometrical Methods in Statistics, Lecture Notes in Statistics 28, Springer. doi:10.1007/978-1-4612-5056-2

Examples

# N(theta, 1): Fisher information 1 for the mean
x <- seq(-8, 8, length.out = 2001)
Infgnt(function(x, th) dnorm(x, th, 1, log = TRUE), theta = 0, support = x, discrete = FALSE)$estimate
#> [1] 1