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:
 

FAQ: Normal distribution starting with a uniformed distribution

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.

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.

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.

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.

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

Replies
12
Views
2K
Replies
5
Views
2K
Replies
8
Views
4K
Replies
6
Views
2K
Replies
4
Views
1K
Replies
7
Views
4K
Replies
2
Views
5K
Replies
4
Views
3K
Replies
6
Views
2K
Replies
3
Views
2K
Back
Top