You are on page 1of 17

# Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 1

Microeconometrics

## by Alfonso Rosa García

Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 2

Introduction
In this work, I try to reproduce the results obtained by Blundell and Bond, in their paper of
Journal of Econometrics, 1998. In that paper, the authors proposed a GMM estimator for
the case of Dynamic Panel Data, which improves the properties of other estimators that
appeared before in the literature, under the condition of stationarity.

To get this aim, I have written several programs in GAUSS (a model of them is in the
Appendix). With this programs, I have reproduced the results obtained by Blundell and
Bond, and analyzed the estimators under different conditions.

This work begins with a theoretical introduction, and then I present the results obtained in
the Monte Carlo simulations under the different conditions. There we see that Blundell and
Bond estimator supposes an important improvement with respect to Arellano and Bond
under stationarity conditions, as was already shown in the paper. I have checked the
consistency of this fact increasing the number of Monte Carlo repetitions. In a next step, I
have allowed for different ratio of variances, between the time-invariant and the usual
shock. Finally, I have checked the importance of stationarity assumptions for the validity of
the estimator. This is very important, because if we are going to use the estimator, we must
check before this condition. In other case, the Blundell and Bond estimator will present a
high bias.
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 3

## A panel is a set of observations corresponding to a sample of N cross-sectional units

followed over T time periods. The continuity of observations over time is the main
difference between a panel and a sequence of independent cross-sections.
Therefore, in a panel we can distinguish two dimensions: N (cross-sectional dimension)
and T (time-series dimension). Let yit be the variable of the variable y for the individual i
and the period t.
In our case, we are going to work with dynamic panel data, that is, where we have lags of
the endogenous variable as regressors. So the simplest dynamic Panel Data model is the
AR(1) PD model:
Yit = αyit-1 + ηi + uit
Here the ηi represents the individual effect, that is, a time-invariant effect of each
individual. This effect produces some problems in the classical estimators. Because of that,
several specific estimators have been developed for panel data. However, the estimators
used in the static case, usually have bad properties in a dynamic model.
It is the case when we take differences. Let the model:
Yit = αxit + uit, we take differences, and the model is transformed to:
ΔYit = αΔxit + Δuit
But if we have a dynamic model:
ΔYit = αΔyit-1 + Δuit
We have that E(ΔYit-1*Uit)  0 and then classical regression by OLS is inconsistent.

## Estimators for Dynamic Panel Data

Anderson and Hsiao (JE, 1982) proposed an IV estimator, using yit-2 as instrument of Δyit-2:
N T

^  y it y it  2
 AH  i 1 t 1
N T
, given that E (u it y it  2 )  0 .
 y
i 1 t 1
it 1 y it 2

But in general, as T increases, more moment conditions are available for estimation. If uit is
iid, we have in fact the following moment conditions:
t=3: {yi1} E ( y i 2 u i 3 )  0
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 4

## t=4: {yi1, yi2} E ( y i 2 u i 4 )  0

E ( y i 3 u i 4 )  0

## t=5: {yi1, yi2, yi3} E ( y i 2 u i 5 )  0

E ( y i 3 u i 5 )  0

E ( y i 4 u i 5 )  0

Thus we have (T-2)(T-1)/2 moment conditions. This was used by Arellano and Bond
(REStud, 1991) to develop an estimator where all these moment conditions were used:
   
  Yi ,' 1 * Z i  AN   Z ' i *Yi 
 AB   i   i 
   
  Yi ,' 1 * Z i  AN   Z 'i *Yi , 1 
 i   i 

 y i ,1 0 0 ... 0 0 ... 0 
 
 0 y i ,1 yi ,2 ... 0 0 ... 0 
Where Z iAB 
... ... ... ... ... ... ... ... 
 
 0 0 0 ... y i ,1 yi,2 ... y i ,T 2 

is the [(T-2)x(T-2)(T-1)/2] matrix of instruments.

## The problem of weak instruments

Even if we use all the moment conditions of the model, and use the optimal GMM
estimator, what we are doing is instrumenting Δyit-1 with lagged values of y. This can
produce a problem if the instruments are weak. In such case, the estimator can be seriously
biased in small samples. This problem is more important when α increases or if ση is much
greater than σu.

