vcov.madness: Calculate Variance-Covariance Matrix for a model.

View source: R/vcov.r

vcov.madnessR Documentation

Calculate Variance-Covariance Matrix for a model.

Description

Returns the variance-covariance matrix of the parameters computed by a madness object.

Usage

## S3 method for class 'madness'
vcov(object, ...)

Arguments

object

a madness object. A varx matrix must have been set on the object, otherwise an error will be thrown.

...

additional arguments for method functions. Ignored here.

Details

Let X represent some quantity which is estimated from data. Let \Sigma be the (known or estimated) variance-covariance matrix of X. If Y is some computed function of X, then, by the Delta method (which is a first order Taylor approximation), the variance-covariance matrix of Y is approximately

\frac{\mathrm{d}Y}{\mathrm{d}{X}} \Sigma \left(\frac{\mathrm{d}Y}{\mathrm{d}{X}}\right)^{\top},

where the derivatives are defined over the 'unrolled' (or vectorized) Y and X.

Note that Y can represent a multidimensional quantity. Its variance covariance matrix, however, is two dimensional, as it too is defined over the 'unrolled' Y.

Value

A matrix of the estimated covariances between the values being estimated by the madness object. While Y may be multidimensional, the return value is a square matrix whose side length is the number of elements of Y

Author(s)

Steven E. Pav shabbychef@gmail.com

See Also

vcov.

Examples

y <- array(rnorm(2*3),dim=c(2,3))
dy <- matrix(rnorm(length(y)*2),ncol=2)
dx <- crossprod(matrix(rnorm(ncol(dy)*100),nrow=100))
obj <- madness(val=y,dvdx=dy,varx=dx)
print(vcov(obj))


madness documentation built on Aug. 21, 2023, 9:07 a.m.