You are on page 1of 12

c 

 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.

The graphs generated in Stata are attached below as follows:

Xt and t for ɽ = 0.01


Xt and t for ɽ = -0.01

Xt and t for ɽ = 2.5


Xt and t for ɽ = -2.5

Xt and t for ɽ = 100


Xt and t for ɽ = -100

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 ɽ = 0.01 we have, ʌ1= .0845149


For ɽ = -0.01 we have, ʌ1= .0636841
For ɽ = 2.5 we have, ʌ1= .4109281
For ɽ = -2.5 we have, ʌ1= -.3022229
For ɽ = 100 we have, ʌ1= .0819565
For ɽ = -100 we have, ʌ1= .0613598.

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:

Assignment 1 for MA Applied Econometrics Course Anindya Chakraborty


Instructor: Prof. Mandira Sharma CITD, SIS, JNU

. set obs 100


obs was 0, now 100

. 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)

{com}. twoway (line y1 t)

{com}. twoway (line y2 t)

{com}. twoway (line y4 t)

{com}. twoway (line y5 t)

{com}. twoway (line y6 t)

{txt}{search r(198):r(198);}

. generate lagnorm2=l2.norm
(2 missing values generated)

. generate z1=0.01*lagnorm2+lagnorm
(2 missing values generated)

. reg y1 z1, noconst

Source | SS df MS Number of obs = 98


-------------+------------------------------ F( 1, 97) = 0.69
Model | .705438804 1 .705438804 Prob > F = 0.4069
Residual | 98.6287373 97 1.01679111 R-squared = 0.0071
-------------+------------------------------ Adj R-squared = -0.0031
Total | 99.3341761 98 1.01361404 Root MSE = 1.0084

------------------------------------------------------------------------------
y1 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z1 | .0845149 .1014657 0.83 0.407 -.1168665 .2858962
------------------------------------------------------------------------------

.
. reg y2 z2, noconst

Source | SS df MS Number of obs = 98


-------------+------------------------------ F( 1, 97) = 0.39
Model | .399388166 1 .399388166 Prob > F = 0.5323
Residual | 98.6424498 97 1.01693247 R-squared = 0.0040
-------------+------------------------------ Adj R-squared = -0.0062
Total | 99.0418379 98 1.010631 Root MSE = 1.0084

------------------------------------------------------------------------------
y2 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z2 | .0636841 .10162 0.63 0.532 -.1380035 .2653716
------------------------------------------------------------------------------

.
. reg y3 z3, noconst

Source | SS df MS Number of obs = 98


-------------+------------------------------ F( 1, 97) = 19.89
Model | 127.97894 1 127.97894 Prob > F = 0.0000
Residual | 624.052569 97 6.43353164 R-squared = 0.1702
-------------+------------------------------ Adj R-squared = 0.1616
Total | 752.031509 98 7.67379091 Root MSE = 2.5364

------------------------------------------------------------------------------
y3 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z3 | .4109281 .0921343 4.46 0.000 .228067 .5937892
------------------------------------------------------------------------------
.
. reg y4 z4, noconst

Source | SS df MS Number of obs = 98


-------------+------------------------------ F( 1, 97) = 9.87
Model | 62.6936755 1 62.6936755 Prob > F = 0.0022
Residual | 616.25339 97 6.35312773 R-squared = 0.0923
-------------+------------------------------ Adj R-squared = 0.0830
Total | 678.947066 98 6.92803128 Root MSE = 2.5205

------------------------------------------------------------------------------
y4 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z4 | -.3022229 .0962076 -3.14 0.002 -.4931683 -.1112775
------------------------------------------------------------------------------

.
. reg y5 z5, noconst

Source | SS df MS Number of obs = 98


-------------+------------------------------ F( 1, 97) = 0.66
Model | 6711.32798 1 6711.32798 Prob > F = 0.4173
Residual | 980947.37 97 10112.8595 R-squared = 0.0068
-------------+------------------------------ Adj R-squared = -0.0034
Total | 987658.698 98 10078.15 Root MSE = 100.56

------------------------------------------------------------------------------
y5 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z5 | .0819565 .1006042 0.81 0.417 -.117715 .281628
------------------------------------------------------------------------------

.
. reg y6 z6, noconst

Source | SS df MS Number of obs = 98