## Blundell and Bond solution

To solve the problem of weak instruments, Blundell and Bond (JE, 1998) proposed to use
some additional conditions, that hold under stationarity. They consider the following T-2
linear moment conditions:
E (vit y i ,t 1 )  0 , vit=ηi+εit, t=4, 5, …, T.
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 5

The validity of the first condition, E (vi 3 y i , 2 )  0 , depends on a restriction on the initial

conditions process generating yi1. To see that, let’s write yi1 in the following way:
i
y i1   vi1
1
The model specifies a convergent level for yit from t = 2 onwards for each individual, and
vi1 is simply the initial deviation from this convergent level. The key requirement is that the
deviations of the initial conditions from ηi/(1-α) are uncorrelated with the level of ηi/(1-α)
itself.
This condition is clearly satisfied in the stationary model. In such case we can use
additional moment restrictions to those used by αAB. The estimator developed by Blundell
and Bond is therefore:

 bb   
  Ybbi
'
, 1 * Z i  AN   Z ' i *Ybbi 
bb

 BB   i   i  where
 bb   
  Ybbi
'
, 1 * Z i  AN   Z ' i *Ybbi , 1 
bb

 i   i 
Y’bbi=(Δyi3, Δyi4, …, ΔyiT, yi3, yi4, …, yiT) and the matrix of instruments is:

 Z iAB 0 0 ... 0 
 
 0 y 2 0 ... 0 
Z ibb  0 0 y3 ... 0  . The 2-estep estimator uses a weighting matrix that

 ... ... ... ... ... 
 
 0 0 0 ... yT 2 
is a consistent estimation of the optimal one:
1
 
AN    Z i'bb * ûi * ûi' * Z ibb  , where ûi are the residuals of the 1-step estimation. For
 i 
the Arellano and Bond estimator it is done in the same way.
We will check the important improvement that supposes the αBB estimator with respect to
αAB, specially for high values of the parameter α. But it is important to remember that the
assumption of stationarity is crucial.

## The present work

Blundell and Bond run Monte Carlo simulations in order to compare the result of their
own estimator against other estimators developed in the literature. In the present work, we
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 6

have tried to reproduce their results through a GAUSS program, and increase the results,
comparing them with the Arellano and Bond estimator. This has been done in several
steps:
I. We have done a program in order to reproduce Blundell and Bond model A results
II. We try to mimic Blundell and Bond model B.
III. We study how the behaviour of the estimator is with a higher amount of Monte
Carlo repetitions. We increase them from 1000 (as in Blundell and Bond paper) to
10000.

IV. We study the effect of different values in the ratio of variances . It is already done,
u
in some sense, in model B, but now we do it explicitly.
V. And finally, we check how important the assumption of stationarity is for the validity
of the estimator.

## In all the cases we present the results of the 2-step estimator.

I. Model A

In this first step, we have done a GAUSS program in order to reproduce Blundell and
Bond results. The used model is the simplest one, an AR(1) Panel Data, of the type:
Yit = αyit-1 + ηi + uit
To construct it, we have generated ηi and uit as independent random variables, following a
N (0, 1). In order to preserve stationarity, the first observations for each individual have
been generated as follows:
i u i1
y i1  
1 1 2
We have run the program for different values of the parameter (α = 0, 0’3, 0’5, 0’8 and 0’9),
of the total number of individuals (N = 100, 200 and 500) and the time periods (T = 4 and
11), as it was done by Blundell and Bond (see p. 131 and 133). The results are in Table 1.
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 7


