View source: R/gets-base-source.R
regressorsVariance | R Documentation |
The function generates the regressors of the log-variance equation in an arx
model. The returned value is a matrix
with the regressors and, by default, the regressand in column one. By default, observations (rows) with missing values are removed in the beginning and the end with na.trim
, and the returned matrix is a zoo
object.
regressorsVariance(e, vc = TRUE, arch = NULL, asym = NULL, log.ewma = NULL, vxreg = NULL, zero.adj = 0.1, vc.adj = TRUE, return.regressand = TRUE, return.as.zoo = TRUE, na.trim = TRUE, na.omit = FALSE)
e |
numeric vector, time-series or |
vc |
logical. |
arch |
either |
asym |
either |
log.ewma |
either |
vxreg |
either |
zero.adj |
numeric value between 0 and 1. The quantile adjustment for zero values. The default 0.1 means the zero residuals are replaced by the 10 percent quantile of the absolute residuals before taking the logarithm |
vc.adj |
logical. If |
return.regressand |
logical. |
return.as.zoo |
|
na.trim |
|
na.omit |
|
A matrix, by default of class zoo
, with the regressand as column one (the default).
Genaro Sucarrat, http://www.sucarrat.net/
Pretis, Felix, Reade, James and Sucarrat, Genaro (2018): 'Automated General-to-Specific (GETS) Regression Modeling and Indicator Saturation for Outliers and Structural Breaks'. Journal of Statistical Software 86, Number 3, pp. 1-44. DOI: https://www.jstatsoft.org/article/view/v086i03
Sucarrat, Genaro and Escribano, Alvaro (2012): 'Automated Financial Model Selection: General-to-Specific Modelling of the Mean and Volatility Specifications', Oxford Bulletin of Economics and Statistics 74, Issue 5 (October), pp. 716-735
regressorsMean
, arx
, zoo
, leqwma
, na.trim
and na.omit
.
##generate some data: eps <- rnorm(10) #error term x <- matrix(rnorm(10*5), 10, 5) #regressors ##create regressors (examples): regressorsVariance(eps, vxreg=x) regressorsVariance(eps, vxreg=x, return.regressand=FALSE) regressorsVariance(eps, arch=1:3, vxreg=x) regressorsVariance(eps, arch=1:2, asym=1, vxreg=x) regressorsVariance(eps, arch=1:2, asym=1, log.ewma=5) ##let eps and x be time-series: eps <- ts(eps, frequency=4, end=c(2018,4)) x <- ts(x, frequency=4, end=c(2018,4)) regressorsVariance(eps, vxreg=x) regressorsVariance(eps, arch=1:3, vxreg=x) regressorsVariance(eps, arch=1:2, asym=1, vxreg=x) regressorsVariance(eps, arch=1:2, asym=1, log.ewma=5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.