Object Reference : Object View and Procedure Reference : Equation
  
 
ls
Estimation by linear or nonlinear least squares regression.
When the current workfile has a panel structure, ls also estimates cross-section weighed least squares, feasible GLS, and fixed and random effects models.
Syntax
eq_name.ls(options) y x1 [x2 x3 ...]
eq_name.ls(options) specification
For linear specifications, list the dependent variable first, followed by a list of the independent variables. Use a “C” if you wish to include a constant or intercept term; unlike some programs, EViews does not automatically include a constant in the regression. You may add AR, MA, SAR, and SMA error specifications, a D fractional differencing term, and PDL specifications for polynomial distributed lags. If you include lagged variables, EViews will adjust the sample automatically, if necessary.
Both dependent and independent variables may be created from existing series using standard EViews functions and transformations. EViews treats the equation as linear in each of the variables and assigns coefficients C(1), C(2), and so forth to each variable in the list.
Linear or nonlinear single equations may also be specified by explicit equation. You should specify the equation as a formula. The parameters to be estimated should be included explicitly: “C(1)”, “C(2)”, and so forth (assuming that you wish to use the default coefficient vector “C”). You may also declare an alternative coefficient vector using coef and use these coefficients in your expressions.
Options
Non-Panel LS Options
 
indicator
Include indicator saturation detection as part of estimation routine.
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.
z
Turn off backcasting in ARMA models where “arma=cls”.
optmethod = arg
Optimization method for nonlinear least squares and ARMA: “bfgs” (BFGS); “newton” (Newton-Raphson), “opg” or “bhhh” (OPG or BHHH), “kohn” (Kohn-Ansley for ARMA estimated by ML or GLS), or “legacy” (EViews legacy for nonlinear least squares and ARMA estimated by CLS).
Gauss-Newton is the default method.
optstep = arg
Step method for nonlinear least squares and ARMA: “marquardt” (Marquardt); “dogleg” (Dogleg); “linesearch” (Line search).
Marquardt is the default method.
cov=arg
Covariance method: “ordinary” (default method based on inverse of the estimated information matrix), “huber” or “white” (Huber-White sandwich method available for nonlinear least squares or ARMA estimated by CLS), “hac” (Newey-West HAC, available for nonlinear least squares or ARMA estimated by CLS)..
covinfo = arg
Information matrix method: “opg” (OPG); “hessian” (observed Hessian).
(Applicable when non-legacy “optmethod=”.)
nodf
Do not perform degree of freedom corrections in computing coefficient covariance matrix. The default is to use degree of freedom corrections.
covlag=arg (default=1)
Whitening lag specification: integer (user-specified lag value), “a” (automatic selection).
covinfosel=arg (default=“aic”)
Information criterion for automatic selection: “aic” (Akaike), “sic” (Schwarz), “hqc” (Hannan-Quinn) (if “lag=a”).
covmaxlag=integer
Maximum lag-length for automatic selection (optional) (if “lag=a”). The default is an observation-based maximum of .
covkern=arg (default=“bart”)
Kernel shape: “none” (no kernel), “bart” (Bartlett, default), “bohman” (Bohman), “daniell” (Daniel), “parzen” (Parzen), “parzriesz” (Parzen-Riesz), “parzgeo” (Parzen-Geometric), “parzcauchy” (Parzen-Cauchy), “quadspec” (Quadratic Spectral), “trunc” (Truncated), “thamm” (Tukey-Hamming), “thann” (Tukey-Hanning), “tparz” (Tukey-Parzen).
covbw=arg (default=“fixednw”)
Kernel Bandwidth: “fixednw” (Newey-West fixed), “andrews” (Andrews automatic), “neweywest” (Newey-West automatic), number (User-specified bandwidth).
covnwlag=integer
Newey-West lag-selection parameter for use in nonparametric kernel bandwidth selection (if “covbw=neweywest”).
covbwint
Use integer portion of bandwidth.
m=integer
Set maximum number of iterations.
c=scalar
Set convergence criterion. The criterion is based upon the maximum of the percentage changes in the scaled coefficients. The criterion will be set to the nearest value between 1e-24 and 0.2.
arma=arg
ARMA estimation method: “ml” (maximum likelihood); “gls” (generalized least squares), “cls” (conditional least squares).
Not applicable to ARFIMA models which always estimate using maximum likelihood.
armastart=arg
ARMA coefficient starting values: “auto” (automatic) “fixed” (legacy EViews fixed); “random” (random draw); “user” (user-specified).
Applicable when “arma=ml” or “arma=gls”.
s
Use the current coefficient values in estimator coefficient vector as starting values for equations specified by list with AR or MA terms when “arma=cls” (see also param ).
s=number
Determine starting values for equations specified by list with AR or MA terms when “arma=cls”. Specify a number between zero and one representing the fraction of preliminary least squares estimates computed without AR or MA terms to be used. Note that out of range values are set to “s=1”. Specifying “s=0” initializes coefficients to zero. By default EViews uses “s=1”.
Does not apply to coefficients for AR and MA terms which are set to EViews determined default values.
numericderiv / ‑numericderiv
[Do / do not] use numeric derivatives only. If omitted, EViews will follow the global default.
fastderiv / ‑fastderiv
[Do / do not] use fast derivative computation. If omitted, EViews will follow the global default.
Available only for legacy estimation (“optmeth=legacy”).
cov=arg
Covariance method: “ordinary” (default method based on inverse of the estimated information matrix), “huber” or “white” (Huber-White sandwich method available for nonlinear least squares or ARMA estimated by CLS), “hac” (Newey-West HAC, available for nonlinear least squares or ARMA estimated by CLS)., “hc” (extended heteroskedasticity consistent), “hcuser” (user-specified heteroskedasticity), “cr” (cluster robust).
The extended “hc” methods are only available for linear specifications.
hctype=arg (default “hc2”)
Extended heteroskedasticity consistent method: “hc0” (no d.f. adjustment), “hc1” (d.f. adjusted), “hc2”, “hc3”, “hc4”, “hc4m”, “hc5”, when “cov=hc”.
userwt=arg
Name of series containing user-diagonal weights (if “cov=hcuser”)
crtype=arg (default “cr1”)
Cluster robust weighting method: “cr0” (no finite sample correction), “cr1” (finite sample correction), “hc2”, “hc3”, “hc4”, “hc4m”, “hc5”, when “cov=cr”.
crname=arg
Cluster robust series name, when “cov=cr”.
k=arg (default = 0.7)
Parameter for “cov=hc, hctype=hc5” or “cov=cr, crtype=cr5”.
k1=arg (default = 1.0)
Parameter for “cov=hc, hctype=hc4m” or “cov=cr, crtype=cr4m”.
k2=arg (default = 1.5)
Parameter for “cov=hc, hctype=hc4m” or “cov=cr, crtype=cr4m”.
showopts / ‑showopts
[Do / do not] display the starting coefficient values and estimation options in the estimation output.
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.
Note: not all options are available for all equation methods.
Non-Panel Indicator Saturation Options
For use if “indicator” option is specified.
 
noiis
Do not search for impulse terms.
sis
Search for step-shift terms.
trend
Search for trend terms.
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.
Panel LS Options
 
cx=arg
Cross-section effects: (default) none, fixed effects (“cx=f”), random effects (“cx=r”).
per=arg
Period effects: (default) none, fixed effects (“per=f”), random effects (“per=r”).
wgt=arg
GLS weighting: (default) none, cross-section system weights (“wgt=cxsur”), period system weights (“wgt=persur”), cross-section diagonal weighs (“wgt=cxdiag”), period diagonal weights (“wgt=perdiag”).
cov=arg
Coefficient covariance method: (default) ordinary, White cross-section system (period clustering) robust (“cov=cxwhite” or “cov=percluster”), White period system (cross-section clustering) robust (“cov=perwhite” or “cov=cxcluster”), White heteroskedasticity robust (“cov=stackedwhite”), White two-way cluster robust (cov=bothcluster”), Cross-section system robust/PCSE (“cov=cxsur”), Period system robust/PCSE (“cov=persur”), Cross-section heteroskedasticity robust/PCSE (“cov=cxdiag”), Period heteroskedasticity robust/PCSE (“cov=perdiag”).
keepwgts
Keep full set of GLS weights used in estimation with object, if applicable (by default, only small memory weights are saved).
rancalc=arg (default=“sa”)
Random component method: Swamy-Arora (“rancalc=sa”), Wansbeek-Kapteyn (“rancalc=wk”), Wallace-Hussain (“rancalc=wh”).
nodf
Do not perform degree of freedom corrections in computing coefficient covariance matrix. The default is to use degree of freedom corrections.
coef=arg
Specify the name of the coefficient vector (if specified by list); the default behavior is to use the “C” coefficient vector.
iter=arg (default= “onec”)
Iteration control for GLS specifications: perform one weight iteration, then iterate coefficients to convergence (“iter=onec”), iterate weights and coefficients simultaneously to convergence (“iter=sim”), iterate weights and coefficients sequentially to convergence (“iter=seq”), perform one weight iteration, then one coefficient step (“iter=oneb”).
Note that random effects models currently do not permit weight iteration to convergence.
unbalsur
Compute SUR factorization in unbalanced data using the subset of available observations for a cluster.
m=integer
Set maximum number of iterations.
c=scalar
Set convergence criterion. The criterion is based upon the maximum of the percentage changes in the scaled coefficients. The criterion will be set to the nearest value between 1e-24 and 0.2.
s
Use the current coefficient values in estimator coefficient vector as starting values for equations specified by list with AR terms (see also param ).
s=number
Determine starting values for equations specified by list with AR terms. Specify a number between zero and one representing the fraction of preliminary least squares estimates computed without AR terms to be used. Note that out of range values are set to “s=1”. Specifying “s=0” initializes coefficients to zero. By default EViews uses “s=1”.
Does not apply to coefficients for AR terms which are instead set to EViews determined default values.
numericderiv / ‑numericderiv
[Do / do not] use numeric derivatives only. If omitted, EViews will follow the global default.
fastderiv / ‑fastderiv
[Do / do not] use fast derivative computation. If omitted, EViews will follow the global default.
showopts / ‑showopts
[Do / do not] display the starting coefficient values and estimation options in the estimation output.
prompt
Force the dialog to appear from within a program.
p
Print basic estimation results.
Examples
equation eq1.ls m1 c uemp inf(0 to -4) @trend(1960:1)
estimates a linear regression of M1 on a constant, UEMP, INF (from current up to four lags), and a linear trend.
equation eq2.ls(z) d(tbill) c inf @seas(1) @seas(1)*inf ma(2)
regresses the first difference of TBILL on a constant, INF, a seasonal dummy, and an interaction of the dummy and INF, with an MA(2) error. The “z” option turns off backcasting.
coef(2) beta
param beta(1) .2 beta(2) .5 c(1) 0.1
equation eq3.ls(cov=white) q = beta(1)+beta(2)*(l^c(1) + k^(1-c(1)))
estimates the nonlinear regression starting from the specified initial values. The “cov=white” option reports heteroskedasticity consistent standard errors.
equation eq4.ls r = c(1)+c(2)*r(-1)+div(-1)^c(3)
sym betacov = eq4.@cov
declares and estimates a nonlinear equation and stores the coefficient covariance matrix in a symmetric matrix called BETACOV.
equation eq5.ls(cx=f, per=f) n w k ys c
estimates the equation EQ5 in the panel workfile using both cross-section and period fixed effects.
equation eq6.ls(cx=f, wgt=cxdiag) n w k ys c
estimates the equation EQ6 in a panel workfile with cross-section weights and fixed effects.
Cross-references
“Basic Regression Analysis” and “Additional Regression Tools” discuss the various regression methods in greater depth.
“Special Expression Reference”describes special terms that may be used in ls specifications.
See “Panel Estimation”for a discussion of panel equation estimation.