Model A [(R = 1000), =1]
u
N α  BB  AB N α  BB  AB
0.0049831456 -0.0048983 -0.027517865 -0.05721
0.0 0.0
(0.11322896) (0.13160) (0.046799371) (0.04863)
0.30684442 0.2772372 0.26304106 0.191167
0.3 0.3
(0.13479990) (0.19633) (0.056263162) (0.06192)
0.49848940 0.4231966 0.45658576 0.3078266
100 0.5 100 0.5
(0.14704969) (0.268552) (0.061996495) (0.0734)
0.80931538 0.3419298 0.78771677 0.24679
0.8 0.8
(0.15991421) (0.656859) (0.066539117) (0.12409)
0.94657421 0.122917 0.92720307 0.100476
0.9 0.9
(0.12076436) (0.763042) (0.045849438) (0.14644)
0.0054118358 -0.0006256 -0.0025200164 -0.014097
0.0 0.0
(0.080369236) (0.093267) (0.032821312) (0.03416)
0.30513597 0.2872416 0.28790234 0.25212
0.3 0.3
(0.099862345) (0.135816) (0.041942196) (0.0459)
T=4 0.50382332 0.4706295 T=11 0.47835073 0.396029
200 0.5 200 0.5
(0.10378305) (0.185847) (0.043843576) (0.05352)
0.79477801 0.5192762 0.79976270 0.426721
0.8 0.8
(0.13683581) (0.632401) (0.052050151) (0.09675)
0.93343879 0.2492752 0.92711700 0.231163
0.9 0.9
(0.11823080) (0.73541) (0.035799094) (0.14534)
4.464949e-005 0.0034931 0.0067363026 0.0043462
0.0 0.0
(0.050569751) (0.057833) (0.021615904) (0.02266)
0.30332023 0.2959381 0.30105487 0.287396
0.3 0.3
(0.062763973) (0.084860) (0.025760263) (0.02877)
0.49666413 0.4883252 0.49988065 0.466532
500 0.5 500 0.5
(0.072495723) (0.119746) (0.028749805) (0.03493)
0.79516281 0.6883453 0.80295248 0.607475
0.8 0.8
(0.091884836) (0.310432) (0.033119165) (0.06641)
0.91114319 0.5214391 0.91889941 0.43842
0.9 0.9
(0.095127788) (0.477994) (0.029063808) (0.11108)
Table 1

The results are quite similar to those reported by Blundell and Bond. We can see that  BB
estimator presents a lower variance systematically. Moreover, we can observe huge
improvement of the estimation when α tends to 1. In fact, for a low value of N, the
improvement is clear even for α = 0.3.

II. Model B
In the second step, we have reproduced Blundell and Bond results. The model used is an
AR(1) Panel Data, with a slight difference:
Yit = αyit-1 + (1-α)ηi + uit
To construct it, we have generated ηi and uit as independent random variables, following a
N (0, 1). In order to preserve stationarity, the first observations for each individual have
been generated as follows:
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 8

u i1
y i1   i 
1 2
In this model, the contribution of the time-invariant component of the error term becomes
less important as the autoregressive parameter α increases. In this framework, Arellano and
Bond estimator should behave better when α is high.
We have run the program for different values of the parameter (α = 0, 0’3, 0’5, 0’8 and 0’9),
of the total number of individuals (N = 100, 200 and 500) and the time periods (T = 4 and
11), as it was done by Blundell and Bond (see p. 132). In the original paper, only results for
T=4 are reported. The results are in Table 2.


Model B [(R = 1000),  1]
u
N α  BB  AB N α  BB  AB
0.0013850095 -0.0142129 -0.019652490 -0.045368
0.0 0.0
(0.11414104) (0.137451) (0.049226511) (0.05202)
0.29254933 0.2729351 0.25286167 0.197224
0.3 0.3
(0.12259375) (0.165854) (0.054787265) (0.0593)
0.48347016 0.4485744 0.43547260 0.3394997
100 0.5 100 0.5
(0.13030352) (0.193059) (0.057402607) (0.06656)
0.76035983 0.6939884 0.69011873 0.4432926
0.8 0.8
(0.14145872) (0.400227) (0.063646260) (0.09432)
0.84827821 0.685177 0.78637444 0.3917432
0.9 0.9
(0.13674882) (0.40915) (0.063547370) (0.11394)
0.032381835 0.003963 -0.0053938654 -0.017013
0.0 0.0
(0.11265469) (0.125929) (0.034860240) (0.03642)
0.29919580 0.2898283 0.28268194 0.2555386
0.3 0.3
(0.092162634) (0.120358) (0.039480382) (0.04276)
T=4 0.49339280 0.485653 T=11 0.46926554 0.4179540
200 0.5 200 0.5
(0.093346278) (0.13453) (0.042101973) (0.04909)
0.77876733 0.7346263 0.74198174 0.5854094
0.8 0.8
(0.10248012) (0.20043) (0.044511010) (0.06541)
0.87043262 0.7798692 0.83701618 0.5578643
0.9 0.9
(0.10104479) (0.25585) (0.045976594) (0.08843)
0.0011549218 -0.002303 0.0078316824 0.0052062
0.0 0.0
(0.050325535) (0.05923) (0.021807657) (0.0228)
0.30405522 0.3025358 0.30059225 0.2922538
0.3 0.3
(0.056914278) (0.073603) (0.025697260) (0.02817)
0.49641947 0.4927926 0.49333016 0.4745033
500 0.5 500 0.5
(0.063362938) (0.090513) (0.028056675) (0.03242)
0.79395100 0.7788280 0.77746611 0.705866
0.8 0.8
(0.063356133) (0.117142) (0.029092788) (0.04013)
0.88906497 0.8579092 0.87329269 0.7330217
0.9 0.9
(0.062356497) (0.165437) (0.029310603) (0.05497)
Table 2
Once more, results presented for T=4 are very similar to those of the original paper.
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 9

