[R] Help plotting a histogram of X~Exp(1)

BowlesMcCann lemon_and_lime7 at hotmail.com
Sun Mar 22 14:13:35 CET 2009


Thank you very much!
 
:)



David Winsemius wrote:
> 
> If you run this you get sensible output, but whether it meets you  
> needs depends on what you meant by Exp(1):
> 
>  > Y <- rnorm(100)
>  > Z <- rnorm(100)
>  > X <- exp(Y+Z)
>  > hist(X)
> 
> If you are looking for methods to handle random variables in R, you  
> may want to look at the series of packages all beginning with "distr":
>     distr, distrDoc, distrEx, distrMod, distrSim, distrTeach, distrTEst.
> 
> -- 
> David Winsemius
> On Mar 22, 2009, at 7:19 AM, BowlesMcCann wrote:
> 
>>
>> I want to plot a histogram of X~Exp(1) where X is the sum of Y + Z.  
>> To do
>> this, should I simulate values of Y and Z using Y<-runif(100) and
>> Z<-runif(100)? And where do I go from there?
>>
>> Many thanks.
>> -- 
>> View this message in context:
>> http://www.nabble.com/Help-plotting-a-histogram-of-X%7EExp%281%29-tp22645091p22645091.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> 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.
> 
> David Winsemius, MD
> Heritage Laboratories
> West Hartford, CT
> 
> ______________________________________________
> 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.
> 
> 
:clap::clap::clap:
-- 
View this message in context: http://www.nabble.com/Help-plotting-a-histogram-of-X%7EExp%281%29-tp22645091p22645942.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list