Normal distribution starting with a uniformed distribution

Click For Summary
SUMMARY

The discussion focuses on generating a normal distribution of velocities from a uniformly distributed sequence between [0,1] using FNT95 and Plato. The user seeks assistance in implementing a loop to populate velocity arrays VX, VY, and VZ. The solution involves using two independent uniform variables, U and V, to derive normally distributed variables X and Y with defined means and standard deviations. The formula provided effectively transforms uniform distributions into normal distributions, crucial for the user's project.

PREREQUISITES
  • Understanding of normal distribution and its properties
  • Familiarity with FNT95 programming language
  • Basic knowledge of statistical concepts like mean and standard deviation
  • Experience with array manipulation in programming
NEXT STEPS
  • Implement the provided formula for normal distribution in FNT95
  • Explore the use of the Box-Muller transform for generating normal variables
  • Research the implications of varying sigma in normal distributions
  • Learn about statistical libraries in FNT95 for enhanced functionality
USEFUL FOR

This discussion is beneficial for programmers, statisticians, and data analysts who are working on simulations involving normal distributions, particularly those using FNT95 and interested in statistical modeling techniques.

Jamil
Messages
8
Reaction score
0
Hi comunity! I need to make a code o a normal distribution of velocities, starting whit a random secuence uniformly distributed between [0,1]. I am using FNT95, with Plato. I want to obtain a ''for'' bucle with I=1,N for the velocities.
It is importan for the distribution to have sigma defined.
The code is:

Fortran:
PARAMETER (N=125)
INTEGER (SELECTED_INT_KIND(4)) I !Átomo I-ésimo
REAL, DIMENSION(1:N):: VX(N), VY(N), VZ(N)

    DO 200 I=1,N
    VX(I)=?¿
    VY(I)=?¿
    VZ(I)=?¿
    ENDDO
Could anyone help me?? Thank you! :nb)
 
Technology news on Phys.org
The simplest way to generate a normally distributed variable from uniform ones is probably to use two independent variables U, V, both uniformly distributed on [0,1].

If you want ## X\sim \mathcal{N}(\mu_X,\sigma_X) ## ,

Set ## X=\mu_X+\sigma_X \sqrt{-2 \ln(2\pi U)}\cos(2\pi V) ##

You actually obtain a pair of independent normal variables this way, the second one being :

## Y=\mu_Y+\sigma_Y \sqrt{-2 \ln(2\pi U)}\sin(2\pi V) ##

The reason behind this comes from looking at the bivariate normal distribution in polar coordinates.
 
Last edited:
  • Like
Likes jim mcnamara
thank you! I have seen this algorithm before, but with sigma=1. It is very useful to my proyect! Thans again! :smile:
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K