[R] a matter of etiquette/Fw: dmvsnorm & mvst in fMultivar

Adelchi Azzalini azzalini at stat.unipd.it
Fri May 21 17:32:00 CEST 2010



AA> In 2008, I have spotted some errors in a package, one which is
AA> likely to have many users (I am not one myself). The more serious
AA> errors are in the documentation, since they lead to a completely
AA> distorted interpretation of the outcome; in addition, there is (at
AA> least) one programming error which produces some wrong
AA> computations. A few weeks later, the maintainers of the package
AA> replied, with a promise to handle these issues. 
AA> 
AA> Today, I have looked at that package again, and everthing is as in
AA> 2008, as for the points raised then. There has been at least one
AA> update of that package, about one year after our e-mail exchange.


Some days ago I sent to the R-help list a message of which the above is
the core part, asking advice on how to handle this situation.

First of all I would like to thank the list members that have
expressed their views on this question. This has helped me to make up
my mind: I reproduce below my 2008 message mentioned above.

With best regards,

Adelchi Azzalini


Begin forwarded message:
===========================================
Date: Tue, 26 Aug 2008 10:44:16 +0200
From: Adelchi Azzalini <azzalini at stat.unipd.it>
To: Rmetrics-core at r-project.org
Subject: dmvsnorm & mvst in fMultivar


Dear Colleagues,

I am writing about some functions incorporated into your package
"fMultivar", specifically dmvsnorm & mvst, which originate from 
packages 'sn'. In principle, it is welcome that your package
incorporates some routines from my package. Unfortunately, this
operation has been done improperly, and the effect is seriously
misleading for the user.

In the documentation of the above-mentioned functions, one reads:

mu, Omega, alpha, df: [*mvsnorm][*mvst] - 
           the model parameters: 
           'mu' a vector of mean values, one for each column, 
           'Omega' the covariance matrix, 
           'alpha' the skewness vector, and 
           'df' the number of degrees of freedom which is a measure for
          the fatness of the tails (excess kurtosis). 

and in the code mu is set equal to xi, which is a location parameter,
but _not_ the mean, as the documentation wrongly indicates. In fact 
in the skew-t case the mean may even not exist. Similarly, Omega is 
described as "the covariance matrix", which suggests that this is
the covariance matrix of the distribution, but it is not true.
Omega is _a_ covariance matrix, which is related to the covariance
matrix (when this one exists) but it is different. For the
parametrization based on mean and variance, see later.

In addition, in the code of dmvsnorm, for the one-dimensional case
there is the assignment

 ans = dsn(x, location = xi[1], scale = as.vector(Omega)[1], 
           shape = alpha[1])

which is wrong since in this case the scale is the square root of
Omega. Similar errors exist in pmvsnorm, dmvst, pmvst.

Please note that the above remarks do not attempt to be exhaustive,
since I have not done a full scan of your code and documentation.
These are just the problems which I have spotted after a quick
browsing of your package.

I take this opportunity to draw your attention to this note:
   http://tango.stat.unipd.it/SN/announce2.html
When the new "version 1.xx" will be available, it will include
a parametrization based on mean/variance.

With best wishes,

Adelchi Azzalini  

-- 
Adelchi Azzalini  <azzalini at stat.unipd.it>
Dipart.Scienze Statistiche, Università di Padova, Italia
tel. +39 049 8274147,  http://azzalini.stat.unipd.it/

===========================================



More information about the R-help mailing list