Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Eviews5 / EViews5 / Docs / EViews 5 Users Guide.pdf
Скачиваний:
152
Добавлен:
23.03.2015
Размер:
11.51 Mб
Скачать

 

 

Working with Equations—455

 

 

 

 

Keywords that return vector or matrix objects

 

 

 

 

 

@coefcov

matrix containing the coefficient covariance matrix

 

 

 

 

 

 

@coefs

vector of coefficient values

 

 

 

 

 

 

@stderrs

vector of standard errors for the coefficients

 

 

 

 

 

 

@tstats

vector of t-statistic values for coefficients

 

 

 

 

 

See also “Equation” (p. 157) in the Command and Programming Reference.

Functions that return a vector or matrix object should be assigned to the corresponding object type. For example, you should assign the results from @tstats to a vector:

vector tstats = eq1.@tstats

and the covariance matrix to a matrix:

matrix mycov = eq1.@cov

You can also access individual elements of these statistics:

scalar pvalue = 1-@cnorm(@abs(eq1.@tstats(4)))

scalar var1 = eq1.@covariance(1,1)

For documentation on using vectors and matrices in EViews, see Chapter 3, “Matrix Language”, on page 23 of the Command and Programming Reference.

Working with Equations

Views of an Equation

Representations. Displays the equation in three forms: EViews command form, as an algebraic equation with symbolic coefficients, and as an equation with the estimated values of the coefficients.

You can cut-and-paste from the representations view into any application that supports the Windows clipboard.

Estimation Output. Displays the equation output results described above.

Actual, Fitted, Residual. These views display the

456—Chapter 15. Basic Regression

actual and fitted values of the dependent variable and the residuals from the regression in tabular and graphical form. Actual, Fitted, Residual Table displays these values in table form.

Note that the actual value is always the sum of the fitted value and the residual. Actual, Fitted, Residual Graph displays a standard EViews graph of the actual values, fitted values, and residuals.

Residual Graph plots only the residuals, while the

Standardized Residual

Graph plots the residuals divided by the estimated residual standard deviation.

ARMA structure.... Provides views which describe the estimated ARMA structure of your residuals. Details on these views are provided in “ARMA Structure” on

page 512.

Gradients and Derivatives.... Provides views which describe the gradients of the objective function and the information about the computation of any derivatives of the regression function. Details on these views are provided in Appendix D, “Gradients and Derivatives”, on page 963.

Covariance Matrix. Displays the covariance matrix of the coefficient estimates as a spreadsheet view. To save this covariance matrix as a matrix object, use the @cov function.

Coefficient Tests, Residual Tests, and Stability Tests. These are views for specification and diagnostic tests and are described in detail in Chapter 19, “Specification and Diagnostic Tests”, beginning on page 569.

Procedures of an Equation

Specify/Estimate…. Brings up the Equation Specification dialog box so that you can modify your specification. You can edit the equation specification, or change the estimation method or estimation sample.

Forecast…. Forecasts or fits values using the estimated equation. Forecasting using equations is discussed in Chapter 18, “Forecasting from an Equation”, on page 543.

Make Residual Series…. Saves the residuals from the regression as a series in the workfile. Depending on the estimation method, you may choose from three types of

Working with Equations—457

residuals: ordinary, standardized, and generalized. For ordinary least squares, only the ordinary residuals may be saved.

Make Regressor Group. Creates an untitled group comprised of all the variables used in the equation (with the exception of the constant).

Make Gradient Group. Creates a group containing the gradients of the objective function with respect to the coefficients of the model.

Make Derivative Group. Creates a group containing the derivatives of the regression function with respect to the coefficients in the regression function.

Make Model. Creates an untitled model containing a link to the estimated equation. This model can be solved in the usual manner. See Chapter 26, “Models”, on

page 777 for information on how to use models for forecasting and simulations.

Update Coefs from Equation. Places the estimated coefficients of the equation in the coefficient vector. You can use this procedure to initialize starting values for various estimation procedures.

Residuals from an Equation

The residuals from the default equation are stored in a series object called RESID. RESID may be used directly as if it were a regular series, except in estimation.

RESID will be overwritten whenever you estimate an equation and will contain the residuals from the latest estimated equation. To save the residuals from a particular equation for later analysis, you should save them in a different series so they are not overwritten by the next estimation command. For example, you can copy the residuals into a regular EViews series called RES1 by the command:

series res1 = resid

Even if you have already overwritten the RESID series, you can always create the desired series using EViews’ built-in procedures if you still have the equation object. If your equation is named EQ1, open the equation window and select Proc/Make Residual Series, or enter:

eq1.makeresid res1

to create the desired series.

Regression Statistics

You may refer to various regression statistics through the @-functions described above. For example, to generate a new series equal to FIT plus twice the standard error from the last regression, you can use the command:

458—Chapter 15. Basic Regression

series plus = fit + 2*eq1.@se

To get the t-statistic for the second coefficient from equation EQ1, you could specify

eq1.@tstats(2)

To store the coefficient covariance matrix from EQ1 as a named symmetric matrix, you can use the command:

sym ccov1 = eq1.@cov

See “Keywords that return scalar values” on page 454 for additional details.

Storing and Retrieving an Equation

As with other objects, equations may be stored to disk in data bank or database files. You can also fetch equations from these files.

Equations may also be copied-and-pasted to, or from, workfiles or databases.

EViews even allows you to access equations directly from your databases or another workfile. You can estimate an equation, store it in a database, and then use it to forecast in several workfiles.

See Chapter 4, “Object Basics”, beginning on page 73 and Chapter 10, “EViews Databases”, beginning on page 261 for additional information about objects, databases, and object containers.

Using Estimated Coefficients

The coefficients of an equation are listed in the representations view. By default, EViews will use the C coefficient vector when you specify an equation, but you may explicitly use other coefficient vectors in defining your equation.

These stored coefficients may be used as scalars in generating data. While there are easier ways of generating fitted values (see “Forecasting from an Equation” on page 543), for purposes of illustration, note that we can use the coefficients to form the fitted values from an equation. The command:

series cshat = eq1.c(1) + eq1.c(2)*gdp

forms the fitted value of CS, CSHAT, from the OLS regression coefficients and the independent variables from the equation object EQ1.

Note that while EViews will accept a series generating equation which does not explicitly refer to a named equation:

Working with Equations—459

series cshat = c(1) + c(2)*gdp

and will use the existing values in the C coefficient vector, we strongly recommend that you always use named equations to identify the appropriate coefficients. In general, C will contain the correct coefficient values only immediately following estimation or a coefficient update. Using a named equation, or selecting Proc/Update coefs from equation, guarantees that you are using the correct coefficient values.

An alternative to referring to the coefficient vector is to reference the @coefs elements of your equation (see page 454). For example, the examples above may be written as:

series cshat=eq1.@coefs(1)+eq1.@coefs(2)*gdp

EViews assigns an index to each coefficient in the order that it appears in the representations view. Thus, if you estimate the equation:

equation eq01.ls y=c(10)+b(5)*y(-1)+a(7)*inc

where B and A are also coefficient vectors, then:

eq01.@coefs(1) contains C(10)

eq01.@coefs(2) contains B(5)

eq01.@coefs(3) contains A(7)

This method should prove useful in matching coefficients to standard errors derived from the @stderrs elements of the equation (see Appendix A, “Object, View and Procedure Reference”, on page 153 of the Command and Programming Reference). The @coefs elements allow you to refer to both the coefficients and the standard errors using a common index.

If you have used an alternative named coefficient vector in specifying your equation, you can also access the coefficient vector directly. For example, if you have used a coefficient vector named BETA, you can generate the fitted values by issuing the commands:

equation eq02.ls cs=beta(1)+beta(2)*gdp

series cshat=beta(1)+beta(2)*gdp

where BETA is a coefficient vector. Again, however, we recommend that you use the @coefs elements to refer to the coefficients of EQ02. Alternatively, you can update the coefficients in BETA prior to use by selecting Proc/Update coefs from equation from the equation window. Note that EViews does not allow you to refer to the named equation coefficients EQ02.BETA(1) and EQ02.BETA(2). You must instead use the expressions, EQ02.@COEFS(1) and EQ02.@COEFS(2).

Соседние файлы в папке Docs