Kramer, Christian
2013-Oct-25 14:48 UTC
[R] Adding up normally distributed numbers seems to not create a t-distribution
Hi there, I have found a strange behavior in R that puzzles me - maybe it is a bug or a basic scientific misunderstanding of mine? anyway, I would highly appreciate some feedback on this, since I did not find anything on the internet. I am trying to simulate a t-distribution by adding up normally distributed numbers: a <- (rnorm(1000) + rnorm(1000) + rnorm(1000) )/3 However, when I look at the distribution using qqnorm(a) this looks more like a normal distribution than a t-distribution: b <- rt(1000,2) qqnorm(b) Is this to be expected? Or is this an issue with the random number generator or something else? Thanks a lot for replies in advance, Christian -------------------------------------------- Dr. Christian Kramer Theoretical Chemistry University of Innsbruck Innrain 82 A-6020 Innsbruck Tel.: +43 512 507 57103 Homepage: http://homepage.uibk.ac.at/~c72448/kramer.html Email: Christian.Kramer at uibk.ac.at
Jeff Newmiller
2013-Oct-26 05:25 UTC
[R] Adding up normally distributed numbers seems to not create a t-distribution
That would be an expected result. Recommend that you hit the books or use a search engine as basic theory like this is off topic here. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. "Kramer, Christian" <Christian.Kramer at uibk.ac.at> wrote:>Hi there, > >I have found a strange behavior in R that puzzles me - maybe it is a >bug or a basic scientific misunderstanding of mine? anyway, I would >highly appreciate some feedback on this, since I did not find anything >on the internet. > >I am trying to simulate a t-distribution by adding up normally >distributed numbers: > >a <- (rnorm(1000) + rnorm(1000) + rnorm(1000) )/3 > >However, when I look at the distribution using > >qqnorm(a) > >this looks more like a normal distribution than a t-distribution: > >b <- rt(1000,2) >qqnorm(b) > >Is this to be expected? Or is this an issue with the random number >generator or something else? > >Thanks a lot for replies in advance, >Christian > >-------------------------------------------- >Dr. Christian Kramer >Theoretical Chemistry >University of Innsbruck >Innrain 82 >A-6020 Innsbruck >Tel.: +43 512 507 57103 >Homepage: http://homepage.uibk.ac.at/~c72448/kramer.html >Email: Christian.Kramer at uibk.ac.at > >______________________________________________ >R-help at r-project.org mailing list >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.
Tsjerk Wassenaar
2013-Oct-26 07:17 UTC
[R] Adding up normally distributed numbers seems to not create a t-distribution
Hi :) Try this with other distributions too... And then search for 'central limit theorem'. Cheers, Tsjerk On Fri, Oct 25, 2013 at 4:48 PM, Kramer, Christian < Christian.Kramer@uibk.ac.at> wrote:> Hi there, > > I have found a strange behavior in R that puzzles me - maybe it is a bug > or a basic scientific misunderstanding of mineā¦ anyway, I would highly > appreciate some feedback on this, since I did not find anything on the > internet. > > I am trying to simulate a t-distribution by adding up normally distributed > numbers: > > a <- (rnorm(1000) + rnorm(1000) + rnorm(1000) )/3 > > However, when I look at the distribution using > > qqnorm(a) > > this looks more like a normal distribution than a t-distribution: > > b <- rt(1000,2) > qqnorm(b) > > Is this to be expected? Or is this an issue with the random number > generator or something else? > > Thanks a lot for replies in advance, > Christian > > -------------------------------------------- > Dr. Christian Kramer > Theoretical Chemistry > University of Innsbruck > Innrain 82 > A-6020 Innsbruck > Tel.: +43 512 507 57103 > Homepage: http://homepage.uibk.ac.at/~c72448/kramer.html > Email: Christian.Kramer@uibk.ac.at > > ______________________________________________ > R-help@r-project.org mailing list > 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. >-- Tsjerk A. Wassenaar, Ph.D. [[alternative HTML version deleted]]