[R] SLLN for loggamma fails for 2 order moments

From: michaelhk82 <michaelhk82_at_yahoo.dk>
Date: Sat, 14 Jun 2008 01:54:09 -0700 (PDT)

I was trying to calculate 2. order moment for a loggamma sample. Also, I checked it with the function mlgamma from the package actuar, which calculates moments based on loggamma parameters. Se below - I get big deviations. Numerical integration suggests that mlgamma gets it right. What fails
in my attempt to use SLLN to estimate the 2. order moments?


sum(rlgamma(10^6,25,2.6)^2)/10^6 #Estimation by SLLN [1] 1.964011e+13
> mlgamma(2,25,2.6) #2.order moment by mlgamma
[1] 8.328225e+15

The difference is more than a factor 100! I have tried to run the code several times but I never manage to exceed the value of mlgamma - that is, by SLLN I keep underestimating the 2. order moment.
(and tried with larger samples as well, but my cpu wont accept sample larger than 10^7).

Does anyone have an idea of what is happening?


View this message in context: http://www.nabble.com/SLLN-for-loggamma-fails-for-2-order-moments-tp17837233p17837233.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 14 Jun 2008 - 09:52:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 15 Jun 2008 - 07:30:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive