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

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/vcov.r

Description

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

Usage

1
2
## 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

(dY/dX) Sigma (dY/dX)',

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

1
2
3
4
5
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))

shabbychef/madness documentation built on April 11, 2021, 11:03 p.m.