An EViews Program to Run a Monte Carlo Experiment:
A DickeyFuller Distribution
Carlos Guerrero de Lizardi^{*}
JEL C15, C22, C87
Abstract
We present an Eviews program to run a Monte Carlo experiment. We use as example a DickeyFuller distribution. The proposed program is easier to put into practice than the code designed by, among others, Brooks (2002) or Fantazzini (2007). A short note about the Monte Carlo method is included. At the end we compare our critical values with the ones in Brooks (2002), Charemza and Deadman (1992), Enders (2004), and Patterson (2000).
An Eviews Program to Run a Monte Carlo Experiment:
a DickeyFuller Distribution
“But with this miraculous development of the ENIAC—along with the applications Stan must have been pondering—it occurred to him that statistical techniques should be resuscitated, and he discussed this idea with von Neumann. Thus was triggered the spark that led to the Monte Carlo method.” N. Metropolis (1987, p. 126).
A Monte Carlo experiment attempts to replicate an actual datagenerating process (DGP). The process is repeated numerous times so that the distribution of the desired parameters and sample statistics can be tabulated. Its reliability is warranted by the Law of Large Numbers: as the sample size grows sufficiently large, the sample statistic converges to the true one. Thus, the sample statistic is an unbiased estimate of the population one. The beauty of the simulation is that attributes of the constructed series are known to the researcher. It is wellknown that a limitation of a Monte Carlo experiment is that the results are specific to the assumptions used to generate the simulated data. For example, if you modify the sample size, include or delete an additional parameter, or use an alternative initial condition, a new simulation needs to be performed.^{1}
In order to generate a DickeyFuller distribution using a Monte Carlo approach, it is necessary to follow four steps:

Generate a sequence of (seudo) random numbers e_{t} based on a standard normal distribution.^{2}

Generate the sequence y_{t} = ρ*y_{t1} + e_{t} (eq. 1), where ρ = 1. With the intention of minimize the influence of y_{o}, its value is fixed to zero and T = 500.

Estimate the model ∆y_{t} = γ*y_{t1 }+ e_{t} (eq. 2), where γ = ρ1. Following Dickey and Fuller (1979, 1981), the “t”statistic will be recorded as . Obtain its distribution is our goal. According to Patterson (2000, p. 228), even though γ = 0 by construction, “the presence of e_{t} a random disturbance term, will prevent us from reaching this conclusion with certainty from a particular dataset”, that is, there will be a distribution of the with nonzero values occurring; if the estimation method is unbiased then this should be picked up if T is large enough “by an average of over the T samples equal to the value in the DGP”. About eq. 2 Charemza and Deadman (1997, p. 99) remind us that, because it is a regression of an I(0) variable on a I(1) variable, “not surprisingly, in such a case the tratio does not have a limiting normal distribution.”

Repeat steps 1 to 3. By the way, Dickey and Fuller (1979, 1981) obtained 100 values for e_{t}, set γ = 1, y_{0} = 0 and calculated, accordingly, 100 values for y_{t}.
The Eviews program to run the experiment is the following:
'Create a workfile undated, range 1 to 500.
!reps = 50000
for !i=1 to !reps
genr perturbacion{!i}=@nrnd
smpl 1 1
genr y{!i}=0
smpl 2 500
genr y{!i}=y{!i}(1)+perturbacion{!i}
smpl 1 500
matrix(!reps,2) resultados
equation eq{!i}.ls D(y{!i})=c(1)*y{!i}(1)
resultados(!i,1)=eq{!i}.@coefs(1)
resultados(!i,2)=eq{!i}.@tstats(1)
d perturbacion{!i}
d y{!i}
d eq{!i}
NEXT
'Export "resultados" to Excel.
'Create a workfile undated, range 1 to 50,000.
'Copy and paste from Excel to the workfile.
The critical values depend on the specification of the null and alternative hypotheses. The H_{o}: γ = 0 implying y_{t} = ρ*y_{t1} + e_{t} with ρ =1, that is, y_{t} is I(1). The alternative “should be chosen to maximize the power of the test in the likely direction of departure from the null. A twosided alternative γ ≠ 0, comprising γ > 0 and γ < 0 is not chosen in general because γ > 0 corresponds to ρ > 1 and in that case the process generating y_{t} is not stable; instead the oneside alternative H_{a}: γ < 0, that is ρ < 1, is chosen because departures from the null are expected to be in this direction corresponding to an I(0) process. Thus the critical values are negative, with sample values more negative than the critical values leading to rejection of the null hypothesis in the direction of the oneside alternative” (Patterson 2000, p. 228). The empirical distribution of our DickeyFuller statistic and its descriptive statistics are shown in the following figures:
Figure 1. Histogram and estimated densities of the DickeyFuller statistic
Figure 2. Descriptive statistics
It is clear that the simulated distribution is not like that of the tdistribution, which is symmetric and centered at zero. In Excel we sort from the highest values to the lowest ones. The value of 1.9359 is the average between the 2500th and 2501st lowest values in the 50,000 replications, and may be regarded as the critical value at the level of significance of 5%.
As a final point, in the following table we compare our results with those of Brooks (2002), Charemza y Deadman (1992), Enders (2004), and Patterson (2000).
Table 1. Critical values, DickeyFuller distribution

Sample size (T)

Replications


Brooks (2002)

1000

50,000

1.95

Charemza y Deadman (1992)

50

50,000

1.949

Enders (2004)

100

10,000

2.89

Patterson (2000)

500

25,000

1.943

References
Brooks, C. (2002), Introductory Econometrics for Finance, Cambridge University Press.
Charemza, W. W. and D. F. Deadman (1999), New Directions in Econometric Practice, Edward Elgar.
Davidson, R. and J. G. MacKinnon (1993), Estimation and Inference in Econometrics, Oxford University Press.
Dickey D. and W. A. Fuller (1981), “Likelihood ratio statistics for autoregressive time series with a unit root”, Econometrica 49, July, 105772.
Dickey, D. and W. A. Fuller (1979), “Distribution of the estimates for autoregressive time series with a unit root”, Journal of the American Statistical Association 72, June, 42731.
Enders, W. (2004), Applied Econometric Time Series, John Wiley&Sons.
Fantazzini, D. (2007), Econometrics I: OLS, University of Pavia, http://economia.unipv.it/pagp/pagine_personali/dean/slides%20E1_1_final.pdf.
Metropolis, N. (1987), Los Alamos Science, Special Issue: Stanislaw Ulam 19091984, pp. 12530.
Patterson, K. (2000). An Introduction to Applied Econometrics: a Time Series Approach, Palgrave.
Dostları ilə paylaş: 