ALBERTO VIEIRA FERREIRA MONTEIRO
2016-Sep-12 14:32 UTC
[R] (d,p,r,q) for all distributions, but no m?
Today I need to compute the means for some distributions... and there's no easy way to do it! I mean (no pun intended), there is (d,p,r,q) for all distributions (like: dgamma, pgamma, rgamma, qgamma; dchisq, pchisq, rchisq, dchisp; etc), but there is no "m"-functions, like a mgamma to get the mean (or any momentum) of gamma, a mchisq, a mnorm, etc. May I suggest adding these functions? Alberto Monteiro
No you may not. I suggest that you *first search before posting* -- e.g. on "R package moments of distributions" -- where you would find the package "moments" that apparently already does exactly what you suggest (there are some other packages as well). You could also first search the CRAN task views site to find this: https://cran.r-project.org/web/views/Distributions.html R is a mature software environment with something like 8000 packages. It is highly unlikely that you (or I !) would think of some simple statistical functionality that is not already available. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Sep 12, 2016 at 7:32 AM, ALBERTO VIEIRA FERREIRA MONTEIRO <albmont at centroin.com.br> wrote:> Today I need to compute the means for some distributions... and there's no easy way to do it! > > I mean (no pun intended), there is (d,p,r,q) for all distributions (like: dgamma, pgamma, rgamma, qgamma; dchisq, pchisq, rchisq, dchisp; etc), but there is no "m"-functions, like a mgamma to get the mean (or any momentum) of gamma, a mchisq, a mnorm, etc. > > May I suggest adding these functions? > > Alberto Monteiro > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.