invertinfo: Compute a Covariance Matrix from a Fisher Information Matrix

View source: R/invertinfo.R

invertinfoR Documentation

Compute a Covariance Matrix from a Fisher Information Matrix

Description

Stable function for computing a covariance matrix from a given Fisher information matrix by inversion.

Usage

invertinfo(mat, silent=TRUE, stopOnError=FALSE)

Arguments

mat

a Fisher Information Matrix.

silent

logical value. If FALSE, errors in the computation of the inverse while using the Cholesky decomposition algorithm are printed. If TRUE, errors can be seen only in the value error_message.

stopOnError

logical value. If TRUE only an error message is printed in case of error.

Details

A Cholesky decomposition is used to obtain the covariance matrix. This can be done because the Fisher information matrix is symmetric and positive definite.

This function is meant to be a more stable alternative to the function solve, which does not take into account, that the matrix is symmetric and positive definite.

Value

A list containing the following components:

vcov

the covariance matrix.

error_message

possible error messages that occured when inverting the Fisher information matrix.

Author(s)

Tobias Liboschik and Philipp Probst

See Also

chol and chol2inv.

Examples

library(Matrix)
invertinfo(Hilbert(5), stopOnError=TRUE)
invertinfo(Hilbert(100))
invertinfo(Hilbert(100), silent=FALSE)
## Not run: invertinfo(Hilbert(100), stopOnError=TRUE)

tscount documentation built on May 11, 2023, 3:04 p.m.