在php中用小数据生成不同的钟形曲线
我希望能够从很少的数据生成这些钟形曲线:
我正在寻找 php 中的函数这将为我提供这些钟形曲线生成的数据。我还不知道用什么来显示它们,但我首先需要数据。
我不太擅长数学,我尝试过创建一些正态分布,但没有一种简单的方法可以说:“我想要一条细钟形曲线”或“我想要一条大钟形曲线”。
也许使用上图右侧顶部的参数可能会很酷。
有人知道我如何在 PHP 中重现这些图表的数据点吗?
谢谢你!
I would like to be able to generate these bellcurves from very little data:
I'm looking for a function in php that would give me the data generated by these bell curves. I don't know yet what I'm going to use to display them, but I need the data first.
I'm not very good at math, I've tried creating some normal distribution, but there isn't an easy way to say: "I want a thin bell curve" or "I want a large one".
Maybe using the arguments that are on top of the right side of the picture above might be cool.
Would someone know how I can reproduce the datapoints of these graphs in PHP ?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,你可以在维基百科上查找正态分布概率密度的公式。
该函数的 PHP 实现如下所示:
该函数将为您提供您发布的钟形曲线的值。
我真的建议你阅读有关该函数的维基百科文章,但简单来说,
$mu
标记了钟形曲线中心峰值的位置,而$sigma
则确定了它的中心峰值位置。宽度($sigma
的值越大意味着分布越宽)。Well, you could look up the formula of the normal distribution's probability density on Wikipedia.
A PHP implementation of this function would look like this:
This function will give you the value of the bell curves you posted.
I really suggest you read the Wikipedia article on the function, but to put it simply,
$mu
marks the position of the central peak of the bell curve and$sigma
determines its width (a larger value for$sigma
means a broader distribution).