[I see that Jack Lucchetti has replied on this since I
started writing, but I'll post it anyway; having two methods
to look at might be useful.]
On Tue, 15 Nov 2011, Qi Shi wrote:
I want to reproduce Verbeek's Table 5.4, below is my scripts:
open pricing.gdt
set force_hc on
scalar delta=0.5
scalar gamma=0.5
series e0=delta*cons^(-gamma)*(1+rf)-1
series e1=delta*cons^(-gamma)*(rf-r1)
series e2=delta*cons^(-gamma)*(rf-r2)
series e3=delta*cons^(-gamma)*(rf-r3)
series e4=delta*cons^(-gamma)*(rf-r4)
series e5=delta*cons^(-gamma)*(rf-r5)
series e6=delta*cons^(-gamma)*(rf-r6)
series e7=delta*cons^(-gamma)*(rf-r7)
series e8=delta*cons^(-gamma)*(rf-r8)
series e9=delta*cons^(-gamma)*(rf-r9)
series e10=delta*cons^(-gamma)*(rf-r10)
list xlist=e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10
matrix V0=I(11)
gmm list e=xlist
orthog e; const
weights V0
params delta gamma
end gmm
There are two problems here, one with gretl and one with your
script.
The gretl problem: although the manual states that you can use
a list of series as the left-hand term in a GMM orthogonality
condition, apparently that was never hooked up properly. This
is now fixed in CVS.
The problem with your script is that you never use delta and
gamma to recompute your series e0 to e10 -- so gretl will find
a gradient of zero and give you back your initial values for
the parameters.
Here's a script that replicates the Verbeek table. I've chosen
to organize the data into matrices rather than using the list
approach.
<hansl>
open pricing.gdt
set force_hc on
matrix R = zeros($nobs, 11)
R[,1] = 1 + rf
loop j=1..10 --quiet
R[,j+1] = rf - r$j
endloop
scalar delta=0.5
scalar gamma=0.5
matrix E = {delta * cons^(-gamma)} .* R
matrix V0 = I(11)
gmm
E = {delta * cons^(-gamma)} .* R
E[,1] -= 1
orthog E ; const
weights V0
params delta gamma
end gmm
gmm
E = {delta * cons^(-gamma)} .* R
E[,1] -= 1
orthog E ; const
weights V0
params delta gamma
end gmm --iterate
</hansl>
Allin Cottrell