473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Bivariate Gaussian Generator

Hi

Please can anyone write a code to generate random numbers of array length 2 from setMean and setCovariance?
Jul 14 '07 #1
10 2897
JosAH
11,448 Expert 8TB
Hi

Please can anyone write a code to generate random numbers of array length 2 from setMean and setCovariance?
What is a random number of 'array length 2'?

kind regards,

Jos
Jul 14 '07 #2
What is a random number of 'array length 2'?

kind regards,

Jos
The class Random generates random numbers from a gaussian distribution that is one dimensional(univariate). My problem is how to generate bivariate random numbers from Mean(1.0,1.0) and Covariance(1.0,0.0,0.0,1.0)
Jul 14 '07 #3
r035198x
13,262 8TB
The class Random generates random numbers from a gaussian distribution that is one dimensional(univariate). My problem is how to generate bivariate random numbers from Mean(1.0,1.0) and Covariance(1.0,0.0,0.0,1.0)
Do you know the algorithms for this?

Here's a good start.
Jul 15 '07 #4
JosAH
11,448 Expert 8TB
From my paper copy of Abramowitz and Stegun (page 953):

Let { X1, X2 } be a pair of independent N(0,1) deviates. Then deviates
{ X1, rho*X1+(1-rho^2)^1/2*X2 } represent a pair of deviates from a bivariate
normal distribution with m=0, s=1, correlation coefficient rho.

There is a N(0,1) pseudo random number generator available, so there you go.

kind regards,

Jos
Jul 15 '07 #5
r035198x
13,262 8TB
From my paper copy of Abramowitz and Stegun (page 953):

Let { X1, X2 } be a pair of independent N(0,1) deviates. Then deviates
{ X1, rho*X1+(1-rho^2)^1/2*X2 } represent a pair of deviates from a bivariate
normal distribution with m=0, s=1, correlation coefficient rho.

There is a N(0,1) pseudo random number generator available, so there you go.

kind regards,

Jos
How I could have used such a book in my 2nd year project (Discrete event simulation).
Jul 15 '07 #6
JosAH
11,448 Expert 8TB
How I could have used such a book in my 2nd year project (Discrete event simulation).
It's quite an old (and famous!) book: it was first printed in 1964; I bought my
copy ten years later. I guess the current edition is the 10th or 11th edition.

Go to that link I supplied: it's a full scan of more than 1000 pages; ready for
downloading. (better late than never ;-)

kind regards,

Jos
Jul 15 '07 #7
r035198x
13,262 8TB
It's quite an old (and famous!) book: it was first printed in 1964; I bought my
copy ten years later. I guess the current edition is the 10th or 11th edition.

Go to that link I supplied: it's a full scan of more than 1000 pages; ready for
downloading. (better late than never ;-)

kind regards,

Jos
Yep I've got the download link, I'm downloading it now. I really should have known about that book.
Jul 15 '07 #8
Do you know the algorithms for this?

Here's a good start.
Hi
the link you sent is for matlab.
I want to write a class that wraps up a random number generator given the following instance methods;

void setMean(float,float)
void setCovariance(float,float,float)
float[] generateRandom()
Jul 15 '07 #9
JosAH
11,448 Expert 8TB
Hi
the link you sent is for matlab.
I want to write a class that wraps up a random number generator given the following instance methods;

void setMean(float,float)
void setCovariance(float,float,float)
float[] generateRandom()
Did you read my reply for starters? Next: google shows quite some results on
"bivariate normal distribution".

kind regards,

Jos
Jul 15 '07 #10
r035198x
13,262 8TB
Hi
the link you sent is for matlab.
I want to write a class that wraps up a random number generator given the following instance methods;

void setMean(float,float)
void setCovariance(float,float,float)
float[] generateRandom()
And again :
Quote=You
"My problem is how to generate bivariate random numbers from Mean(1.0,1.0) and Covariance(1.0,0.0,0.0,1.0)"

The link teaches (not states) how to generate random numbers using a computer program.
Jul 15 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michael Allen | last post by:
Hi all you Java 2D gurus out there. I wonder if you might be able to help me. I've been dipping my toe into the world of Gaussian blurring and with the help of a few articles and some bashing my...
4
by: Xcal | last post by:
Anyone knows how to make a Gaussian fit to a histogram data using Python, or where I can find a library that helps me in this task? Tks everyone... Paxcal
2
by: GBartgo | last post by:
Is there someone who knows how to generate a gaussian mixture in c++?
14
by: Charles Banas | last post by:
I'm not sure if this is the right place to ask about this, but I've seen several posts in the past regarding Akima's Bivariate Interpolations routines, and i'm wondering if someone can give me some...
1
by: Ricardo | last post by:
Hello wizards, I need to get a Random number from an gaussian distribution in Visual Basic .NET , somebody knows how to make it. Thanks in advance.
1
by: j.f.c.neves | last post by:
Hello, I need some help in using the rlft3 (Numerical Recipes in c++ book, Chapter 12) to apply a Gaussian smoothing to a 2D image. How do I create a suitable filter function (page 535)? ...
3
by: bob | last post by:
I was wondering if anyone can recommend a way to generate a Gaussian random variable with standard deviation 1. Thank you.
1
by: olorunfunmi | last post by:
hello guys, i'm in dire need of algorithms and c programs for cramer's rule and gaussian elimination. the ones i've been getting seemm toooooo complex
10
by: Verbal Kint | last post by:
DEAR ALL, I just have a very short question. In the FAQ list question 13.20 the following text is mentioned: "These methods all generate numbers with mean 0 and standard deviation 1. (To adjust...
2
by: Gerdus van Zyl | last post by:
Does anyone have a relatively fast gaussian blur implemented in pure python? Below is my attempt but it takes 2.9 seconds for a 320x240 image. Image comes from byte string: self.array =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.