From: "John A. Major" Subject: Re: Correlated random numbers? Date: Mon, 03 May 1999 18:36:26 GMT Newsgroups: alt.sci.math.probability,sci.math.num-analysis Keywords: Generating random variables with a given correlation Shillelagh wrote: > > Is there an algorithm which provides two random numbers, 'a' and 'b', > whose correlation is 'r'? > > I have searched for this on netlib, acm, and cern, the result being > broken links or no matches. > > Thanks in advance! > -- > Shillelagh There are a number of ways to do this. The easiest assumes that you are talking about random normal deviates with mean zero and variance 1. Take b=r*a+((1-r^2)^0.5)*c where c is also a unit normal, independent of a. Then b is unit normal and corr(a,b)=r. If you have other distributions in mind, it gets trickier.... _____________________________________________________________ John A. Major, ASA 7 Old County Highway Senior Vice President East Granby, CT, USA 06026 GC Instrat (860) 658-4129 Guy Carpenter & Company, Inc. John.Major@guycarp.com http://www.guycarp.com/major.html _____________________________________________________________