Object Reference : Object View and Procedure Reference : Equation
  
 
fit
Compute static forecasts or fitted values from an estimated equation.
When the regressor contains lagged dependent values or ARMA terms, fit uses the actual values of the dependent variable instead of the lagged fitted values. You may instruct fit to compare the forecasted data to actual data, and to compute forecast summary statistics.
Not available for equations estimated using ordered methods; use Equation::makemodel to create a model using the ordered equation results (see example below).
Syntax
eq_name.fit(options) yhat [y_se]
eq_name.fit(options) yhat [y_se y_var]
Following the fit keyword, you should type a name for the forecast series and, optionally, a name for the series containing the standard errors. For ARCH specifications, you may use the second form of the command, and optionally include a name for the conditional variance series.
Forecast standard errors are currently not available for binary, censored, and count models.
Options
Basic Options
 
d
In models with implicit dependent variables, forecast the entire expression rather than the normalized variable.
u
Substitute expressions for all auto-updating series in the equation.
g
Graph the fitted values together with the ±2 standard error bands.
ga
Graph the forecasts along with the actuals (if available).
e
Produce the forecast evaluation table.
i
Compute the fitted values of the index. Only for binary, censored and count models.
s
Ignore ARMA terms and use only the structural part of the equation to compute the fitted values.
n
Ignore coef uncertainty in standard error calculations that use them.
forcsmpl = smpl
Fit sample (optional). If forecast sample is not provided, the workfile sample will be employed.
f = arg (default= “actual”)
Out-of-fit-sample fill behavior: “actual” (fill observations outside the fit sample with actual values for the fitted variable), “na” (fill observations outside the fit sample with missing values).
prompt
Force the dialog to appear from within a program.
p
Print view.
Stochastic Options
Options for forecasting from a functional coefficients estimated equation.
 
stochastic = arg (default = “none”)
Stochastic method: “none” (none), “mca” (Monte Carlo –asymptotic), “mcbs” (Monte Carlo – bootstrap), “bs” (bootstrap).
reps = integer (default = 999)
Number of stochastic replications
lhr = arg (default = 0.1)
Lower historical range (number between 0 and upper historical range).
uhr = arg (default = 0.9)
Upper historical range (number between lower historical range and 1).
bsdep
Bootstrap only the dependent variable (not the functional coefficient variable).
Examples
equation eq1.ls cons c cons(-1) inc inc(-1)
eq1.fit c_hat c_se
genr c_up=c_hat+2*c_se
genr c_low=c_hat-2*c_se
line cons c_up c_low
The first line estimates a linear regression of CONS on a constant, CONS lagged once, INC, and INC lagged once. The second line stores the static forecasts and their standard errors as C_HAT and C_SE. The third and fourth lines compute the +/–2 standard error bounds. The fifth line plots the actual series together with the error bounds.
equation eq2.binary(d=l) y c wage edu
eq2.fit yf
eq2.fit(i) xbeta
genr yhat = 1-@clogit(-xbeta)
The first line estimates a logit specification for Y with a conditional mean that depends on a constant, WAGE, and EDU. The second line computes the fitted probabilities, and the third line computes the fitted values of the index. The fourth line computes the probabilities from the fitted index using the cumulative distribution function of the logistic distribution. Note that YF and YHAT should be identical.
Note that you cannot fit values from an ordered model. You must instead solve the values from a model. The following lines generate fitted probabilities from an ordered model:
equation eq3.ordered y c x z
eq3.makemodel(oprob1)
solve oprob1
The first line estimates an ordered probit of Y on a constant, X, and Z. The second line makes a model from the estimated equation with a name OPROB1. The third line solves the model and computes the fitted probabilities that each observation falls in each category.
Cross-references
To perform dynamic forecasting, use Equation::forecast. See Equation::makemodel and Model::solve for forecasting from systems of equations or ordered equations.
See “Forecasting from an Equation” for a discussion of forecasting in EViews and “Discrete and Limited Dependent Variable Models” for a discussion of forecasting from binary, censored, truncated, and count models.