comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Generation of another Gaussian random variable from a given one...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Generation of another Gaussian random variable from a given one... [message #94137 is a reply to message #94135] Mon, 30 January 2017 02:54 Go to previous messageGo to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GDL 0.9.7 delivered
Next Topic: How to make long program keep going if error comes??

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:56:56 PDT 2025

Total time taken to generate the page: 0.00401 seconds