Command Reference : Command Reference : varsel : Penalty Options
  
 
varsel
Estimation using variable selection.
Syntax
varsel(options) y x1 [x2 x3 ...] @ z1 z2 z3
Specify the dependent variable followed by a list of variables to be included in the regression, but not part of the search routine, followed by an “@” symbol and a list of variables to be part of the search routine. If no included variables are required, simply follow the dependent variable with an “@” symbol and the list of search variables.
Options
 
method = arg
Stepwise regression method: “stepwise” (default), “uni” (uni-directional), “swap” (swapwise), “comb” (combinatorial), “gets” (auto-search/GETS), “lasso” (Lasso).
nvars = int
Set the number of search regressors. Required for swapwise and combinatorial methods, optional for uni-directional and stepwise methods.
w=arg
Weight series or expression.
Note: we recommend that, absent a good reason, you employ the default settings Inverse std. dev. weights (“wtype=istdev”) with EViews default scaling (“wscale=eviews”) for backward compatibility with versions prior to EViews 7.
wtype=arg (default=“istdev”)
Weight specification type: inverse standard deviation (“istdev”), inverse variance (“ivar”), standard deviation (“stdev”), variance (“var”).
wscale=arg
Weight scaling: EViews default (“eviews”), average (“avg”), none (“none”).
The default setting depends upon the weight type: “eviews” if “wtype=istdev”, “avg” for all others.
coef=arg
Specify the name of the coefficient vector (if specified by list); the default behavior is to use the “C” coefficient vector.
prompt
Force the dialog to appear from within a program.
p
Print estimation results.
Stepwise and uni-directional method options
 
back
Set stepwise or uni-directional method to run backward. If omitted, the method runs forward.
tstat
Use t-statistic values as a stopping criterion. (default uses p-values).
ftol=number (default = 0.5)
Set forward stopping criterion value.
btol=number (default = 0.5)
Set backward stopping criterion value.
fmaxstep=int (default = 1000)
Set the maximum number of steps forward.
bmaxstep=int (default = 1000)
Set the maximum number of steps backward.
tmaxstep=int (default = 2000)
Set the maximum total number of steps.
Swapwise method options
 
minr2
Use minimum R-squared increments. (Default uses maximum R-squared increments.)
Combinatorial method options
 
force
Suppress the warning message issued when a large number of regressions will be performed.
Auto-search/GETS method options
 
pval=number (default = 0.05)
Set the terminal condition p-value used to determine the stopping point of each search path
nolm
Do not perform AR LM diagnostic test.
arpval=number (default = 0.025)
Set p-value used in AR LM diagnostic test.
arlags=int (default = 1)
Set number of lags used in AR LM diagnostic test.
noarch
Do not perform ARCH LM diagnostic test.
archpval=number (default = 0.025)
Set p-value used in ARCH LM diagnostic test.
archlags=int (default = 1)
Set number of lags used in ARCH LM diagnostic test.
nojb
Do not perform Jarque-Bera normality diagnostic test.
jbpval=number (default = 0.025)
Set p-value used in Jarque-Bera normality diagnostic test.
nopet
Do not perform Parsimonious Encompassing diagnostic test.
petpval=number (default = 0.025)
Set p-value used in Parsimonious Encompassing diagnostic test.
nogum
Do not include the general model as a candidate for model selection.
noempty
Do not include the empty model as a candidate for model selection.
ic =arg
Set the information criterion used in model selection: “AIC” (Akaike information criteria, default), “BIC” (Schwarz information criteria), “HQ” (Hannan-Quin criteria).
blocks=int
Override the EViews’ determination of the number of blocks in which to split the estimation sample.
Lasso method options
Penalty Options
 
ytrans=arg (default=“none”)
Scaling of the dependent variable: “none” (none), “L1” (L1), “L2” (L2), “stdsmpl” (sample standard deviation), “stdpop” (population standard deviation), “minmax” (min-max).
xtrans=arg (default=“stdpop”)
Scaling of the regressor variables: “none” (none), “L1” (L1 norm), “L2” (L2 norm), “stdsmpl” (sample standard deviation), “stdpop” (population standard deviation), “minmax” (min-max).
lambda=arg
Value of the penalty parameter. Can be a single number, list of space-delimited numbers, a workfile series object, or left blank for a EViews determined path (default). Values must be zero or greater.
nlambdas=integer (default=100)
Number of penalty values for EViews-supplied list.
nlambdamin=integer (default=5)
Minimum number of lambda values in the path before applying stopping rules.
minddev=arg (default=1e-05)
Minimum change in deviance fraction to continue estimation. Truncate path estimation if relative change in deviance is smaller than this value.
maxedev=arg (default=0.99)
Maximum of deviance explained fraction attained to terminate estimation. Truncate path estimation if fraction of null deviance explained is larger than this value.
maxvars=arg
Maximum number of regressors in the model. Truncate path estimation if the number of coefficients (including those for non-penalized variables like the intercept) reaches this value.
maxvarsratio=arg
Maximum number of regressors in the model as a fraction of the number of observations. Truncate path estimation if the number of coefficients (including those for non-penalized variables like the intercept) divided by the number of observations reaches this value.
Cross Validation Options
 
cvmethod=arg (default=“kfold_cv”)
Cross-validation method: “kfold” (k-fold), “simple” (simple split), “mcarlo” (Monte Carlo), “leavepout” (leave-P-out), “leave1out” (leave-1-out), “rolling” (rolling window), “expanding” (expanding window).
cvmeasure=arg (default=“mse”)
Cross-validation fit measure: “mse” (mean-squared error), “r2” (R‑squared), “mae” (mean absolute error), “mape” (mean absolute percentage error), “smape” (symmetric mean absolute percentage error).
cvnfolds=arg (default=5)
Number of folds for K-fold cross-validation.
For “cvmethod=kfold”.
cvftrain=arg (default=0.8)
Proportion of data for split and Monte Carlo methods.
For “cvmethod=simple” and “cvmethod=mcarlo”.
cvnreps=arg (default=1)
Number of Monte Carlo method repetitions.
For “cvmethod=mcarlo”.
cvleaveout=arg (default=2)
Number of data points left out for leave-p-out method.
For “cvmethod=leavepout”.
cvnwindows=arg (default=4)
Number of windows for rolling window cross-validation method.
For “cvmethod=rolling”.
cvinitial=arg (default=12)
Number of initial data points in the training set for expanding cross-validation.
For “cvmethod=expanding”.
cvpregap=arg (default=0)
Number of observations between end of training set and beginning of test set.
For “cvmethod=simple”, “cvmethod=rolling” and “cvmethod=expanding”.
cvhorizon=arg (default=1)
Number of observation in the test set.
For “cvmethod=rolling” and “cvmethod=expanding”.
cvpostgap=arg (default=0)
Number of observations between end of test set and beginning of next training set for rolling window or between end of test set and end of next training set for expanding window.
For “cvmethod=rolling” and “cvmethod=expanding”
Random Number Options
 
seed=positive_integer from 0 to 2,147,483,647
Seed the random number generator.
If not specified, EViews will seed random number generator with a single integer draw from the default global random number generator.
rnd=arg (default=“kn” or method previously set using rndseed).
Type of random number generator: improved Knuth generator (“kn”), improved Mersenne Twister (“mt”), Knuth’s (1997) lagged Fibonacci generator used in EViews 4 (“kn4”) L’Ecuyer’s (1999) combined multiple recursive generator (“le”), Matsumoto and Nishimura’s (1998) Mersenne Twister used in EViews 4 (“mt4”).
Other Options
 
coefmin= vector_name, number
Vector of individual coefficient minimum values, containing negative or missing values sized to and matching the order of the variables in the specification, or a negative value for the minimum for all coefficients.
Missing values in the vector should be used to indicate that the coefficient is unrestricted.
If a vector of values is provided and individual minimums are specified using one or more @vw regressors, the vector values will be applied first, then overwritten by the individual values.
coefmax= vector_name, number
Vector of individual coefficient maximum values, containing positive or missing values sized to and matching the order of the variables in the specification, or a positive value for the maximum for all coefficients.
Missing values in the vector should be used to indicate that the coefficient is unrestricted.
If a vector of values is provided and individual maximums are specified using one or more @vw regressors, the vector values will be applied first, then overwritten by the individual values.
maxit=integer
Maximum number of iterations.
conv=scalar
Set convergence criterion. The criterion is based upon the maximum of the percentage changes in the scaled estimates. The criterion will be set to the nearest value between 1e-24 and 0.2.
w=arg
Weight series or expression.
wtype=arg (default=“istdev”)
Weight specification type: inverse standard deviation (“istdev”), inverse variance (“ivar”), standard deviation (“stdev”), variance (“var”).
wscale=arg
Weight scaling: EViews default (“eviews”), average (“avg”), none (“none”).
The default setting depends upon the weight type: “eviews” if “wtype=istdev”, “avg” for all others.
coef=arg
Specify the name of the coefficient vector (if specified by list); the default behavior is to use the “C” coefficient vector.
showopts / ‑showopts
[Do / do not] display the starting coefficient values and estimation options in the rotation output.
prompt
Force the dialog to appear from within a program.
p
Print estimation results.
 
Examples
varsel(method=comb,nvars=3) y c @ x1 x2 x3 x4 x5 x6 x7 x8
performs a combinatorial search routine to search for the three variables from the set of X1, X2, ..., X8, yielding the largest R-squared in a regression of Y on a constant and those three variables.
Cross-references
See “Regression Variable Selection”for extensive discussion.