Register to reply 
Creating a distribution with specific mean and variance in FORTRAN 90 
Share this thread: 
#1
Feb1813, 02:44 AM

P: 14

Hi,
I'm trying to create a normal distribution with mean 0.5 and variance 0.05. I tried it initially with MATLAB, for which I used
Thank you. (P.S. : The LINUX OS on my system needs to be replaced, and I'm writing some more code before I can run them on another system. It would be great to have your help in the meanwhile, so I could check everything together. Thanks again) 


#2
Feb1813, 03:40 AM

Sci Advisor
PF Gold
P: 1,354

You can't do it directly with random_number, which has a uniform distribution. There are different ways to produce a normal distribution from a uniform distribution, such as the BoxMuller transform.



#3
Feb1813, 01:56 PM

HW Helper
P: 6,188

Hi sue132!
Here's some C source code for nrandom that generates normally distributed random numbers (based on the Boxmuller transform). The algorithm is easy to port to any computer language. It comes from Numerical Recipes in C, for which there is also a FORTRAN version. 


#4
Feb1813, 11:19 PM

P: 14

Creating a distribution with specific mean and variance in FORTRAN 90
Thank you for the replies



Register to reply 
Related Discussions  
Fortran: Creating a sequence with constraints  Programming & Computer Science  9  
Creating FORTRAN Libraries  Programming & Computer Science  0  
Fortran 90 creating an array of unknown size  Programming & Computer Science  3  
Fortran: creating array containing characters  Programming & Computer Science  1  
Variance of Sampling Distribution VS Sample Variance  Calculus & Beyond Homework  0 