Learn R Programming

greybox (version 2.0.2)

extractScale: Functions to extract scale and standard error from a model

Description

Functions extract scale and the standard error of the residuals. Mainly needed for the work with the model estimated via sm.

Usage

extractScale(object, ...)

# S3 method for default extractScale(object, ...)

# S3 method for greybox extractScale(object, ...)

extractSigma(object, ...)

# S3 method for default extractSigma(object, ...)

# S3 method for greybox extractSigma(object, ...)

Value

One of the two is returned, depending on the type of estimated model:

  • Scalar from sigma() method if the variance is assumed to be constant.

  • Vector of values if the scale model was estimated

Arguments

object

The model estimated using lm / alm / etc.

...

Other parameters (currently nothing).

Author

Ivan Svetunkov, ivan@svetunkov.ru

Details

In case of a simpler model, the functions will return the scalar using sigma() method. If the scale model was estimated, extractScale() and extractSigma() will return the conditional scale and the conditional standard error of the residuals respectively.

See Also

sm

Examples

Run this code
# Generate the data
xreg <- cbind(rnorm(100,10,3),rnorm(100,50,5))
xreg <- cbind(100+0.5*xreg[,1]-0.75*xreg[,2]+sqrt(exp(0.8+0.2*xreg[,1]))*rnorm(100,0,1),
              xreg,rnorm(100,300,10))
colnames(xreg) <- c("y","x1","x2","Noise")

# Estimate the location and scale model
ourModel <- alm(y~., xreg, scale=~x1+x2)

# Extract scale
extractScale(ourModel)
# Extract standard error
extractSigma(ourModel)

Run the code above in your browser using DataLab