On Tue, 3 Jan 2017, juergen.malitte(a)t-online.de wrote:
First of all I wish a happy new year 2017.
To you too!
My problem is the following: [...]
Your script is not very clear; you should use matrices for exercises like
these, everything becomes much easier. As in
<hansl>
set echo off
set messages off
nulldata 50
# structural form
matrix Gamma = {1, -0.5; -0.5, 1}
matrix B = {1.5, 0; 2.5, -0.4}
matrix Sigma = I(2)
# reduced form
matrix iG = inv(Gamma)
matrix Pi = iG * B
matrix Omega = iG * Sigma * iG'
# generate the data
series A = uniform()
list EXO = const A
loop 500 --progressive --quiet
matrix U = mnormal($nobs, 2) * cholesky(Omega)'
matrix Y = {EXO} * Pi' + U
series p = Y[,1]
series e = Y[,2]
tsls p const e ; EXO --quiet
scalar beta1hat = $coeff[1]
scalar beta2hat = $coeff[2]
print beta1hat beta2hat
endloop
</hansl>
Besides: for your parameters, 50 really is too small a sample size.
Remember, tsls is consistent, not unbiased, and you can't expect it to
perform well with small datasets.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------