Description Usage Arguments Details Value References See Also Examples
Estimate the Complete Subset Regressions Elliott, Gargano and Timmermann (2013) with the possibility of pre-testing the variables as in Garcia, Medeiros and Vasconcelos (2017) and Medeiros and Vasconcelos(2016).
1 |
x |
Matrix of independent variables. Each row is an observation and each column is a variable. |
y |
Response variable equivalent to the function. |
K |
Number of variables to be selected after the pre-testing. If K=ncol(x) the pre-testing is redundant. |
k |
Number of variables in each subset. Must be smaller than K. |
fixed.controls |
A vector indicatin which variables in x are fixed controls. May be a character vector with the variable names or a numeric vector with the variables position in x. |
The Complete Subset Regressions estimates, for a given set of K variables, all possible models with k variables. The number of regressions to be fitted grow very fast with K, therefore, in some cases a pre-testing to select only the most relevant variables may be the only way to make the model computationally feasible.
The pre-testing is activated automatically if the total number of variables in x is bigger than K. If the user chooses K=ncol(x) the procedure is exactly the one presented in Elliott, Gargano and Timmermann (2013).
If the user chooses to include fixed controls in the model they will included in all models and each model will have k+length(fixed.controls) variables.
An object with S3 class csr.
coefficients |
Coefficients on each model of the subset. |
fitted.values |
In-sample fitted values. |
residuals |
Model residuals. |
call |
The matched call. |
Elliott, Graham, Antonio Gargano, and Allan Timmermann. "Complete subset regressions." Journal of Econometrics 177.2 (2013): 357-373.
Garcia, Medeiros and Vasconcelos (2017).
Medeiros, Marcelo C., and Gabriel FR Vasconcelos. "Forecasting macroeconomic variables in data-rich environments." Economics Letters 138 (2016): 50-52.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## == This example uses the Brazilian inflation data from
#Garcia, Medeiros and Vasconcelos (2017) == ##
data("BRinf")
## == Data preparation == ##
## == The model is yt = a + Xt-1'b + ut == ##
## == The autorregressive is a fixed control == ##
aux = embed(BRinf,2)
y=aux[,1]
x=aux[,-c(1:ncol(BRinf))]
model=csr(x,y,K=20,k=4,fixed.controls = 1)
plot(y,type="l")
lines(fitted(model),col=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.