
Last chance! 50% off unlimited learning
Sale ends in
Functions extract scale and the standard error of the residuals. Mainly needed for the work with the model estimated via sm.
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, ...)
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
The model estimated using lm / alm / etc.
Other parameters (currently nothing).
Ivan Svetunkov, ivan@svetunkov.com
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.
sm
# 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