## We find now a significant improvement of  AB when α is high. However,  BB is still

clearly better in such cases. We find a strange phenomenon too, that I cannot explain: it is
clearly better the estimation with T=4 that with T=11, especially for N = 100 and N = 200.

## III. Increasing Monte Carlo simulations

Now we run the same model increasing the number of Monte Carlo simulations from 1000
to 10000, in order to check if the results stay similar.


Model A [(R = 10000), =1]
u
N α  BB  AB
0.0050687793 -0.0079597431
0.0
(0.11063514) (0.13159424)
0.30156469 0.26885794
0.3
(0.13588975) (0.19147359)
0.49936250 0.42555603
100 0.5
(0.14892719) (0.27026541)
0.81745797 0.35646888
0.8
(0.15931312) (0.67286342)
0.94347875 0.14048905
0.9
(0.13414458) (0.80686069)
0.0028422565 -0.0032446519
0.0
(0.078725215) (0.093423322)
0.30146155 0.28476577
0.3
(0.098095436) (0.13747429)
T=4 0.49805051 0.46205256
200 0.5
(0.11103741) (0.19183032)
0.80170131 0.54457265
0.8
(0.12915948) (0.53322957)
0.93037796 0.27110661
0.9
(0.11970693) (0.79803316)
0.00034976427 -0.0023284333
0.0
(0.049868596) (0.058170875)
0.30026084 0.29451745
0.3
(0.062433917) (0.086060173)
0.49925665 0.48439846
500 0.5
(0.072226441) (0.12072350)
0.79652586 0.70164417
0.8
(0.089034999) (0.32147150)
0.90947477 0.51220218
0.9
(0.095131498) (0.64127056)
Table 3

The results are almost identical to those in Table 1. There are no gains from increasing the
Monte Carlo simulations: 1000 repetitions give robust results.
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 10

## IV. Different variances

Although in Model B there is an implicit change in the ratio of variances, its effect can not
be clearly analyzed because we are varying the coefficient at the same time.
 
Now we analyze the model in two different situations, for = 10 and for = 0.1.
u u
In the second case, we expect a higher difference between the accuracy of the two
estimators, while in the first case the differences should be smaller.

N α  BB  AB N α  BB  AB
-0.0066745913 -0.04687 -0.0019319829 -0.008012
0.0 0.0
(0.17416340) (0.18202) (0.10168367) (0.1432)
-0.35354215 0.3313201 0.29786016 0.292995
0.3 0.3
(0.048992941) (0.019560) (0.10950294) (0.2169)
0.52318759 0.5197222 0.48944116 0.4581884(
100 0.5 100 0.5
(0.068800740) (0.022936) (0.10369861) 0.28575)
T=4 0.80408576 0.8137522 T=4 0.77732440 0.45374
Model A 0.8 Model A 0.8
(0.071329701) (0.034339) (0.088528826) (0.6297)
R = 1000 0.91057924 0.9134156 R = 1000 0.87745257 0.206751
 0.9  0.9
