[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: -ml- evaluation: tempvars as doubles
Stephen P. Jenkins <firstname.lastname@example.org> asks about advice on Stata variable
types given in the ML book:
> The Gould et al. book on /Maximum Likelihood Estimation with Stata/
> emphasises that temporary variables in a maximum likelihood evaluation
> program should be created as doubles, and provides a salutary example of
> what can happen if you don't create them thus.
> As it happens, all the temporary variables cited in the illustration are
> continuous (a.k.a. metric) variables, in which case the book's advice is
> But what if you know that the temporary variable will only take on a
> small number of discrete values (e.g. 0 or 1, or -1, 0, + 1)? In
> standard Stata contexts the variable could be held as a byte variable.
> In the -ml- evaluator context, however, should one generate them as
> [I suspect that this is no big deal either way, though the two
> strategies have different implications for memory usage and
> requirements, which may bite in some applications.]
Stephen suspects correctly. Provided you have a temporary variable that truly
takes on a small number of discrete values, you can code it as a byte
variable without adverse effects.
Based on the following two points, we did not make the above qualification in
1. It seems reasonable to assume that users who run into an error message due
to memory requirements will just bump up Stata's memory usage with
2. It is a rare event that using -generate byte- for discrete temporary
variables in the likelihood evaluator will prevent the need for resetting
Stata's memory usage.
* For searches and help try: