How to generate a sequence based on minimum value, maximum value and standard deviation
高洛峰
高洛峰 2017-05-16 13:29:42
0
1
718

To do experiments, you need to generate a sequence based on the minimum value, maximum value and standard deviation. The programming language is not limited. Please provide an idea. The size of the sequence is about 1000

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
阿神

The questioner did not explain the specific requirements for a random number sequence, such as whether it is an integer or a real number, what statistical distribution needs to be met, etc. It is assumed here that the subject needs to generate real numbers and the distribution is centrally symmetric. This distribution might as well be constructed using the Beta distribution, since it allows for adjustment of the standard deviation. If the random variable is taken as

$$min+(max - min) X,quad X sim Beta{(alpha, alpha)}$$

It is easy to calculate the standard deviation at this time as

$$s = frac{max - min}{2sqrt{1+2alpha}}$$

That’s

$$alpha = frac{(max-min)^2}{8s^2}-frac{1}{2}$$

Through the above analysis, it is easy to write code with Mathematica:

Test the effect. Take the minimum value 20, the maximum value 100, and the standard deviation 15:

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template