On Fri, 2 Dec 2016, Artur T. wrote:
Dear all,
For some reason testing the linear restriction b[1]=0 (the intercept)
does not work. However, it works fine for all remaining
coefficients/variables as the following example shows. I am using the
current git version on ubuntu.
Best,
Artur
<hansl>
set echo off
set messages off
clear
open denmark.gdt -q
# DOES WORK: b[2]=0
ols LRM 0 LRM(-1 to -1) LRY(0 to -1)
matrix Rmat = zeros(1,nelem($coeff))
Rmat[1,2]=1
matrix qvec = zeros(1,1)
Rmat
qvec
restrict
R = Rmat
q = qvec
end restrict
# DOES NOT WORK: b[1]=0
ols LRM 0 LRM(-1 to -1) LRY(0 to -1) --quiet
matrix Rmat = zeros(1,nelem($coeff))
Rmat[1,1]=1
matrix qvec = zeros(1,1)
Rmat
qvec
restrict
R = Rmat
q = qvec
end restrict
</hansl>
Hmm, that's apparently a bug that has been lurking for a long time.
It's now fixed in git. Note, however, that the simpler formulation
restrict
b1 = 0
end restrict
was not broken like the matrix R,q version. I guess that's why the
problem hasn't been noticed before now.
Allin