Learn R Programming

lmvar (version 1.5.2)

fisher: Fisher information matrix for an object of class 'lmvar'

Description

Fisher information matrix for an object of class 'lmvar'.

Usage

fisher(object, mu = TRUE, sigma = TRUE, ...)

Arguments

object

Object of class 'lmvar'

mu

Specifies whether or not the block-matrix for \(\beta_\mu\) is included in the returned matrix

sigma

Specifies whether or not the block-matrix for \(\beta_\sigma\) is included in the returned matrix

...

Additional arguments, not used in the current implementation

Value

An object of class 'matrix' containing the Fisher information matrix of object.

Details

The Fisher information matrix is calculated as minus \(-E[H]/n\) with \(E[H]\) the expected value of the Hessian matrix \(H\) of the log-likelihood and \(n\) the number of observations.

The matrix is calculated using the maximum-likelihood estimators of \(\mu\) and \(\sigma\).

If mu = TRUE and sigma = TRUE, the full Fisher information matrix is returned.

If mu = TRUE and sigma = FALSE, only the left-upper block-matrix is returned, corresponding to the part of the Fisher information matrix pertaining to \(\beta_\mu\).

If mu = FALSE and sigma = TRUE, only the right-lower block-matrix is returned, corresponding to the part of the Fisher information matrix pertaining to \(\beta_\sigma\).

See Also

vcov.lmvar calculates the covariance matrix for the maximum-likelihood estimators of \(\beta_\mu\) and \(\beta_\mu\)

nobs.lmvar_no_fit for the number of observations in an object of class 'lmvar'

coef.lmvar for the coefficients \(\beta_\mu\) and \(\beta_\sigma\)

fitted.lmvar for the expectation values \(\mu\) and standard deviations \(\sigma\).

See the vignette "Math" (to be viewed with vignette("Math", "lmvar")) for details.

Examples

Run this code
# NOT RUN {
# As example we use the dataset 'attenu' from the library 'datasets'. The dataset contains
# the response variable 'accel' and two explanatory variables 'mag'  and 'dist'.
library(datasets)

# Create the model matrix for the expected values
X = cbind(attenu$mag, attenu$dist)
colnames(X) = c("mag", "dist")

# Create the model matrix for the standard deviations.
X_s = cbind(attenu$mag, 1 / attenu$dist)
colnames(X_s) = c("mag", "dist_inv")

# Carry out the fit
fit = lmvar(attenu$accel, X, X_s)

# The complete Fisher information matrix is
fisher(fit)

# The left-upper block matrix relating to the expected values is
fisher(fit, sigma = FALSE)

# The right-lower block matrix relating to the variances is
fisher(fit, mu = FALSE)
# }

Run the code above in your browser using DataLab