略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: stats_dens_normal

2024-12-26

stats_dens_normal

(PECL stats >= 1.0.0)

stats_dens_normalProbability density function of the normal distribution

说明

stats_dens_normal ( float $x , float $ave , float $stdev ) : float

Returns the probability density at x, where the random variable follows the normal distribution of which the mean is ave and the standard deviation is stdev.

参数

x

The value at which the probability density is calculated

ave

The mean of the distribution

stdev

The standard deviation of the distribution

返回值

The probability density at x or FALSE for failure.

add a note add a note

User Contributed Notes 2 notes

up
0
Anonymous
10 years ago
I'm not certain that I've figured this one out correctly but it should return the value of a (Gaussian) normal distribution of the given properties at the given location.
$x - the X-Value to request
$ave - the 'expected value' (i.e. location of the peak) for the distribution. For most uses this will just be 0.
$stdev - the standard deviation of the distribution. For most uses this will be 1.
up
-2
Anonymous
9 years ago
There's a way to try it out:

<?php
...
echo
"<pre>\n";
for(
$x=-2;$x<=2;$x+=0.1){
  echo
"$i; ".stats_dens_normal($x,1,1)."\n";
}
echo
"</pre>\n";
?>

Observe the result (to determine yourself), or
save it as "stats_dens_normal.csv",
load it into Open Office and make a graph of it

官方地址:https://www.php.net/manual/en/function.stats-dens-normal.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3