Normal distribution starting with a uniformed distribution

In summary, the person is seeking help with creating a code for a normal distribution of velocities using FNT95 and Plato. They mention the importance of defining sigma and request assistance in creating a "for" loop for the velocities. They also mention a possible algorithm for generating a normally distributed variable from uniform ones. The conversation ends with the person expressing gratitude for the helpful algorithm.
  • #1
Jamil
8
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
  • #2
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
  • #3
thank you! I have seen this algorithm before, but with sigma=1. It is very useful to my proyect! Thans again! :smile:
 

1. What is a normal distribution?

A normal distribution is a type of probability distribution that represents a bell-shaped curve when graphed. It is often used to describe natural phenomena such as human intelligence, height and weight, and measurement errors.

2. How does a normal distribution start with a uniformed distribution?

In a uniformed distribution, all values have an equal chance of occurring. However, as more data points are added, the distribution gradually becomes more and more normal. This is due to the central limit theorem, which states that the means of a large number of random samples from a population will approximate a normal distribution, regardless of the shape of the original distribution.

3. What are the characteristics of a normal distribution?

A normal distribution is symmetrical, meaning that the mean, median, and mode are all equal and located at the center of the curve. It is also continuous, meaning that it has no gaps or jumps, and it is asymptotic, meaning that the curve approaches but never touches the x-axis.

4. How is the normal distribution used in statistics?

The normal distribution is used in statistics to make predictions and estimates about a population based on a sample. It is also used to calculate probabilities for events, such as finding the probability of a certain score on a test based on the average and standard deviation of the test scores.

5. What is the significance of the standard deviation in a normal distribution?

The standard deviation is a measure of how spread out the data points are in a normal distribution. It is used to describe the variability of the data and to calculate probabilities. In a normal distribution, approximately 68% of the data falls within one standard deviation of the mean, 95% falls within two standard deviations, and 99.7% falls within three standard deviations.

Similar threads

  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
5
Views
1K
  • High Energy, Nuclear, Particle Physics
Replies
6
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
7
Views
4K
  • Programming and Computer Science
Replies
2
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Programming and Computer Science
Replies
4
Views
2K
  • High Energy, Nuclear, Particle Physics
Replies
3
Views
2K
  • Astronomy and Astrophysics
Replies
4
Views
2K
Back
Top