On Mon, 30 May 2011, Sven Schreiber wrote:
Am 30.05.2011 10:21, schrieb a.bala:
> Le 29/05/2011 18:53, Henrique Andrade a écrit :
>> I think we could just use an option flag in the "summary" command
>> (like we already have):
>> *summary --matrix="matrix name"*
> Why not? I find this option more useful and suggestive than a function
> package.
>
Just to be clear: There are the new (not-yet-approved) functions
skewness() and kurtosis(). The function package would bind these and
other functions together, essentially adding another API to those
functions.
IMO functions and commands serve different purposes, there is no real
competition between them and they are not substitutes.
I don't have anything against additional function packages, but I would
be against adding this to gretl (=its namespace) by default, it's just
redundant.
I agree. Besides, it's not quite clear to me how the proposed package is
meant to be used. I mean: is it meant as a GUI interface to produce a
matrix out of a list? Ok, and then, once the matrix is created, what would
you do with it? Alternatively, if intended usage is mainly though a
script, do we really need a function package for something like this?
<script>
function matrix moments(list X)
scalar k = nelem(X)
ret = zeros(k, 4)
j = 1
loop foreach i X --quiet
ret[j, 1] = mean(X.$i)
ret[j, 2] = sd(X.$i)
ret[j, 3] = skewness(X.$i)
ret[j, 4] = kurtosis(X.$i)
j++
end loop
return ret
end function
# ---- example ---------------------------
open mroz87 --quiet
list X = 4 5 6
summary X
M = moments(X)
print M
</script>
(BTW jack: is this excess kurtosis or not? If it is, I would be in
favor
of a name change.
It is, for compatibility with the output of "summary", but of course, this
is easy to change if we so decide.
Also, while I like the explicit names [up to 8 characters], I
don't
understand why at the time "dynpanel" was considered too long, but
"skewness" and "kurtosis" are not :-)
You have a point. But then, what? "sk"? "skew"? "kurt"?
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti