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

Description Usage Arguments Details Value See Also Examples

Description

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

Usage

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

Arguments

object

Object of class 'lmvar'

mu

Specifies whether or not the block-matrix for β_μ is included in the returned matrix

sigma

Specifies whether or not the block-matrix for β_σ is included in the returned matrix

...

Additional arguments, not used in the current implementation

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 μ and σ.

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 β_μ.

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 β_σ.

Value

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

See Also

vcov.lmvar calculates the covariance matrix for the maximum-likelihood estimators of β_μ and β_μ

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

coef.lmvar for the coefficients β_μ and β_σ

fitted.lmvar for the expectation values μ and standard deviations σ.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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)

Example output

              (Intercept)        mag       dist (Intercept_s)     mag_s
(Intercept)      125.5898   735.0977   5554.646     0.0000000  0.000000
mag              735.0977  4362.0306  34962.044     0.0000000  0.000000
dist            5554.6462 34962.0438 600958.883     0.0000000  0.000000
(Intercept_s)      0.0000     0.0000      0.000     2.0000000 12.168132
mag_s              0.0000     0.0000      0.000    12.1681319 75.066923
dist_inv_s         0.0000     0.0000      0.000     0.1918235  1.160734
              dist_inv_s
(Intercept)    0.0000000
mag            0.0000000
dist           0.0000000
(Intercept_s)  0.1918235
mag_s          1.1607339
dist_inv_s     0.1139444
            (Intercept)        mag       dist
(Intercept)    125.5898   735.0977   5554.646
mag            735.0977  4362.0306  34962.044
dist          5554.6462 34962.0438 600958.883
              (Intercept_s)       mag  dist_inv
(Intercept_s)     2.0000000 12.168132 0.1918235
mag              12.1681319 75.066923 1.1607339
dist_inv          0.1918235  1.160734 0.1139444

lmvar documentation built on May 16, 2019, 5:06 p.m.