Professional Documents
Culture Documents
cc
c
!"#
We have the following equation: Xt = ɽ.ɸt-1 + ɸt
where, ɸt ~ NID (0, 1)
Given are 6 values of ɽ, for which we have to find out the corresponding Xt values for 100 time points.
We first generate 100 random numbers following normal distribution for the error term ɸt. Then we find
out a one period lagged series of the same values which corresponds to the previous period error term
ɸt-1. Then we find out the Xt values by using the given equation Xt = ɽ.ɸt-1 + ɸt, and the given values for ɽ.
Then we generate a time variable for 100 time points and plot each of the Xt series [one for each ɽ
value], against time. This gives us the required time series graph which is nothing but essentially a line
diagram plotted against time.
The simulation has been done using the software Stata 10. The commands given there and procedure
followed is explained in the text file attached separately. It lists all the commands and the variable
values generated and the random numbers generated. It is also listed at the end of this paper in the
appendix.
Above figures represent time series graph for the variable Xt for different values of ɽ, where the error
terms ɸt are generated randomly, following NID(0, 1).
We have already generated the Xt values. Now we generate Xt-1 in the same procedure. Then we
regress Xt on Xt-1 without the constant term to estimate the coefficient term that is nothing but the
autocorrelation for first order lag. The details of the regression and estimates of ʌ1 for each ɽ value is
given in the text file attached. Here we simply give the estimates of ʌ1.
For negative values of ɽ, we should have negative value of ʌ1 given their relationship ʌ1= ɽ/(1+ ɽ2).
However, from the given data the calculation gives us the above result where only ʌ1 for ɽ = -2.5. All
other ʌ1 values are positive. Also the ʌ1 values estimated from the data are significantly different from
what we get using the standard formula.
This error is due to some problem in random number generation which is discussed at the end of this
paper.
Now, we calculate the ʌ2 values from the given data. For that we find out the two period lagged series
Xt-2. Generation of Xt-2 follows exactly the same procedure as Xt and Xt-1. Now we regress Xt on Xt-2
without the constant term as before. The coefficient for this regression gives us the estimates for the ʌ2
values. The details of the regression and estimates of ʌ2 values is described in the text file.
One interesting thing to note is that for MA (1), process, theoretically, ʌ2 value should be 0. This is
because MA(1) is a time series of one period lag whereas ʌ2 calculates the autocorrelation, if any,
between two period lag of a variable. So, intuitively, ʌ2 should be 0. However our data gives us values
for ʌ2, which are significantly different from 0, for each ɽ value. This is because of a certain error in
random number generation.
The error is that the command used in Stata for random number generation is the command for
generating random numbers from a normal distribution. The mean and variance of this distribution are
also unknown. So, the random numbers generated here are not following NID (0,1). Actually they are
following just a normal distribution, that also not a standard normal, that is with o mean and 1 variance.
This is due to the fact that we could not get the actual command to generate random numbers following
NID (0, 1). The closest most that we can get to the given question is to generate the numbers following a
normal distribution. This accounts for all the error in the data, and subsequently in the calculation of the
concerned variables.
c"$
Commands used in Stata:
. generate norm=invnorm(uniform())
. generate t=_n
. tsset t
{col 9}time variable: {res}{col 25}t, 1 to 100
{col 17}delta: {res}1 unit
. generate lagnorm=l.norm
(1 missing value generated)
. generate y1=0.01*lagnorm+norm
(1 missing value generated)
. generate y2=(-0.01)*lagnorm+norm
(1 missing value generated)
. generate y3=2.5*lagnorm+norm
(1 missing value generated)
. generate y4=(-2.5)*lagnorm+norm
(1 missing value generated)
. generate y5=100*lagnorm+norm
(1 missing value generated)
. generate y6=(-100)*lagnorm+norm
(1 missing value generated)
{txt}{search r(198):r(198);}
. generate lagnorm2=l2.norm
(2 missing values generated)
. generate z1=0.01*lagnorm2+lagnorm
(2 missing values generated)
------------------------------------------------------------------------------
y1 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z1 | .0845149 .1014657 0.83 0.407 -.1168665 .2858962
------------------------------------------------------------------------------
.
. reg y2 z2, noconst
------------------------------------------------------------------------------
y2 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z2 | .0636841 .10162 0.63 0.532 -.1380035 .2653716
------------------------------------------------------------------------------
.
. reg y3 z3, noconst
------------------------------------------------------------------------------
y3 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z3 | .4109281 .0921343 4.46 0.000 .228067 .5937892
------------------------------------------------------------------------------
.
. reg y4 z4, noconst
------------------------------------------------------------------------------
y4 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z4 | -.3022229 .0962076 -3.14 0.002 -.4931683 -.1112775
------------------------------------------------------------------------------
.
. reg y5 z5, noconst
------------------------------------------------------------------------------
y5 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z5 | .0819565 .1006042 0.81 0.417 -.117715 .281628
------------------------------------------------------------------------------
.
. reg y6 z6, noconst
.
. generate lagnorm3=l3.norm
(3 missing values generated)
. generate w1=0.01*lagnorm3+lagnorm2
(3 missing values generated)
. generate w2=(-0.01)*lagnorm3+lagnorm2
(3 missing values generated)
.
. generate w3=(2.5)*lagnorm3+lagnorm2
(3 missing values generated)
.
. generate w4=(-2.5)*lagnorm3+lagnorm2
(3 missing values generated)
.
. generate w5=(100)*lagnorm3+lagnorm2
(3 missing values generated)
.
. generate w6=(-100)*lagnorm3+lagnorm2
(3 missing values generated)
.
. reg y2 w2
------------------------------------------------------------------------------
y2 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w2 | .0425666 .1026016 0.41 0.679 -.1611233 .2462565
_cons | -.0267944 .1033078 -0.26 0.796 -.2318864 .1782976
------------------------------------------------------------------------------
.
. reg y2 w2, noconst
------------------------------------------------------------------------------
y2 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w2 | .0433919 .1020528 0.43 0.672 -.1591813 .2459651
------------------------------------------------------------------------------
.
. reg y3 w3, noconst
Source | SS df MS Number of obs = 97
-------------+------------------------------ F( 1, 96) = 0.52
Model | 4.00853493 1 4.00853493 Prob > F = 0.4747
Residual | 747.024775 96 7.78150807 R-squared = 0.0053
-------------+------------------------------ Adj R-squared = -0.0050
Total | 751.03331 97 7.74261144 Root MSE = 2.7895
------------------------------------------------------------------------------
y3 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w3 | .0727327 .1013372 0.72 0.475 -.12842 .2738854
------------------------------------------------------------------------------
.
. reg y4 w4, noconst
------------------------------------------------------------------------------
y4 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w4 | .0305918 .1015342 0.30 0.764 -.1709521 .2321357
------------------------------------------------------------------------------
.
. reg y5 w5, noconst
------------------------------------------------------------------------------
y5 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w5 | .0547024 .1013555 0.54 0.591 -.1464867 .2558914
------------------------------------------------------------------------------
.
. reg y6 w6, noconst
------------------------------------------------------------------------------
y6 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w6 | .0534895 .1013612 0.53 0.599 -.1477109 .2546899
------------------------------------------------------------------------------
.
. reg y6 w6, nocons
------------------------------------------------------------------------------
y6 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w6 | .0534895 .1013612 0.53 0.599 -.1477109 .2546899
------------------------------------------------------------------------------