[R] A somewhat off the line question to a log normal distrib

Robin Hankin r.hankin at soc.soton.ac.uk
Thu Dec 2 13:22:29 CET 2004


[stuff about the CLT deleted]

>
> So you can use R usefully to eveluate general statisical
> issues of this kind!
>

absolutely!  R is excellent for this sort of thing.  I use it for 
teaching stats all the time.
I'd say that without a tool like R you cannot learn statistics.


Consider an exponential distribution, which is very skewed.

f <- function(n){mean(rexp(n))}

then f(10) gives the mean of 10 independent exponentially distributed 
random
variables.  Then

hist(replicate(10000,f(10)))

gives us a histogram of 10000 observations of a variable that is itself 
the mean of 10 exponential variables.  It still looks a bit skew to me. 
  Try 100 exponential variables:

hist(replicate(10000,f(100)))

Still a tiny bit skew.


hist(replicate(1000,f(1000)))
which is indistinguishable from a Gaussian.


So as n -> infinity, the CLT kicks in.  But here 100 is a bit less than 
infinity and 1000 ~= infinity.

It's one thing to know a theoretical result, it's quite another to 
verify it numerically.

Kia Ora






> Best wishes,
> Ted.
>
>
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
> Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
> Date: 02-Dec-04                                       Time: 11:30:01
> ------------------------------ XFMail ------------------------------
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list