Hmmmm ... I think what I may do is create the coefficient matrices R, r for
the linear combination Rb-r and just use the matrix language to compute the
restricted least squares estimator. Given that I'm going to try a simple
simulation for it I'm thinking the writing and reading to files would slow
things down a lot.
On Mon, Nov 15, 2010 at 2:12 PM, Allin Cottrell <cottrell(a)wfu.edu> wrote:
On Mon, 15 Nov 2010, Lee Adkins wrote:
> Is there an accessor for restricted estimates after a restrict
> statement? After ols the restricted regression runs by default,
> but I can't figure out how to access the restricted estimates.
> BTW, my goal here is to shrink unrestricted estimates toward the
> restricted.
Right now there's no such accessor. One possibility would be to
generalize the "--full" option to restrict, which is currently
available only for VECMs. This replaces the "last model" with the
restricted estimates, so that the $coeff accessor can be used.
I think you'd want to be able to access both sets of estimates? Would
anyone
else find it useful to be able to save the restricted results, output
them to latex format and/or put the restricted estimates in a model table
along with the unrestricted? I guess that is more in the way of a feature
request :) !
At present if you want to get the restricted estimates from OLS
programmatically you'd have to use gretl's string-handling
functions (which would get you the coefficients to 6 significant
digits), as in:
<script>
open data4-1
ols 1 0 2 3 4
outfile restrict.txt --write
restrict
b3 - b4 = 0
end restrict
outfile --close
string s = readfile("restrict.txt")
matrix b = zeros(4,1)
scalar bi
loop i=1..4 -q
if (i == 1)
s = strstr(s, "const")
else
s = strstr(s, "\n") + 3
endif
s = strstr(s, " ")
sscanf(s, "%lf", &bi)
b[i] = bi
endloop
printf "\n%10.6g\n", b
</script>
Allin Cottrell
_______________________________________________
Gretl-devel mailing list
Gretl-devel(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel
Thanks Allin,
Cheers
Lee
--
Lee Adkins
Professor of Economics
lee.adkins(a)okstate.edu
learneconometrics.com