On Thu, 30 Oct 2014, Sven Schreiber wrote:
I'm currently editing the function package HIP by Jack and
Claudia
Pigini because I have run into various problems using it.
For example if I simply have it converted to a hansl script and then try
to run the automatically included sample function call I get the error
"unexpected @".
The cause is some string substitution after an 'mle' block, below is an
example of this error in a different context.
I guess this is fallout from the new parser? This is with 1.10.0cvs from
Oct 24th on Windows 8.
Take the HIP package first (the function HIP_estimate). Yes, this is
fallout from the new parser, but it's an example of what I mentioned a
while back, namely the greater rigour of the new parser.
The trouble is that the string substitution token @bar is used
unconditionally with "end mle", but the string variable "bar" is
defined only in the cases where the scalar s has value 1 or 2 (and
these are not the only possible values). The old parser ignored the
undigested would-be string substitution @bar (in case s equals neither
1 nor 2) while the new one properly rejects it.
In the example below @bar is invalid because the nulldata command has
destroyed the variable "bar": you need the --preserve flag with
nulldata.
Allin
<hansl>
string bar = "-v"
### below ripped from mle-advanced.inp
nulldata 10000
set optimizer bfgs
# generate artificial data
series x1 = normal()
series x2 = normal()
series x3 = normal()
list X = const x1 x2 x3
series ystar = x1 + x2 + x3 + normal()
series y = (ystar > 0)
matrix b = zeros(nelem(X),1) # initialize b at 0
mle logl = y*ln(P) + (1-y)*ln(1-P)
series ndx = lincomb(X, b)
series P = cnorm(ndx)
params b
end mle @bar
</hansl>