- •Table of Contents
- •What’s New in EViews 5.0
- •What’s New in 5.0
- •Compatibility Notes
- •EViews 5.1 Update Overview
- •Overview of EViews 5.1 New Features
- •Preface
- •Part I. EViews Fundamentals
- •Chapter 1. Introduction
- •What is EViews?
- •Installing and Running EViews
- •Windows Basics
- •The EViews Window
- •Closing EViews
- •Where to Go For Help
- •Chapter 2. A Demonstration
- •Getting Data into EViews
- •Examining the Data
- •Estimating a Regression Model
- •Specification and Hypothesis Tests
- •Modifying the Equation
- •Forecasting from an Estimated Equation
- •Additional Testing
- •Chapter 3. Workfile Basics
- •What is a Workfile?
- •Creating a Workfile
- •The Workfile Window
- •Saving a Workfile
- •Loading a Workfile
- •Multi-page Workfiles
- •Addendum: File Dialog Features
- •Chapter 4. Object Basics
- •What is an Object?
- •Basic Object Operations
- •The Object Window
- •Working with Objects
- •Chapter 5. Basic Data Handling
- •Data Objects
- •Samples
- •Sample Objects
- •Importing Data
- •Exporting Data
- •Frequency Conversion
- •Importing ASCII Text Files
- •Chapter 6. Working with Data
- •Numeric Expressions
- •Series
- •Auto-series
- •Groups
- •Scalars
- •Chapter 7. Working with Data (Advanced)
- •Auto-Updating Series
- •Alpha Series
- •Date Series
- •Value Maps
- •Chapter 8. Series Links
- •Basic Link Concepts
- •Creating a Link
- •Working with Links
- •Chapter 9. Advanced Workfiles
- •Structuring a Workfile
- •Resizing a Workfile
- •Appending to a Workfile
- •Contracting a Workfile
- •Copying from a Workfile
- •Reshaping a Workfile
- •Sorting a Workfile
- •Exporting from a Workfile
- •Chapter 10. EViews Databases
- •Database Overview
- •Database Basics
- •Working with Objects in Databases
- •Database Auto-Series
- •The Database Registry
- •Querying the Database
- •Object Aliases and Illegal Names
- •Maintaining the Database
- •Foreign Format Databases
- •Working with DRIPro Links
- •Part II. Basic Data Analysis
- •Chapter 11. Series
- •Series Views Overview
- •Spreadsheet and Graph Views
- •Descriptive Statistics
- •Tests for Descriptive Stats
- •Distribution Graphs
- •One-Way Tabulation
- •Correlogram
- •Unit Root Test
- •BDS Test
- •Properties
- •Label
- •Series Procs Overview
- •Generate by Equation
- •Resample
- •Seasonal Adjustment
- •Exponential Smoothing
- •Hodrick-Prescott Filter
- •Frequency (Band-Pass) Filter
- •Chapter 12. Groups
- •Group Views Overview
- •Group Members
- •Spreadsheet
- •Dated Data Table
- •Graphs
- •Multiple Graphs
- •Descriptive Statistics
- •Tests of Equality
- •N-Way Tabulation
- •Principal Components
- •Correlations, Covariances, and Correlograms
- •Cross Correlations and Correlograms
- •Cointegration Test
- •Unit Root Test
- •Granger Causality
- •Label
- •Group Procedures Overview
- •Chapter 13. Statistical Graphs from Series and Groups
- •Distribution Graphs of Series
- •Scatter Diagrams with Fit Lines
- •Boxplots
- •Chapter 14. Graphs, Tables, and Text Objects
- •Creating Graphs
- •Modifying Graphs
- •Multiple Graphs
- •Printing Graphs
- •Copying Graphs to the Clipboard
- •Saving Graphs to a File
- •Graph Commands
- •Creating Tables
- •Table Basics
- •Basic Table Customization
- •Customizing Table Cells
- •Copying Tables to the Clipboard
- •Saving Tables to a File
- •Table Commands
- •Text Objects
- •Part III. Basic Single Equation Analysis
- •Chapter 15. Basic Regression
- •Equation Objects
- •Specifying an Equation in EViews
- •Estimating an Equation in EViews
- •Equation Output
- •Working with Equations
- •Estimation Problems
- •Chapter 16. Additional Regression Methods
- •Special Equation Terms
- •Weighted Least Squares
- •Heteroskedasticity and Autocorrelation Consistent Covariances
- •Two-stage Least Squares
- •Nonlinear Least Squares
- •Generalized Method of Moments (GMM)
- •Chapter 17. Time Series Regression
- •Serial Correlation Theory
- •Testing for Serial Correlation
- •Estimating AR Models
- •ARIMA Theory
- •Estimating ARIMA Models
- •ARMA Equation Diagnostics
- •Nonstationary Time Series
- •Unit Root Tests
- •Panel Unit Root Tests
- •Chapter 18. Forecasting from an Equation
- •Forecasting from Equations in EViews
- •An Illustration
- •Forecast Basics
- •Forecasting with ARMA Errors
- •Forecasting from Equations with Expressions
- •Forecasting with Expression and PDL Specifications
- •Chapter 19. Specification and Diagnostic Tests
- •Background
- •Coefficient Tests
- •Residual Tests
- •Specification and Stability Tests
- •Applications
- •Part IV. Advanced Single Equation Analysis
- •Chapter 20. ARCH and GARCH Estimation
- •Basic ARCH Specifications
- •Estimating ARCH Models in EViews
- •Working with ARCH Models
- •Additional ARCH Models
- •Examples
- •Binary Dependent Variable Models
- •Estimating Binary Models in EViews
- •Procedures for Binary Equations
- •Ordered Dependent Variable Models
- •Estimating Ordered Models in EViews
- •Views of Ordered Equations
- •Procedures for Ordered Equations
- •Censored Regression Models
- •Estimating Censored Models in EViews
- •Procedures for Censored Equations
- •Truncated Regression Models
- •Procedures for Truncated Equations
- •Count Models
- •Views of Count Models
- •Procedures for Count Models
- •Demonstrations
- •Technical Notes
- •Chapter 22. The Log Likelihood (LogL) Object
- •Overview
- •Specification
- •Estimation
- •LogL Views
- •LogL Procs
- •Troubleshooting
- •Limitations
- •Examples
- •Part V. Multiple Equation Analysis
- •Chapter 23. System Estimation
- •Background
- •System Estimation Methods
- •How to Create and Specify a System
- •Working With Systems
- •Technical Discussion
- •Vector Autoregressions (VARs)
- •Estimating a VAR in EViews
- •VAR Estimation Output
- •Views and Procs of a VAR
- •Structural (Identified) VARs
- •Cointegration Test
- •Vector Error Correction (VEC) Models
- •A Note on Version Compatibility
- •Chapter 25. State Space Models and the Kalman Filter
- •Background
- •Specifying a State Space Model in EViews
- •Working with the State Space
- •Converting from Version 3 Sspace
- •Technical Discussion
- •Chapter 26. Models
- •Overview
- •An Example Model
- •Building a Model
- •Working with the Model Structure
- •Specifying Scenarios
- •Using Add Factors
- •Solving the Model
- •Working with the Model Data
- •Part VI. Panel and Pooled Data
- •Chapter 27. Pooled Time Series, Cross-Section Data
- •The Pool Workfile
- •The Pool Object
- •Pooled Data
- •Setting up a Pool Workfile
- •Working with Pooled Data
- •Pooled Estimation
- •Chapter 28. Working with Panel Data
- •Structuring a Panel Workfile
- •Panel Workfile Display
- •Panel Workfile Information
- •Working with Panel Data
- •Basic Panel Analysis
- •Chapter 29. Panel Estimation
- •Estimating a Panel Equation
- •Panel Estimation Examples
- •Panel Equation Testing
- •Estimation Background
- •Appendix A. Global Options
- •The Options Menu
- •Print Setup
- •Appendix B. Wildcards
- •Wildcard Expressions
- •Using Wildcard Expressions
- •Source and Destination Patterns
- •Resolving Ambiguities
- •Wildcard versus Pool Identifier
- •Appendix C. Estimation and Solution Options
- •Setting Estimation Options
- •Optimization Algorithms
- •Nonlinear Equation Solution Methods
- •Appendix D. Gradients and Derivatives
- •Gradients
- •Derivatives
- •Appendix E. Information Criteria
- •Definitions
- •Using Information Criteria as a Guide to Model Selection
- •References
- •Index
- •Symbols
- •.DB? files 266
- •.EDB file 262
- •.RTF file 437
- •.WF1 file 62
- •@obsnum
- •Panel
- •@unmaptxt 174
- •~, in backup file name 62, 939
- •Numerics
- •3sls (three-stage least squares) 697, 716
- •Abort key 21
- •ARIMA models 501
- •ASCII
- •file export 115
- •ASCII file
- •See also Unit root tests.
- •Auto-search
- •Auto-series
- •in groups 144
- •Auto-updating series
- •and databases 152
- •Backcast
- •Berndt-Hall-Hall-Hausman (BHHH). See Optimization algorithms.
- •Bias proportion 554
- •fitted index 634
- •Binning option
- •classifications 313, 382
- •Boxplots 409
- •By-group statistics 312, 886, 893
- •coef vector 444
- •Causality
- •Granger's test 389
- •scale factor 649
- •Census X11
- •Census X12 337
- •Chi-square
- •Cholesky factor
- •Classification table
- •Close
- •Coef (coefficient vector)
- •default 444
- •Coefficient
- •Comparison operators
- •Conditional standard deviation
- •graph 610
- •Confidence interval
- •Constant
- •Copy
- •data cut-and-paste 107
- •table to clipboard 437
- •Covariance matrix
- •HAC (Newey-West) 473
- •heteroskedasticity consistent of estimated coefficients 472
- •Create
- •Cross-equation
- •Tukey option 393
- •CUSUM
- •sum of recursive residuals test 589
- •sum of recursive squared residuals test 590
- •Data
- •Database
- •link options 303
- •using auto-updating series with 152
- •Dates
- •Default
- •database 24, 266
- •set directory 71
- •Dependent variable
- •Description
- •Descriptive statistics
- •by group 312
- •group 379
- •individual samples (group) 379
- •Display format
- •Display name
- •Distribution
- •Dummy variables
- •for regression 452
- •lagged dependent variable 495
- •Dynamic forecasting 556
- •Edit
- •See also Unit root tests.
- •Equation
- •create 443
- •store 458
- •Estimation
- •EViews
- •Excel file
- •Excel files
- •Expectation-prediction table
- •Expected dependent variable
- •double 352
- •Export data 114
- •Extreme value
- •binary model 624
- •Fetch
- •File
- •save table to 438
- •Files
- •Fitted index
- •Fitted values
- •Font options
- •Fonts
- •Forecast
- •evaluation 553
- •Foreign data
- •Formula
- •forecast 561
- •Freq
- •DRI database 303
- •F-test
- •for variance equality 321
- •Full information maximum likelihood 698
- •GARCH 601
- •ARCH-M model 603
- •variance factor 668
- •system 716
- •Goodness-of-fit
- •Gradients 963
- •Graph
- •remove elements 423
- •Groups
- •display format 94
- •Groupwise heteroskedasticity 380
- •Help
- •Heteroskedasticity and autocorrelation consistent covariance (HAC) 473
- •History
- •Holt-Winters
- •Hypothesis tests
- •F-test 321
- •Identification
- •Identity
- •Import
- •Import data
- •See also VAR.
- •Index
- •Insert
- •Instruments 474
- •Iteration
- •Iteration option 953
- •in nonlinear least squares 483
- •J-statistic 491
- •J-test 596
- •Kernel
- •bivariate fit 405
- •choice in HAC weighting 704, 718
- •Kernel function
- •Keyboard
- •Kwiatkowski, Phillips, Schmidt, and Shin test 525
- •Label 82
- •Last_update
- •Last_write
- •Latent variable
- •Lead
- •make covariance matrix 643
- •List
- •LM test
- •ARCH 582
- •for binary models 622
- •LOWESS. See also LOESS
- •in ARIMA models 501
- •Mean absolute error 553
- •Metafile
- •Micro TSP
- •recoding 137
- •Models
- •add factors 777, 802
- •solving 804
- •Mouse 18
- •Multicollinearity 460
- •Name
- •Newey-West
- •Nonlinear coefficient restriction
- •Wald test 575
- •weighted two stage 486
- •Normal distribution
- •Numbers
- •chi-square tests 383
- •Object 73
- •Open
- •Option setting
- •Option settings
- •Or operator 98, 133
- •Ordinary residual
- •Panel
- •irregular 214
- •unit root tests 530
- •Paste 83
- •PcGive data 293
- •Polynomial distributed lag
- •Pool
- •Pool (object)
- •PostScript
- •Prediction table
- •Principal components 385
- •Program
- •p-value 569
- •for coefficient t-statistic 450
- •Quiet mode 939
- •RATS data
- •Read 832
- •CUSUM 589
- •Regression
- •Relational operators
- •Remarks
- •database 287
- •Residuals
- •Resize
- •Results
- •RichText Format
- •Robust standard errors
- •Robustness iterations
- •for regression 451
- •with AR specification 500
- •workfile 95
- •Save
- •Seasonal
- •Seasonal graphs 310
- •Select
- •single item 20
- •Serial correlation
- •theory 493
- •Series
- •Smoothing
- •Solve
- •Source
- •Specification test
- •Spreadsheet
- •Standard error
- •Standard error
- •binary models 634
- •Start
- •Starting values
- •Summary statistics
- •for regression variables 451
- •System
- •Table 429
- •font 434
- •Tabulation
- •Template 424
- •Tests. See also Hypothesis tests, Specification test and Goodness of fit.
- •Text file
- •open as workfile 54
- •Type
- •field in database query 282
- •Units
- •Update
- •Valmap
- •find label for value 173
- •find numeric value for label 174
- •Value maps 163
- •estimating 749
- •View
- •Wald test 572
- •nonlinear restriction 575
- •Watson test 323
- •Weighting matrix
- •heteroskedasticity and autocorrelation consistent (HAC) 718
- •kernel options 718
- •White
- •Window
- •Workfile
- •storage defaults 940
- •Write 844
- •XY line
- •Yates' continuity correction 321
758—Chapter 25. State Space Models and the Kalman Filter
may be evaluated using the Kalman filter. Using numeric derivatives, standard iterative techniques may be employed to maximize the likelihood with respect to the unknown parameters θ (see Appendix C, “Estimation and Solution Options”, on page 956).
Initial Conditions
Evaluation of the Kalman filter, smoother, and forecasting procedures all require that we provide the initial one-step ahead predicted values for the states α1 0 and variance matrix P1 0 . With some stationary models, steady-state conditions allow us to use the system matrices to solve for the values of α1 0 and P1 0 . In other cases, we may have preliminary estimates of α1 0 , along with measures of uncertainty about those estimates. But in many cases, we may have no information, or diffuse priors, about the initial conditions.
Specifying a State Space Model in EViews
EViews handles a wide range of single and multiple-equation state space models, providing you with detailed control over the specification of your system equations, covariance matrices, and initial conditions.
The first step in specifying and estimating a state space model is to create a state space object. Select Object/New Object.../Sspace from the main toolbar or type sspace in the command window. EViews will create a state space object and open an empty state space specification window.
There are two ways to specify your state space model. The easiest is to use EViews’ special “auto-specification” features to guide you in creating some of the standard forms for these models. Simply press the AutoSpec button on the sspace object toolbar. Specialized dialogs will open to guide you through the specification process. We will describe this method in greater detail in “Auto-Specification” on page 766.
The more general method of describing your state space model uses keywords and text to describe the signal equations, state equations, error structure, initial conditions, and if desired, parameter starting values for estimation. The next section describes the general syntax for the state space object.
Specification Syntax
State Equations
A state equation contains the “@STATE” keyword followed by a valid state equation specification. Bear in mind that:
•Each equation must have a unique dependent variable name; expressions are not allowed. Since EViews does not automatically create workfile series for the states, you may use the name of an existing (non-series) EViews object.
Specifying a State Space Model in EViews—759
•State equations may not contain signal equation dependent variables, or leads or lags of these variables.
•Each state equation must be linear in the one-period lag of the states. Nonlinearities in the states, or the presence of contemporaneous, lead, or multi-period lag states will generate an error message. We emphasize the point that the one-period lag restriction on states is not restrictive since higher order lags may be written as new state variables. An example of this technique is provided in the example “ARMAX(2, 3) with a Random Coefficient” on page 762.
•State equations may contain exogenous variables and unknown coefficients, and may be nonlinear in these elements.
In addition, state equations may contain an optional error or error variance specification. If there is no error or error variance, the state equation is assumed to be deterministic. Specification of the error structure of state space models is described in greater detail in “Errors and Variances” on page 760.
Examples
The following two state equations define an unobserved error with an AR(2) process:
@state sv1 = c(2)*sv1(-1) + c(3)*sv2(-1) + [var = exp(c(5))]
@state sv2 = sv1(-1)
The first equation parameterizes the AR(2) for SV1 in terms of an AR(1) coefficient, C(2), and an AR(2) coefficient, C(3). The error variance specification is given in square brackets. Note that the state equation for SV2 defines the lag of SV1 so that SV2(-1) is the two period lag of SV1.
Similarly, the following are valid state equations:
@state sv1 = sv1(-1) + [var = exp(c(3))]
@state sv2 = c(1) + c(2)*sv2(-1) + [var = exp(c(3))]
@state sv3 = c(1) + exp(c(3)*x/z) + c(2)*sv3(-1) + [var = exp(c(3))]
describing a random walk, and an AR(1) with drift (without/with exogenous variables).
The following are not valid state equations:
@state exp(sv1) = sv1(-1) + [var = exp(c(3))] @state sv2 = log(sv2(-1)) + [var = exp(c(3))] @state sv3 = c(1) + c(2)*sv3(-2) + [var=exp(c(3))]
since they violate at least one of the conditions described above (in order: expression for dependent state variable, nonlinear in state, multi-period lag of state variables).
760—Chapter 25. State Space Models and the Kalman Filter
Observation/Signal Equations
By default, if an equation specification is not specifically identified as a state equation using the “@STATE” keyword, it will be treated by EViews as an observation or signal equation. Signal equations may also be identified explicitly by the keyword “@SIGNAL”. There are some aspects of signal equation specification to keep in mind:
•Signal equation dependent variables may involve expressions.
•Signal equations may not contain current values or leads of signal variables. You should be aware that any lagged signals are treated as predetermined for purposes of multi-step ahead forecasting (for discussion and alternative specifications, see Harvey 1989, pp. 367-368).
•Signal equations must be linear in the contemporaneous states. Nonlinearities in the states, or the presence of leads or lags of states will generate an error message. Again, the restriction that there are no state lags is not restrictive since additional deterministic states may be created to represent the lagged values of the states.
•Signal equations may have exogenous variables and unknown coefficients, and may be nonlinear in these elements.
Signal equations may also contain an optional error or error variance specification. If there is no error or error variance, the equation is assumed to be deterministic. Specification of the error structure of state space models is described in greater detail in “Errors and Variances” on page 760.
Examples
The following are valid signal equation specifications:
log(passenger) = c(1) + c(3)*x + sv1 + c(4)*sv2
@signal y = sv1 + sv2*x1 + sv3*x2 + sv4*y(-1) + [var=exp(c(1))] z = sv1 + sv2*x1 + sv3*x2 + c(1) + [var=exp(c(2))]
The following are invalid equations:
log(passenger) = c(1) + c(3)*x + sv1(-1) @signal y = sv1*sv2*x1 + [var = exp(c(1))]
z = sv1 + sv2*x1 + z(1) + c(1) + [var = exp(c(2))]
since they violate at least one of the conditions described above (in order: lag of state variable, nonlinear in a state variable, lead of signal variable).
Errors and Variances
While EViews always adds an implicit error term to each equation in an equation or system object, the handling of error terms differs in a sspace object. In a sspace object, the
Specifying a State Space Model in EViews—761
equation specifications in a signal or state equation do not contain error terms unless specified explicitly.
The easiest way to add an error to a state space equation is to specify an implied error term using its variance. You can simply add an error variance expression, consisting of the keyword “VAR” followed by an assignment statement (all enclosed in square brackets), to the existing equation:
@signal y = c(1) + sv1 + sv2 + [var = 1] @state sv1 = sv1(-1) + [var = exp(c(2))]
@state sv2 = c(3) + c(4)*sv2(-1) + [var = exp(c(2)*x)]
The specified variance may be a known constant value, or it can be an expression containing unknown parameters to be estimated. You may also build time-variation into the variances using a series expression. Variance expressions may not, however, contain state or signal variables.
While straightforward, this direct variance specification method does not admit correlation between errors in different equations (by default, EViews assumes that the covariance between error terms is 0). If you require a more flexible variance structure, you will need to use the “named error” approach to define named errors with variances and covariances, and then to use these named errors as parts of expressions in the signal and state equations.
The first step of this general approach is to define your named errors. You may declare a named error by including a line with the keyword “@ENAME” followed by the name of the error:
@ename e1
@ename e2
Once declared, a named error may enter linearly into state and signal equations. In this manner, one can build correlation between the equation errors. For example, the errors in the state and signal equations in the sspace specification:
y = c(1) + sv1*x1 + e1
@state sv1 = sv1(-1) + e2 + c(2)*e1
@ename e1
@ename e2
are, in general, correlated since the named error E1 appears in both equations.
In the special case where a named error is the only error in a given equation, you can both declare and use the named residual by adding an error expression consisting of the keyword “ENAME” followed by an assignment and a name identifier:
762—Chapter 25. State Space Models and the Kalman Filter
y = c(1) + sv1*x1 + [ename = e1]
@state sv1 = sv1(-1) + [ename = e2]
The final step in building a general error structure is to define the variances and covariances associated with your named errors. You should include a sspace line comprised of the keyword “@EVAR” followed by an assignment statement for the variance of the error or the covariance between two errors:
@evar cov(e1, e2) = c(2)
@evar var(e1) = exp(c(3))
@evar var(e2) = exp(c(4))*x
The syntax for the @EVAR assignment statements should be self-explanatory. Simply indicate whether the term is a variance or covariance, identify the error(s), and enter the specification for the variance or covariance. There should be a separate line for each named error covariance or variance that you wish to specify. If an error term is named, but there are no corresponding “VAR=” or @EVAR specifications, the missing variance or covariance specifications will remain at the default values of “NA” and “0”, respectively.
As you might expect, in the special case where an equation contains a single error term, you may combine the named error and direct variance assignment statements:
@state sv1 = sv1(-1) + [ename = e1, var = exp(c(3))] @state sv2 = sv2(-1) + [ename = e2, var = exp(c(4))] @evar cov(e1, e2) = c(5)
Specification Examples
ARMAX(2, 3) with a Random Coefficient
We can use the syntax described above to define an ARMAX(2,3) with a random coefficient for the regression variable X:
y = c(1) + |
sv5*x + sv1 + c(4)*sv2 + c(5)*sv3 + c(6)*sv4 |
|
@state sv1 |
= c(2)*sv1(-1) + c(3)*sv2(-1) + [var=exp(c(7))] |
|
@state sv2 |
= sv1(-1) |
|
@state sv3 |
= sv2(-1) |
|
@state sv4 |
= sv3(-1) |
|
@state sv5 |
= sv5(-1) |
+ [var=3] |
The AR coefficients are parameterized in terms of C(2) and C(3), while the MA coefficients are given by C(4), C(5) and C(6). The variance of the innovation is restricted to be a positive function of C(7). SV5 is the random coefficient on X, with variance restricted to be 3.
Specifying a State Space Model in EViews—763
Recursive and Random Coefficients
The following example describes a model with one random coefficient (SV1), one recursive coefficient (SV2), and possible correlation between the errors for SV1 and Y:
y = c(1) + sv1*x1 + sv2*x2 + [ename = e1, var = exp(c(2))] @state sv1 = sv1(-1) + [ename = e2, var = exp(c(3)*x)] @state sv2 = sv2(-1)
@evar cov(e1,e2) = c(4)
The variances and covariances in the model are parameterized in terms of the coefficients C(2), C(3) and C(4), with the variances of the observed Y and the unobserved state SV1 restricted to be non-negative functions of the parameters.
Parameter Starting Values
Unless otherwise instructed, EViews will initialize all parameters to the current values in the corresponding coefficient vector or vectors. As in the system object, you may override this default behavior by specifying explicitly the desired values of the parameters using a PARAM or @PARAM statement. For additional details, see “Starting Values” on page 703.
Specifying Initial Conditions
By default, EViews will handle the initial conditions for you. For some stationary models, steady-state conditions allow us to solve for the values of α0 and P0 . For cases where it is not possible to solve for the initial conditions, EViews will treat the initial values as diffuse, setting α1 0 = 0 , and P1 0 to an arbitrarily high number to reflect our uncertainty about the values (see “Technical Discussion” on page 775).
You may, however have prior information about the values of α1 0 and P1 0 . In this case, you can create a vector or matrix that contains the appropriate values, and use the “@MPRIOR” or “@VPRIOR” keywords to perform the assignment.
To set the initial states, enter “@MPRIOR” followed by the name of a vector object. The length of the vector object must match the state dimension. The order of elements should follow the order in which the states were introduced in the specification screen.
@mprior v1
@vprior m1
To set the initial state variance matrix, enter “@VPRIOR” followed by the name of a sym object (note that it must be a sym object, and not an ordinary matrix object). The dimensions of the sym must match the state dimension, with the ordering following the order in which the states appear in the specification. If you wish to set a specific element to be diffuse, simply assign the element the “NA” missing value. EViews will reset all of the corresponding variances and covariances to be diffuse.
764—Chapter 25. State Space Models and the Kalman Filter
For example, suppose you have a two equation state space object named SS1 and you want to set the initial values of the state vector and the state variance matrix as:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SV1 |
= |
1 |
, |
var |
SV1 |
= |
1 |
0.5 |
(25.17) |
|||||
SV2 |
|
0 |
|
|
SV2 |
|
0.5 |
2 |
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
First, create a named vector object, say SVEC0, to hold the initial values. Click Object/New Object, choose Matrix-Vector-Coef and enter the name SVEC0. Click OK, and then choose the type Vector and specify the size of the vector (in this case 2 rows). When you click OK, EViews will display the spreadsheet view of the vector SVEC0. Click the Edit +/– button to toggle on edit mode and type in the desired values. Then create a named matrix object, say SVAR0, in an analogous fashion.
Alternatively, you may find it easier to create and initialize the vector and matrix using commands. You can enter the following commands in the command window:
vector(2) svec0
svec0.fill 1, 0
matrix(2,2) svar0
svar0.fill(b=c) 1, 0.5, 0.5, 2
Then, simply add the lines:
@mprior svec0
@vprior svar0
to your sspace object by editing the specification window. Alternatively, you can type the following commands in the command window:
ss1.append @mprior svec0
ss1.append @vprior svar0
For more details on matrix objects and the fill and append commands, see Chapter 3, “Matrix Language”, on page 23 of the Command and Programming Reference.
Specification Views
State space models may be very complex. To aid you in examining your specification, EViews provides views which allow you to view the text specification in a more compact form, and to examine the numerical values of your system matrices evaluated at current parameter values.
Click on the View menu and select Specification... The following Specification views are always available, regardless of whether the sspace has previously been estimated:
Specifying a State Space Model in EViews—765
•Text Screen. This is the familiar text view of the specification. You should use this view when you create or edit the state space specification. This view may also be accessed by clicking on the Spec button on the sspace toolbar.
•Coefficient Description. Text descrip-
tion of the structure of your state space specification. The variables on the left-hand
side, representing αt + 1 and yt , are expressed as linear functions of the state variables αt , and a remainder term CONST. The elements of the matrix are the corresponding coefficients. For example, the ARMAX example has the following
Coefficient Description view:
•Covariance Description. Text description of the covariance matrix of the state space specification. For example, the ARMAX example has the following Covariance Description view:
766—Chapter 25. State Space Models and the Kalman Filter
•Coefficient Values. Numeric description of the structure of the signal and the state equations evaluated at current parameter values. If the system coefficient matrix is time-varying, EViews will prompt you for a date/observation at which to evaluate the matrix.
•Covariance Values. Numeric description of the structure of the state space specification evaluated at current parameter values. If the system covariance matrix is timevarying, EViews will prompt you for a date/observation at which to evaluate the matrix.
Auto-Specification
To aid you in creating a state space specification, EViews provides you with “auto-specifi- cation” tools which will create the text representation of a model that you specify using dialogs. This tool may be very useful if your model is a standard regression with fixed, recursive, and various random coefficient specifications, and/or your errors have a general ARMA structure.
Click on the AutoSpec button on the sspace toolbar, or select Proc/ Define State Space... from the menu. EViews opens a three tab dialog. The first tab is used to describe the basic regression portion of your specification. Enter the dependent variable, and any regressors which have fixed or recursive coefficients. You can choose which COEF object EViews uses for indicating unknowns when setting up the specification. At the bottom, you can specify an ARMA structure for your errors. Here, we have specified a simple ARMA(2,1) specification for LOG(PASSENGER).
Specifying a State Space Model in EViews—767
The second tab of the dialog is used to add any regressors which have random coefficients. Simply enter the appropriate regressors in each of the four edit fields. EViews allows you to define regressors with any combination of constant mean, AR(1), random walk, or random walk (with drift) coefficients.
Lastly, the Auto-Specification dialog allows you to choose between basic variance structures for your state space model. Click on the
Variance Specification tab, and choose between an identity matrix,
common diagonal (diagonal with common variances), diagonal, or general (unrestricted) variance matrix for the signals and for the states. The dialog also allows you to allow the signal equation(s) and state equations(s) to have non-zero error covariances.
We emphasize the fact that your sspace object is not restricted to the choices provided in this dialog. If you find that the set of specifications supported by Auto-Specification is too restrictive, you may use it the dialogs as a tool to build a basic specification, and then edit the specification to describe your model.
Estimating a State Space Model
Once you have specified a state space model and verified that your specification is correct, you are ready to estimate the model. To open the estimation dialog, simply click on the Estimate button on the toolbar or select Proc/Estimate…
As with other estimation objects, EViews allows you to set the estimation sample, the maximum number of iterations, convergence tolerance, the estimation algorithm, derivative settings and whether to display the starting values. The default settings should provide a good start for most problems; if you choose to change the settings, see “Setting Estimation Options” on page 951 for related discussion of estimation options. When you click on OK, EViews will begin estimation using the specified settings.
768—Chapter 25. State Space Models and the Kalman Filter
There are two additional things to keep in mind when estimating your model:
•Although the EViews Kalman filter routines will automatically handle any missing values in your sample, EViews does require that your estimation sample be contiguous, with no gaps between successive observations.
•If there are no unknown coefficients in your specification, you will still have to “estimate” your sspace to run the Kalman filter and initialize elements that EViews needs in order to perform further analysis.
Interpreting the estimation results
After you choose the variance options and click OK, EViews presents the estimation results in the state space window. For example, if we specify an ARMA(2,1) for the log of the monthly international airline passenger totals from January 1949 to December 1960 (from Box and Jenkins, 1976, series G, p. 531):
log(passenger) = c(1) + sv1 + c(4)*sv2
@state sv1 = c(2)*sv1(-1) + c(3)*sv2(-1) + [var=exp(c(5))]
@state sv2 = sv1(-1)
and estimate the model, EViews will open the estimation output view:
Sspace: SS_ARMA21
Estimation Method: Maximum Likelihood (Marquardt)
Date: 11/12/99 Time: 11:58
Sample: 1949M01 1960M12
Included observations: 144
Convergence achieved after 55 iterations
|
Coefficient |
Std. Error |
z-Statistic |
Prob. |
|
|
|
|
|
C(1) |
5.499767 |
0.257517 |
21.35687 |
0.0000 |
C(2) |
0.409013 |
0.167201 |
2.446239 |
0.0144 |
C(3) |
0.547165 |
0.164608 |
3.324055 |
0.0009 |
C(4) |
0.841481 |
0.100167 |
8.400800 |
0.0000 |
C(5) |
-4.589401 |
0.172696 |
-26.57501 |
0.0000 |
|
|
|
|
|
|
Final State |
Root MSE |
z-Statistic |
Prob. |
|
|
|
|
|
SV1 |
0.267125 |
0.100792 |
2.650274 |
0.0080 |
SV2 |
0.425488 |
0.000000 |
NA |
1.0000 |
|
|
|
|
|
Log likelihood |
124.3366 |
Parameters |
|
5 |
Akaike info criterion |
-1.629674 |
Likelihood observations |
144 |
|
Schwarz criterion |
-1.485308 |
Missing observations |
0 |
|
Hannan-Quinn criter. |
-1.571012 |
Partial observations |
0 |
|
|
|
Diffuse priors |
|
0 |
|
|
|
|
|
The bulk of the output view should be familiar from other EViews estimation objects. The information at the top describes the basics of the estimation: the name of the sspace object, estimation method, the date and time of estimation, sample and number of objects in the sample, convergence information, and the coefficient estimates. The bottom part of