- •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
Chapter 13. Statistical Graphs from Series and Groups
EViews provides several methods for exploratory data analysis. In Chapter 11, “Series”, on page 309 we document several graph views that may be used to characterize the distribution of a series. This chapter describes bivariate scatterplot views which allow you to fit lines using parametric, and nonparametric procedures, and boxplot views which may be used to characterize the distribution of your data.
These views, some of which involve relatively complicated calculations or have a number of specialized options, are documented in detail below. While the discussion may sometimes involves fairly technical issues, you should not feel as though you need to master all of the details to use these views. The graphs correspond to familiar concepts, and are designed to be simple and easy to understand visual displays of your data. The EViews default settings should be sufficient for all but the most specialized of analyses. Feel free to explore each of the views, clicking on OK to accept the default settings.
Distribution Graphs of Series
The view menu of a series lists three graphs that characterize the empirical distribution of
the series under View/Distribution...
CDF-Survivor-Quantile
This view plots the empirical cumulative distribution, survivor, and quantile functions of the series together with the plus or
minus two standard error bands. Select View/Distribution Graphs/CDF-Survivor-Quan- tile…
•The Cumulative Distribution option plots the empirical cumulative distribution function (CDF) of the series. The CDF is the probability of observing a value from the series not exceeding a specified value r :
Fx(r) = Pr(x ≤ r ) . |
(13.1) |
392—Chapter 13. Statistical Graphs from Series and Groups
•The Survivor option plots the empirical survivor function of the series. The survivor function gives the probability of observing a value from the series at least as large as some specified value r and is equal to one minus the CDF:
Sx( r) = Pr( x > r) = 1 − Fx( r) |
(13.2) |
•The Quantile option plots the empirical quantiles of the series. For 0 < q < 1 , the q -th quantile x(q) of x is a number such that:
Pr( x ≤ x(q)) ≤ q
(13.3)
Pr( x ≥ x(q)) ≤ 1 − q
The quantile is the inverse function of the CDF; graphically, the quantile can be obtained by flipping the horizontal and vertical axis of the CDF.
• The All option plots the CDF, survivor, and quantiles.
For example, working with the series LWAGE containing log wage data, and selecting a CDF plot yields:
Probability
Empirical CDF
1.0
0.8
0.6
0.4
0.2
0.0
0.8 |
1.2 |
1.6 |
2.0 |
2.4 |
2.8 |
3.2 |
3.6 |
4.0 |
4.4 |
|
|
|
Log of hourly wage |
|
|
|
Standard Errors
The Include standard errors option plots the approximate 95% confidence intervals together with the empirical distribution functions. The methodology for computing these intervals is described in detail in Conover (1980, pp. 114–116). Note that using this approach, we do not compute confidence intervals for the quantiles corresponding to the first and last few order statistics.
Distribution Graphs of Series—393
Saved matrix name
This optional edit field allows you to save the results in a matrix object. See cdfplot (p. 235) of the Command and Programming Reference for details on the structure of the saved matrix.
Options
EViews provides several methods of computing the empirical CDF used in the CDF and quantile computations:
Given a total of N observations, the CDF for value r is estimated as:
Rankit (default) |
( r − 1 ⁄ 2 ) ⁄ N |
|
|
Ordinary |
r ⁄ N |
|
|
Van der Waerden |
r ⁄ ( N + 1 ) |
|
|
Blom |
( r − 3 ⁄ 8) ⁄ ( N + 1 ⁄ 4) |
|
|
Tukey |
( r − 1 ⁄ 3) ⁄ ( N + 1 ⁄ 3) |
|
|
The various methods differ in how they adjust for non-continuity in the CDF computation. The differences between these alternatives will become negligible as the sample size N grows.
Quantile-Quantile
The quantile-quantile (QQ)-plot is a simple yet powerful tool for comparing two distributions (Cleveland, 1994). This view plots the quantiles of the chosen series against the quantiles of another series or a theoretical distribution. If the two distributions are the same, the QQ-plot should lie on a straight line. If the QQ-plot does not lie on a straight line, the two distributions differ along some dimension. The pattern of deviation from linearity provides an indication of the nature of the mismatch.
394—Chapter 13. Statistical Graphs from Series and Groups
To generate a QQ-plot, select View/Distribution Graphs/Quantile-Quantile…You can plot against the quantiles of the following theoretical distributions:
•Normal. Bell-shaped and symmetric distribution.
•Uniform. Rectangular density function. Equal probabilities associated with any fixed interval size in the support.
•Exponential. The unit exponential is a positively skewed distribution with a long right tail.
•Logistic. This symmetric distribution is similar to the normal, except that it has longer tails than the normal.
•Extreme value. The Type-I (minimum) extreme value is a negatively skewed distribution with a long left tail—it is very close to a lognormal distribution.
You can also plot against the quantiles of any series in your workfile. Type the names of the series or groups in the edit box, and select Series or Group. EViews will compute a QQ-plot against each series in the list. You can use this option to plot against the quantiles of a simulated series from any distribution; see the example below.
The checkbox provides you with the option of plotting a regression line through the quantile values.
The Options button provides you with several methods for computing the empirical quantiles. The options are explained in the CDF-Survivor-Quantile section above; the choice should not make much difference unless the sample is very small.
For additional details, see Cleveland (1994), or Chambers, et al. (1983, Chapter 6).
Illustration
Labor economists typically estimate wage earnings equations with the log of wage on the left-hand side instead of the wage itself. This is because the log of wage has a distribution more close to the normal than the wage, and classical small sample inference procedures are more likely to be valid. To check this claim, we can plot the quantiles of the wage and log of wage against those from the normal distribution. Highlight the series, double click, select View/Distribution Graphs/Quantile-Quantile…, and choose the (default) Normal distribution option:
Distribution Graphs of Series—395
Theoretical Quantile-Quantile |
Theoretical Quantile-Quantile |
|
8 |
|
|
|
|
|
|
|
|
4 |
|
|
|
|
|
|
|
|
|
|
6 |
|
|
|
|
|
|
|
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
Quantile |
4 |
|
|
|
|
|
|
|
Quantile |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
2 |
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
|
|
||
Normal |
0 |
|
|
|
|
|
|
|
Normal |
-1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
-2 |
|
|
|
|
|
|
|
|
|
|
-2 |
|
|
|
|
|
|
|
|
-3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-4 |
|
|
|
|
|
|
|
|
-4 |
|
|
|
|
|
|
|
|
|
|
0 |
10 |
20 |
30 |
40 |
50 |
60 |
70 |
|
0.8 |
1.2 |
1.6 |
2.0 |
2.4 |
2.8 |
3.2 |
3.6 |
4.0 |
4.4 |
|
|
|
|
Hourly wage |
|
|
|
|
|
|
|
Log of hourly wage |
|
|
|
If the distributions of the series on the vertical and horizontal axes match, the plots should lie on a straight line. The two plots clearly indicate that the log of wage has a distribution closer to the normal than the wage.
The concave shape of the QQ-plot for the wage indicates that the distribution of the wage series is positively skewed with a long right tail. If the shape were convex, it would indicate that the distribution is negatively skewed.
The QQ-plot for the log of wage falls nearly on a straight line except at the left end, where the plot curves downward. QQ-plots that fall on a straight line in the middle but curve upward at the left end and curve downward at the right end indicate that the distribution is leptokurtic and has a thicker tail than the normal distribution. If the plot curves downward at the left, and upward at the right, it is an indication that the distribution is platykurtic and has a thinner tail than the normal distribution. Here, it appears that log wages are somewhat platykurtic.
If you want to compare your series with a distribution not in the option list, you can use the random number generator in EViews and plot against the quantiles of the simulated series from the distribution. For example, suppose we wanted to compare the distribution of the log of wage with the F-distribution with 10 numerator degrees of freedom and 50 denominator degrees of freedom. First generate a random draw from an F(10,50) distribution using the command:
series fdist=@rfdist(10,50)
Then highlight the log of wage series, double click, select View/Distribution Graphs/ Quantile-Quantile…, and choose the Series or Group option and type in the name of the simulated series (in this case fdist).
396—Chapter 13. Statistical Graphs from Series and Groups
The plot is slightly convex, indicating that the distribution of the log of wage is slightly negatively skewed compared to the F(10,50).
Kernel Density
This view plots the kernel density estimate of the distribution of the series. The simplest nonparametric density estimate of a distribution of a series is the histogram. You can view the histogram by selecting View/Descriptive Statistics/Histogram and Stats. The histogram, however, is sensitive to the choice of origin and is not continuous.
Empirical Quantile-Quantile
|
4 |
|
|
|
|
|
|
|
|
|
|
3 |
|
|
|
|
|
|
|
|
|
FDIST |
2 |
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
|
|
|
-1 |
|
|
|
|
|
|
|
|
|
|
0.8 |
1.2 |
1.6 |
2.0 |
2.4 |
2.8 |
3.2 |
3.6 |
4.0 |
4.4 |
|
|
|
|
Log of hourly w age |
|
|
|
The kernel density estimator replaces the
“boxes” in a histogram by “bumps” that are smooth (Silverman 1986). Smoothing is done by putting less weight on observations that are further from the point being evaluated. More technically, the kernel density estimate of a series X at a point x is estimated by:
1 |
N |
|
|
x − Xi |
|
|
|
K |
, |
(13.4) |
|||
f(x) = -------- |
Σ |
--------------- |
||||
Nh |
|
|
h |
|
|
|
|
i = 1 |
|
|
|
|
|
where N is the number of observations, h is the bandwidth (or smoothing parameter) and K is a kernel weighting function that integrates to one.
When you choose View/Distribution Graphs/Kernel Density…, the Kernel Density dialog appears:
To display the kernel density estimates, you need to specify the following:
•Kernel. The kernel function is a weighting function that determines the shape of the bumps. EViews provides the following options for the kernel function K :
Distribution Graphs of Series—397
Epanechnikov (default) |
3 |
( 1 − u |
|
2 |
) I( |
|
u |
|
≤ 1 ) |
||||||||||||
|
-- |
|
|
|
|
|
|
||||||||||||||
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
Triangular |
( 1 − |
u |
) ( I( |
u |
≤ 1) ) |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Uniform (Rectangular) |
|
1 |
( I( |
|
u |
|
≤ 1 )) |
||||||||||||||
|
|
-- |
|
|
|||||||||||||||||
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Normal (Gaussian) |
|
1 |
|
|
|
|
|
|
|
|
1 |
|
|
2 |
|||||||
|
|
---------- exp |
− --u |
||||||||||||||||||
|
|
2 π |
|
|
|
|
|
|
|
2 |
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Biweight (Quartic) |
15 |
( 1 − u |
2 |
) |
2 |
|
|
|
|
|
u |
|
≤ 1 ) |
||||||||
|
----- |
|
|
|
|
I( |
|
||||||||||||||
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Triweight |
35 |
( 1 − u |
2 |
) |
3 |
|
|
|
|
|
u |
|
≤ 1 ) |
||||||||
|
----- |
|
|
|
|
I( |
|
||||||||||||||
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cosinus |
π |
|
π |
|
|
|
|
|
|
|
( |
|
u |
|
|
≤ 1 ) |
|||||
|
-- cos |
--u I |
|
|
|
||||||||||||||||
|
4 |
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
where u is the argument of the kernel function and I is the indicator function that takes a value of one if its argument is true, and zero otherwise.
•Bandwidth. The bandwidth h controls the smoothness of the density estimate; the larger the bandwidth, the smoother the estimate. Bandwidth selection is of crucial importance in density estimation (Silverman, 1986), and various methods have been suggested in the literature. The Silverman option (default) uses a data-based automatic bandwidth:
h = 0.9kN−1 ⁄ 5min( s, R ⁄ 1.34 ) |
(13.5) |
where N is the number of observations, s is the standard deviation, and R is the interquartile range of the series (Silverman 1986, equation 3.31). The factor k is a canonical bandwidth-transformation that differs across kernel functions (Marron and Nolan 1989; Härdle 1991). The canonical bandwidth-transformation adjusts the bandwidth so that the automatic density estimates have roughly the same amount of smoothness across various kernel functions.
To specify a bandwidth of your choice, mark User Specified option and type a nonnegative number for the bandwidth in the field box. Although there is no general rule for the appropriate choice of the bandwidth, Silverman (1986, section 3.4) makes a case for undersmoothing by choosing a somewhat small bandwidth, since it is easier for the eye to smooth than it is to unsmooth.
398—Chapter 13. Statistical Graphs from Series and Groups
The Bracket Bandwidth option allows you to investigate the sensitivity of your estimates to variations in the bandwidth. If you choose to bracket the bandwidth, EViews plots three density estimates using bandwidths 0.5h , h , and 1.5h .
•Number of Points. You must specify the number of points M at which you will evaluate the density function. The default is M = 100 points. Suppose the mini-
mum and maximum value to be considered are given by XL and XU , respectively. |
|||
Then f( x) is evaluated at M equi-spaced points given by: |
|
||
xi = XL + i |
XU − XL |
(13.6) |
|
--------------------- , for i = 0, 1, … M − 1 . |
|||
|
M |
|
|
EViews selects the lower and upper evaluation points by extending the minimum and maximum values of the data by two (for the normal kernel) or one (for all other kernels) bandwidth units.
•Method. By default, EViews utilizes the Linear Binning approximation algorithm of Fan and Marron (1994) to limit the number of evaluations required in computing the density estimates. For large samples, the computational savings are substantial.
The Exact option evaluates the density function using all of the data points for each
Xj , j = 1, 2, …, N for each xi . The number of kernel evaluations is therefore of order O( NM) , which, for large samples, may be quite time-consuming.
Unless there is a strong reason to compute the exact density estimate or unless your sample is very small, we recommend that you use the binning algorithm.
•Saved matrix name. This optional edit field allows you to save the results in a matrix object. See kdensity (p. 328) in the Command and Programming Reference for details on the structure of the saved matrix.
Illustration
As an illustration of kernel density estimation, we use the three month CD rate data for 69 Long Island banks and thrifts used in Simonoff (1996). The histogram of the CD rate looks as follows:
Distribution Graphs of Series—399
14 |
|
|
|
|
|
|
12 |
|
|
|
|
|
|
10 |
|
|
|
|
|
|
8 |
|
|
|
|
|
|
6 |
|
|
|
|
|
|
4 |
|
|
|
|
|
|
2 |
|
|
|
|
|
|
0 |
|
|
|
|
|
|
7.6 |
7.8 |
8.0 |
8.2 |
8.4 |
8.6 |
8.8 |
Series: CDRATE
Sample 1 69
Observations 69
Mean |
8.264203 |
Median |
8.340000 |
Maximum |
8.780000 |
Minimum |
7.510000 |
Std. Dev. |
0.298730 |
Skewness |
-0.608449 |
Kurtosis |
2.710969 |
Jarque-Bera |
4.497587 |
Probability |
0.105526 |
This histogram is a very crude estimate of the distribution of CD rates and does not provide us with much information about the underlying distribution. To view the kernel density estimate, select View/Distribution Graphs/Kernel Density… The default options produced the following view:
Kernel Density (Epanechnikov, h = 0.25)
1.6 |
|
|
|
|
|
|
|
|
1.4 |
|
|
|
|
|
|
|
|
1.2 |
|
|
|
|
|
|
|
|
1.0 |
|
|
|
|
|
|
|
|
0.8 |
|
|
|
|
|
|
|
|
0.6 |
|
|
|
|
|
|
|
|
0.4 |
|
|
|
|
|
|
|
|
0.2 |
|
|
|
|
|
|
|
|
0.0 |
|
|
|
|
|
|
|
|
7.4 |
7.6 |
7.8 |
8.0 |
8.2 |
8.4 |
8.6 |
8.8 |
9.0 |
|
|
|
CDRATE |
|
|
|
|
This density estimate seems to be oversmoothed. Simonoff (1996, chapter 3) uses a Gaussian kernel with bandwidth 0.08. To replicate his results, select View/Distribution Graphs/ Kernel Density… and fill in the dialog box as follows: