Reputation: 291
If I want to use the gaussian random number generator in MATLAB
R = normrnd(mu,sigma)
Let mu = 1
.
The question is how to choose sigma? If I want 90% of the values to be near 1.Let us say +/-0.7
Thanks
Upvotes: 2
Views: 1920
Reputation: 21597
It depends on what you mean by "near 1". In a normal distribution, 90% of the values will be within 1.65 standard deviations of the mean (about 5 % above and about 5% below). For example, if you want 90% of the values to be between 0.5 and 1.5, you need
1.65 * sigma ~= 0.5
sigma ~= 0.5 / 1.65
sigma ~= 0.3
You can look at a normal distribution table to look up the other values.
The table (excerpted below) states that ~45% of the values of a normal distribution fall between the mean and 1.65*sigma above the mean. Since the distribution is symmetric, ~45% of the values fall between the mean and 1.65*sigma below the mean and ~90% fall within +- 1.65 * sigma of the mean.
Area under the Normal Curve from 0 to X
X 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
1.5 0.43319 0.43448 0.43574 0.43699 0.43822 0.43943 0.44062 0.44179 0.44295 0.44408
1.6 0.44520 0.44630 0.44738 0.44845 0.44950 0.45053 0.45154 0.45254 0.45352 0.45449
1.7 0.45543 0.45637 0.45728 0.45818 0.45907 0.45994 0.46080 0.46164 0.46246 0.46327
Upvotes: 5