On Mon, 2 Feb 2009, Allin Cottrell wrote:
On overloaded functions, I'll just say, think about writing the
help entry for the function: if it seems too crazy, give up the
idea of overloading...
On second thoughts, I'm coming round to the idea of a single
function. What about this:
corrgm(series y, scalar p) ->
p x 2 matrix with ACF and PACF, like the corrgm command
corrgm(series y1, series y2, scalar p) ->
p x 1 matrix with cross-correlogram
We could accept column vectors in place of series. For the sake
of clarity of the interface I don't particularly like the idea of
accepting list arguments. If the user wants to listify either
function that's easy to do, as in
scalar p = 8
list L = 2 3 4
matrix A
loop foreach i L
A ~= corrgm($i, p)
endloop
or
matrix ACF
loop foreach i L
ACF ~= corrgm($i, p)[,1]
endloop
(where the syntax "func(args)[slice]" is newly supported in CVS).
Allin.