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, 15 Nov 2010, Lee Adkins wrote:Right now there's no such accessor. One possibility would be to
> 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.
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.
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@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel