Re: Generation of another Gaussian random variable from a given one... [message #94138 is a reply to message #94137] |
Tue, 31 January 2017 07:57  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Monday, January 30, 2017 at 11:54:36 AM UTC+1, Markus Schmassmann wrote:
> On 01/28/2017 05:54 AM, Jim P wrote:
>> On Friday, January 27, 2017 at 9:29:50 PM UTC-7, dave poreh wrote:
>>> On Saturday, January 28, 2017 at 7:45:38 AM UTC+3:30, dave poreh wrote:
>>>> I have a Gaussian random variable with zero mean, and variance
>>>> (f_x). I need to generate another Gaussian random variable with
>>>> zero mean, and another variance, that would be correlated with
>>>> the first one (f_x) with the correlation coefficient of say *r*.
>>>> I need some suggestions... Thanks for any kind of helps in
>>>> advances,
>>>
>>> ... I mean at the end we should have: corr(f_x, f_y) = r The
>>> correlation between two Gaussian random variable with zero mean,
>>> and variance should be = r
>>
>> If no IDL solution is quickly forthcoming, there's a similar
>> discussion on stackexchange.com, with an algorithmic description.
>> http://stats.stackexchange.com/questions/15011
>>
>> An implementation is provided in R. I'm no expert on R syntax, but
>> it looks like the code could be translated from R to IDL.
>>
>> For validation of an IDL implementation against this reference, you
>> could call R directly via python and the rpy2 bridge.
>>
>> http://www.harrisgeospatial.com/Company/PressRoom/Blogs/IDLD ataPointDetail/TabId/902/ArtMID/2926/ArticleID/14718/Calling -the-R-Statistical-Package-from-IDL-via-Python.aspx
> Hi Dave,
>
> is this what you are looking for?
>
> https://harrisgeospatial.com/docs/generate_correlated_data.h tml
>
> http://www.cis.rit.edu/~cnspci/media/software/generate_corre lated_data.pro
>
> If not, a while back I wrote a function to get 3d random variables given
> mean, stdDev and correlations that can process multiple such triplets in
> parallel and doesn't break down on impossible inputs.
>
> If you want that I can send it to you, but you'd have to modify it
> yourself to make it work in 2d.
>
> Good Luck, Markus
Thanks Markus, the one that u gave me is sufficient for me and works perfect :).
@ Jim> I do not know R, so I have to work with the IDL one, anyhow, thanks a lot for sharing :),
Cheers Guys
Dave
|
|
|