On 02.02.2009 20:55, Riccardo (Jack) Lucchetti wrote:
We could actually drop the extra boolean parameter by using a trick
similar to what we currently do for ADF: p>0 means autocorrelations, p<0
means partial autocorrelations. Or would it be too arcane?
yes, FWIW I wouldn't like that very much
I agree with Sven that we should strive for maximum efficiency. Let's
analyse the cases:
1) only ACF needed
2) only PACF needed
3) both needed.
Case 2) is a bit unlikely. Even in the (rather exotic) case when these
statistics are used as intermediate products in a simulation-based
estimator, the PACs are a bijective function of the ACs, so they provide
no extra information, from a strictly theoretical point of view.
Besides, the algorithm we use for the PACF needs the ACF anyway, so
showing just the PACF is a waste of CPU anyway.
I don't think case 2 is so unlikely, but if the ACF is computed anyway
then sure you can spit it out as well
A possible compromise could be: if only the ACF is requested, then leave
the function the way it is now. Otherwise (via the boolean switch, or
the negative parameter, I don't care very much), output a 2*p vector,
with the ACF in [1:p] and the PACF in [p+1:2*p].
Again, this may be confusing at first, but hey.
no I don't think this would be so bad; OTOH if you already have a switch
argument, you could also have it threeways w/o additional overhead
...
One last thing: IMO it's easy enough to get the periodogram
already via
fft() (see example 5.4 in the User's Guide), no?
The periodogram maybe; but I'm talking about the spectrum estimator.
Given that gretl's first purpose is to be an *econometric and time
series library* I think there's room for improvement in the frequency
domain. The embedded matrix language is great and I've almost 100%
converted to it coming from numpy/Python, but it does have one
disadvantage: namely that Jack keeps telling everybody that you can use
it to program everything yourself ;-)
cheers,
sven