[R] runif with condition

peter dalgaard pdalgd at gmail.com
Wed Jan 11 11:12:52 CET 2012


On Jan 10, 2012, at 18:11 , AlanM wrote:

> I have to disagree with what's been posted, but I think some very interesting
> points have been addressed.  I'd like to add my two cents.  
> 
> Consider the pair {X, 1-X} where X is sampled from a uniform(0,1)
> distribution.  The quantity 1- X also comes from a uniform(0,1) distribution
> and therefore is probabilistic and not deterministic.
> 
> The sum of independent random variables is itself a random variable.  

Also of non-independent ones, provided you allow the possibility of a degenerate distribution, as in the case above.

> If X1,
> X2 & X3 are

independent and

> uniformly distributed, then the distribution of Y = X1 + X2 + X3
> can be determined (i.e. Y is probabilistic and NOT deterministic).  Y is a
> random variable, but it is correlated with X1, X2 and X3.  The set {X1, X2,
> X3, 100 - (X1 + X2 + X3) } contains 4 random variables, however they are
> neither independent or identically distributed. 


Yes. You can achieve various properties like X1+X2+X3+X4=100, X1,...,X4 identically distributed, but not independent and not uniform. (Generate 4 independent variables from some distribution on the positive axis and rescale to the required sum.)

You can't have X1,...,X4 all uniform on (0,100), even if non-independent, with a sum of 100, because the mean of the sum would be the sum of the means, i.e., 200! 

Whether you can have X1,...,X4, exchangeable and uniform on (0,50) is, er, an interesting question. (I would say probably not, but I can't think of an argument.)


> 
> If you are curious, check this out.
> 
> Deriving the Probability Density for Sums of Uniform Random Variables
> Edward J. Lusk and Haviland Wright
> The American Statistician
> Vol. 36, No. 2 (May, 1982), pp. 128-130 
> 
> Thanks to the OP.  This has become an interesting thread.  
> 
> -Alan Mitchell
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/runif-with-condition-tp4278704p4282600.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.

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list