On Wed, 14 Dec 2011, Sven Schreiber wrote:
On 12/13/2011 04:13 PM, Allin Cottrell wrote:
[on the question
of defining a "reusable" equation system
within a function]
>
> I'm thinking that while "<-" is not really appropriate in
> functions we could support
>
> system
> equations Y X
> end system
>
> with the meaning: create an "anonymous" system which will then
> be the target of the "estimate" (and "restrict") commands. The
> system would stay in place as "the last defined system" until
> either the function returns or another "system" command is
> issued.
This would be useful I think, especially since the estimation method
could possibly be passed to the function as an argument (string, or
integer options).
Here's a trivial example of what's now in CVS:
<hansl>
function void tester (list Y, list X)
system
equations Y X
end system
restrict $system
b[1,1] - b[2,1] = 1
end restrict
estimate $system method=sur
end function
open denmark
list lhs = IBO IDE
list rhs = const LRM LRY ; const LRM LRY
tester(lhs, rhs)
</hansl>
That is, if you give the "system" command in a function
without a "method" specification (in the first instance) the
system is saved internally, and can be accessed for the
purposes of "resrict" and "estimate" via "$system".
Allin