vcov.madness {madness}R 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 XX represent some quantity which is estimated from data. Let Σ\Sigma be the (known or estimated) variance-covariance matrix of XX. If YY is some computed function of XX, then, by the Delta method (which is a first order Taylor approximation), the variance-covariance matrix of YY is approximately

dYdXΣ(dYdX),\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) YY and XX.

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

Value

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

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))


[Package madness version 0.2.8 Index]