On Tue, 3 Feb 2009, Riccardo (Jack) Lucchetti wrote:
A possible compromise could be as follows:
- arg1 could be either single (series/vector) or multiple
(matrix/list).
- arg2: scalar, the max order; end of story.
- arg3 (optional) could only be is a series/vector. If absent,
the function reutrns acf/pacf. If present, the function yields
cross-correlations against that variable. Note that in many
cases this is all that's required (cfr countless RBC papers
which compute cross-covariances _against GDP_). If more is
needed, use a loop.
As I said, I like this.
It's now implemented in CVS, up to a point. Note that the old CVS
functions acf() and xcf() are gone. We now have one function,
corrgm(). This has the semantics Jack describes. Absent the
third argument, ACF and PACF are combined, in adjacent pairs of
columns in the output matrix. (There's just one pair of columns
in the output if arg1 is a series or column vector, but k >= 1
pairs if arg1 is a general matrix or list.)
The "up to a point" bit is that when the third argument is given
(i.e. cross-correlogram is wanted), only the following two cases
are implemented so far:
* arg1 = series, arg3 = series
* arg1 = column vector, arg3 = column vector
Implementing the remaining cross-cases (general matrix or list for
arg1; mixed data types between arg1 and arg3) would be nice, but
would involve a good deal of painful tedium (particularly with
regard to proper error checking), so not done yet.
Allin.