-------------+------------------------------ F( 1, 97) = 0.37
Model | 3751.15024 1 3751.15024 Prob > F = 0.5439
Residual | 980984.179 97 10113.239 R-squared = 0.0038
-------------+------------------------------ Adj R-squared = -0.0065
Total | 984735.329 98 10048.3197 Root MSE = 100.56
------------------------------------------------------------------------------
y6 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z6 | .0613598 .1007504 0.61 0.544 -.1386018 .2613214
------------------------------------------------------------------------------

.
. 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 y1 w1, noconst

Source | SS df MS Number of obs = 97


-------------+------------------------------ F( 1, 96) = 0.19
Model | .196625024 1 .196625024 Prob > F = 0.6627
Residual | 98.5999028 96 1.02708232 R-squared = 0.0020
-------------+------------------------------ Adj R-squared = -0.0084
Total | 98.7965278 97 1.01852091 Root MSE = 1.0135
------------------------------------------------------------------------------
y1 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w1 | .0446492 .1020463 0.44 0.663 -.1579111 .2472095
------------------------------------------------------------------------------

.
. reg y2 w2

Source | SS df MS Number of obs = 97


-------------+------------------------------ F( 1, 95) = 0.17
Model | .178012381 1 .178012381 Prob > F = 0.6792
Residual | 98.2525832 95 1.03423772 R-squared = 0.0018
-------------+------------------------------ Adj R-squared = -0.0087
Total | 98.4305956 96 1.0253187 Root MSE = 1.017

------------------------------------------------------------------------------
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

Source | SS df MS Number of obs = 97


-------------+------------------------------ F( 1, 96) = 0.18
Model | .185160145 1 .185160145 Prob > F = 0.6716
Residual | 98.3221565 96 1.02418913 R-squared = 0.0019
-------------+------------------------------ Adj R-squared = -0.0085
Total | 98.5073166 97 1.01553935 Root MSE = 1.012

------------------------------------------------------------------------------
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

Source | SS df MS Number of obs = 97


-------------+------------------------------ F( 1, 96) = 0.09
Model | .641211228 1 .641211228 Prob > F = 0.7638
Residual | 678.089392 96 7.06343116 R-squared = 0.0009
-------------+------------------------------ Adj R-squared = -0.0095
Total | 678.730603 97 6.99722271 Root MSE = 2.6577

------------------------------------------------------------------------------
y4 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w4 | .0305918 .1015342 0.30 0.764 -.1709521 .2321357
------------------------------------------------------------------------------

.
. reg y5 w5, noconst

Source | SS df MS Number of obs = 97


-------------+------------------------------ F( 1, 96) = 0.29
Model | 2987.31142 1 2987.31142 Prob > F = 0.5906
Residual | 984541.22 96 10255.6377 R-squared = 0.0030
-------------+------------------------------ Adj R-squared = -0.0074
Total | 987528.532 97 10180.7065 Root MSE = 101.27

------------------------------------------------------------------------------
y5 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w5 | .0547024 .1013555 0.54 0.591 -.1464867 .2558914
------------------------------------------------------------------------------

.
. reg y6 w6, noconst

Source | SS df MS Number of obs = 97


-------------+------------------------------ F( 1, 96) = 0.28
Model | 2848.00498 1 2848.00498 Prob > F = 0.5989
Residual | 981788.427 96 10226.9628 R-squared = 0.0029
-------------+------------------------------ Adj R-squared = -0.0075
Total | 984636.432 97 10150.8911 Root MSE = 101.13

------------------------------------------------------------------------------
y6 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w6 | .0534895 .1013612 0.53 0.599 -.1477109 .2546899
------------------------------------------------------------------------------

.
. reg y6 w6, nocons

Source | SS df MS Number of obs = 97


-------------+------------------------------ F( 1, 96) = 0.28
Model | 2848.00498 1 2848.00498 Prob > F = 0.5989
Residual | 981788.427 96 10226.9628 R-squared = 0.0029
-------------+------------------------------ Adj R-squared = -0.0075
Total | 984636.432 97 10150.8911 Root MSE = 101.13

------------------------------------------------------------------------------
y6 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
w6 | .0534895 .1013612 0.53 0.599 -.1477109 .2546899
------------------------------------------------------------------------------

You might also like