Search This Blog

Sunday, April 01, 2012

R: Calculate Residuals Statistics and Likelihood


residualStats {dse1}R Documentation

Calculate Residuals Statistics and Likelihood

Description

Calculate the residuals statistics and likelihood of a residual.

Usage

    residualStats(pred, data, sampleT=nrow(pred), warn=TRUE)

Arguments

pred A matrix with columns representing time series.
data A matrix with columns representing time series.
sampleT An integer indicating the sample to use.
warn If FALSE certain warnings are suppressed.

Details

Residuals are calculated as pred[1:sampleT,,drop=FALSE] - data[1:sampleT,,drop=FALSE] and then statistics are calculated based on these residuals. If pred or data are NULL they are treated as zero.

Value

A list with elements like, cov, pred, and sampleT. pred and sampleT are as supplied (and are returned as this is a utility function called by other functions and it is convenient to pass them along). cov is the covariance of the residual and like is a vector of four elements representing the total, constant, determinant and covariance terms of the negative log likelihood function.

See Also

l

Examples

    residualStats(matrix(rnorm(200), 100,2), NULL) # but typically used for a residual

[Package dse1 version 2007.7-1 Index]

No comments:

Post a Comment

Thank you