(0.057839533) (0.051063) (0.081425462) (0.83853)
=10 -0.0077105824 -0.002303 =0.1 -0.00146654 -0.002558
u 0.0
(0.10887890) (0.05923)
u 0.0
(0.0461041) (0.06355)
0.33588495 0.332643 0.30070418 0.307115
0.3 0.3
(0.019148) (0.008651) (0.05266107) (0.10422)
0.51878982 0.5206954 0.50097682 0.50492
500 0.5 500 0.5
(0.030047062) (0.00982) (0.04780504) (0.13236)
0.81213214 0.818143 0.79593353 0.743555
0.8 0.8
(0.0235557) (0.015081) (0.03980298) (0.2419)
0.91189106 0.91981 0.89624223 0.614952
0.9 0.9
(0.0174179) (0.02132) (0.0343665) (0.56125)
Table 4


As it was expected, in the case  10 the differences between both estimators have
u

been reduced a lot. In fact, we obtain very accuracy estimations with  AB for high values

of α. The effects go in the opposite direction for the case  0.1 .
u
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 11

## V. Effect of non stationarity

We have already said that Blundell and Bond estimator depends crucially on the
assumption of stationarity. As illustration, we have run model A but with the difference,
that now the initial observation comes from a Normal (0, 1). With this fact, the moment
conditions proposed by the authors are not valid. Let’s see it:


Model A [(R = 1000), =1]: Non stationary initial observation
u
N α  BB  AB N α  BB  AB
0.32384676 -0.0205896 0.029226306 -0.0468843
0.0 0.0
(0.13993746) (0.163873) (0.049673531) (0.0492)
0.78008025 0.3371015 0.38260427 0.190565
0.3 0.3
(0.0899221) (0.19088) (0.057111640) (0.063384)
0.94908602 0.508862 0.65377387 0.2782508
100 0.5 100 0.5
(0.0433564) (0.2082133) (0.056774175) (0.081906)
1.1677582 0.780303 1.0169673 0.4439581
0.8 0.8
(0.0545082) (0.2020023) (0.024415124) (0.11302)
1.2545664 0.89713993 1.0820646 0.72318
0.9 0.9
(0.0516314) (0.1594972) (0.013196016) (0.062814)
0.34311635 -0.001604 0.047401374 -0.014676
0.0 0.0
(0.102995) (0.12364) (0.034771375) (0.035574)
0.79276587 0.36370138 0.40685161 0.249626
0.3 0.3
(0.0657749) (0.13819) (0.040806362) (0.044806)
T=4 0.95432754 0.5500552 T=11 0.68089671 0.377082
200 0.5 200 0.5
(0.025923) (0.13513) (0.043843576) (0.059999)
1.1697722 0.82273433 1.031335 0.5866704
0.8 0.8
(0.0356101) (0.133667) (0.016726425) (0.07385)
1.2552682 0.91348895 1.0877592 0.8085434
0.9 0.9
(0.036492734) (0.11313) (0.0084979543) (0.034047)
0.34669378 -0.0034842 0.058401462 0.0052657
0.0 0.0
(0.064337624) (0.07889) (0.021602949) (0.021919)
0.80278285 0.37221893 0.42099546 0.287035
0.3 0.3
(0.0386459) (0.085817) (0.025656278) (0.029133)
0.95674833 0.5865772 0.70101457 0.455245
500 0.5 500 0.5
(0.015158835) (0.085982) (0.025276663) (0.038121)
1.1750052 0.84912408 1.0382148 0.7037929
0.8 0.8
(0.023372962) (0.081199) (0.010045622) (0.04006)
1.259001 0.93614021 1.0908779 0.864078
0.9 0.9
(0.0227082) (0.06846) (0.0053962332) (0.01937)
Table 5

Now the estimator  BB is clearly biased. In fact, with this initial condition,  AB produces
estimations not highly biased, even for values of α near 1.
Thus, it is important to know clearly how the initial conditions are. Their effect can be very
important for the accuracy of the estimator.
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 12

References

##  Anderson, T.W., and Cheng Hsiao, 1982, "Formulation and Estimation of

