The panel stats functions pmean() and psd() have just been upgraded
in CVS; the old versions suffered from numerical inaccuracy.
The old versions were probably OK for most uses, but they did not
reliably fulfill the promise given in the help text for psd(),
namely that one could check whether or not a given series x is
time-varying by doing
TV = max(psd(x)) > 0
Two things were not right. First, suppose a given series is in fact
time-invariant, and the panel has T = 7. To get the mean for each
group we'd add up the seven values and divide by 7. Problem: in
finite-precision digital arithmetic there's no guarantee that this
will give back exactly the common value. So now we run an initial
check, and if there's no time-variation we don't actually calculate
the mean, we just record the common value as the mean.
Second, to save compute time we were using the so-called
"computational formula" for the standard deviation (which requires
only one pass through the data). I thought this might be good enough
in context, but really it's not. So now (if there's time variation)
we calculate the standard deviation "properly", with one pass to get
the mean and a second to cumulate the squared deviations from the
mean. If the initial check shows no time variation we just record
true zero for the s.d.
Allin
Show replies by date