Dynamic Models Using Panel Data," Journal of Econometrics, 18, 47-82.
 Arellano, Manuel and Stephen Bond, 1991, "Some Tests of Specification for Panel
Data: Monte Carlo Evidence and an Application to Employment Equations,"
Review of Economic Studies, 58, 277-297.
 Blundell, Richard and Stephen Bond, 1998, "Initial conditions and moment
restrictions in dynamic panel data models," Journal of Econometrics, 87, 115-143.
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 13

Appendix

I have done and run the program with GAUSS 6.0. The program computes the Arellano
and Bond and the Blundell and Bond one- and two-step estimator. Moreover, it allows that
the coefficient varies for α= 0, .3, .5, .8 and .9, that the time period varies (T=4 and 11) and
variation in the number of individuals (N=100, 200 and 500).

/* program ARG:alfonsobb2.gauss */
new; library pgraph; graphset;
resfile="alfonsobb2.RES"; OUTPUT FILE=^resfile RESET; OUTPUT FILE=^resfile ON;
"Program alfonsobb2.gauss";
" Examines GMM BB implementation in a stable panel AR(1) model";

## /* The model we are going to work with is:

Yit = gamma0 + gamma1*YLit + ETAi + EPSit
If we First differenced it we get:
DYit = gamma1*DYLit + Uit
*/

extraperiods=0;

do while extraperiods<10;

bign=0;

do while bign<3;
bign=bign^2+1;

parametr=-1;

do while parametr<9;
/* Here we initialize a loop in order to automatize the different values of the autorregressive parameter */
parametr=parametr+2;
condition=parametr;
parametro=parametr;
if condition<2;
parametro=0;
endif;
if condition>6 and condition<9;
parametro=8;
endif;

## R=1000; N=100*bign; T=4+extraperiods;

/* Number of Monte Carlo repetitions (R), individuals (N) and periods (T) */
gamma0=0; gamma1=parametro/10; gamma2=0; gamma3=1; beta0=0; beta1=0;
/* Coefficients of the model */
etari=rndn(R,N); EPSi0=rndn(R,N); wi0=rndn(R,N); Yi0=/* (1-gamma1)* this is necessary for initial
condition of model B gamma3* */ etari/(1-gamma1)+gamma3* EPSi0/sqrt(1-gamma1^2)
/*Initial condition proposed by Kiviet *//* Some variables of the model */;
ABc=((T-2)*(T-1)/2); ABr=(T-2); BBc=(T-2+(T-2)*(T-1)/2); BBr=(T-2+T-2);
/* Columns and rows of Arellano and Bond, and Blundell and Bond, instruments matrices */
vecgam=zeros(R,1); vecgamA=zeros(R,1); /*We will use this vector to accumulate the different values of the
estimators across Monte Carlo simulations*/
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 14

vecgam2=zeros(R,1); vecgamA2=zeros(R,1); /* We will use this vector to accumulate the different values of
the estimators across Monte Carlo simulationns */

mc=0;
do while mc<R; /* We start the Monte Carlo repetitions: */
mc=mc+1;

ybb=zeros(2*(T-2),N); lybb=ybb;

## ZZ=zeros(BBc,BBc); lyZ=zeros(BBc,1); yZ=zeros(BBc,1); zbbzbb=ZZ; lyZbb=lyZ; yZbb=yZ;

/* We define dimensions for the matrices where we aggregate partial results for each individual, in order to
compute the BB estimator */
ZZA=zeros(ABc,ABc); lyZA=zeros(ABc,1); yZA=zeros(ABc,1); zAbzAb=ZZA; lyZAb=lyZA; yZAb=yZA;
/* We define dimensions for the matrices where we aggregate partial results for each individual, in order to
compute the AA estimator */

i=0;
do while i<N; /* We start the process for individual i */
i=i+1;
epsit=rndn(T,1); /* The noise along periods of individual i */
yy=zeros(T,1);

tt=1;
yy[tt]=Yi0[mc,i]; /* First observation yy of individual i */
do while tt<T; /* We start the process for period t */
tt=tt+1;

## yy[tt]=gamma0+gamma1*yy[tt-1+/* (1-gamma1) * */gamma3*etari[mc,i]+epsit[tt]; /* We have

generated the Yit */
endo; /* Next period t */

/* We regress the model in a combination of first differences (it comes from A-B especification) and
levels (it is added by Blundell and Bond), what is correct under stationarity */

yiab=yy[3:T]-yy[2:T-1];
yibb=yiab|yy[3:T];
/* The BB dependent variable includes the original dependent variable in differences and in levels */
lyiab=yy[2:T-1]-yy[1:T-2];
lyibb=lyiab|yy[2:T-1];
/* The BB first lag variable includes the original first lag variable in differences and in levels */

## /* We save the generated variables */

ybb[.,i]=yibb;
lybb[.,i]=lyibb;
/* It has benn done */

tt=0;
ttt=1;
ZABi=zeros(ABr,ABc); /* We construct now the Arellano and Bond instruments matrix. Dimensions
are defined at the beginning of the program */
do while tt<T-2;
ttt=ttt+tt;
tt=tt+1;
ZABi[tt,ttt:ttt+tt-1]=yy[1:tt]';
endo; /* Next tt */

tt=0;
ZBBi=zeros(BBr,BBc); /* We construct now the Blundell and Bond instruments matrix. Dimensions
are defined at the beginning of the program */
ZBBi[1:ABr,1:ABc]=ZABi;
do while tt<T-2;
tt=tt+1;
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 15

ZBBi[ABr+tt,ABc+tt]=lyibb[tt];
endo; /* We have constructed so the BB instruments matrix for individual i */

## /* The GMM estimator has the form:

[(sum over i of Yi-1'ZBBi)(invers of sum over i of ZBBi'ZBBi)(sum over i of ZBBi'Yi)]
betahat = ______________________________________________________________________
[(sum over i of Yi-1'ZBBi)(invers of sum over i of ZBBi'ZBBi)(sum over i of ZBBi'Yi-1)]

So we compute each component, and save them to add them up caross different individuals i: */

zbbzbb=ZBBi'ZBBi;
lyzbb=ZBBi'*lyibb;
yzbb=ZBBi'*yibb;
ZZ=ZZ+zbbzbb;
lyZ=lyZ+lyzbb;
yZ=yZ+yzbb; /* We aggregate the values for the different i's and we obtain BB estimator */

## /* Here we obtain AB estimator */

zabzab=ZABi'ZABi;
lyzab=ZABi'*lyiab;
yzab=ZABi'*yiab;
ZZA=ZZA+zabzab;
lyZA=lyZA+lyzab;
yZA=yZA+yzAb;

## endo; /* Next individual i */

invzz=invpd(ZZ);
lyzinvzz=lyZ'invzz;
gamma1estmc=(invpd(lyzinvzz*lyZ))*lyzinvzz*yZ;
vecgam[mc]=gamma1estmc; /* Here we accumulate the different values of the BB estimator */

invzzA=invpd(ZZA);
lyzinvzzA=lyZA'invzzA;
gamma1estmcA=(invpd(lyzinvzzA*lyZA))*lyzinvzzA*yZA;
vecgamA[mc]=gamma1estmcA; /* Here we accumulate the different values of the BB estimator */

/* ---------------------------------------------------------------------------------------- */
/* Now we compute the Two-steps estimaotrs */
/* ---------------------------------------------------------------------------------------- */

## ZZ=zeros(BBc,BBc); lyZ=zeros(BBc,1); yZ=zeros(BBc,1); zbbzbb=ZZ;

lyZbb=lyZ; yZbb=yZ;/* We define dimensions for the matrices where we aggregate partial results for each
individual, in order to compute the BB estimator */
ZZA=zeros(ABc,ABc); lyZA=zeros(ABc,1); yZA=zeros(ABc,1); zAbzAb=ZZA;
lyZAb=lyZA; yZAb=yZA;/* We define dimensions for the matrices where we aggregate partial results for
each individual, in order to compute the AA estimator */

i=0;
do while i<N; /* We start the process for individual i */
i=i+1;

tt=0;
ttt=1;
ZABi=zeros(ABr,ABc); /* We construct now the Arellano and Bond instruments matrix. Dimensions
are defined at the beginning of the program */
do while tt<T-2;
ttt=ttt+tt;
tt=tt+1;
ZABi[tt,ttt:ttt+tt-1]=ybb[1:tt,i]';
endo; /* Next tt */

tt=0;
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 16

ZBBi=zeros(BBr,BBc); /* We construct now the Blundell and Bond instruments matrix. Dimensions
are defined at the beginning of the program */
ZBBi[1:ABr,1:ABc]=ZABi;
do while tt<T-2;
tt=tt+1;
ZBBi[ABr+tt,ABc+tt]=lybb[tt,i];
endo; /* We have constructed so the BB instruments matrix for individual i */

## /* The GMM2 estimator has the form:

[(sum over i of Xi'ZBBi)(invers of sum over i of ZBBi'A*ZBBi)(sum over i of ZBBi'Yi)]
betahat = _____________________________________________________________________
[(sum over i of Xi'ZBBi)(invers of sum over i of ZBBi'A*ZBBi)(sum over i of ZBBi'Xi)]

So we compute each component, and save them to add them up across different individuals i: */
epsestbbi=ybb[.,i]-gamma1estmc*lybb[.,i];
matrixAbbi=epsestbbi*epsestbbi';
epsestabi=ybb[1:(T-2),i]-gamma1estmcA*lybb[1:(T-2),i];
matrixAabi=epsestabi*epsestabi';

zbbzbb=ZBBi'matrixAbbi*ZBBi;
lyzbb=ZBBi'*lybb[.,i];
yzbb=ZBBi'*ybb[.,i];
ZZ=ZZ+zbbzbb;
lyZ=lyZ+lyzbb;
yZ=yZ+yzbb; /* We aggregate the values for the different i's and we obtain BB estimator */

## /* Here we obtain AB estimator */

zabzab=ZABi'matrixAabi*ZABi;
lyzab=ZABi'*lybb[1:(T-2),i];
yzab=ZABi'*ybb[1:(T-2),i];
ZZA=ZZA+zabzab;
lyZA=lyZA+lyzab;
yZA=yZA+yzAb;

## endo; /* Next individual i */

invzz=invpd(ZZ);
lyzinvzz=lyZ'invzz;
gamma1estmc2=(invpd(lyzinvzz*lyZ))*lyzinvzz*yZ;
vecgam2[mc]=gamma1estmc2; /* Here we accumulate the different values of the BB2 estimator */

invzzA=invpd(ZZA);
lyzinvzzA=lyZA'invzzA;
gamma1estmcA2=(invpd(lyzinvzzA*lyZA))*lyzinvzzA*yZA;
vecgamA2[mc]=gamma1estmcA2; /* Here we accumulate the different values of the BB2 estimator */

## endo; /* Next Monte Carlo repetition mc */

"R = "; R; "N = "; N; "T = "; T;
"Coefficient = "; gamma1;
"_________________________________________";
"Monte Carlo mean of BB1 estimator: ";
meanc(vecgam);
"Monte Carlo std of BB1 estimator: ";
stdc(vecgam);
"Monte Carlo mean of AB1 estimator: ";
meanc(vecgamA);
"Monte Carlo std of AB1 estimator: ";
stdc(vecgamA);
"_________________________________________";
Analysis of the Blundell and Bond Estimator – by Alfonso Rosa García 17

## "Monte Carlo mean of BB2 estimator: ";

meanc(vecgam2);
"Monte Carlo std of BB2 estimator: ";
stdc(vecgam2);
"Monte Carlo mean of AB2 estimator: ";
meanc(vecgamA2);
"Monte Carlo std of AB2 estimator: ";
stdc(vecgamA2);
"==========================================";

## " Change of N \\\\\\\\\\\\\\\\\\\\\\\\ Change of N \\\\\\\\\\\\\\\\\\\\\\\\ Change of N

\\\\\\\\\\\\\\\\\\\\\\\\ ";
"==========================================";
endo; /* Change of N */

## " CHANGE OF T 88888888888 CHANGE OF T 88888888888 CHANGE OF T 88888888888 CHANGE

OF T 88888888888 ";
"==========================================";"===================
=======================";
extraperiods=extraperiods+7;
endo;