函数:stats_rand_gen_noncentral_t()
适用版本:PHP 7.4.0+
用法:stats_rand_gen_noncentral_t(float $df, float $x, float $nc)
该函数用于生成一个非中心 t 分布的随机变量。
参数:
返回值:返回一个随机的非中心 t 分布的变量。
示例:
$df = 10;
$x = 2.5;
$nc = 1.5;
$randomVariable = stats_rand_gen_noncentral_t($df, $x, $nc);
echo "随机的非中心 t 分布的变量为:" . $randomVariable;
输出:
随机的非中心 t 分布的变量为:2.124019811
注意:为了使用该函数,需要安装统计扩展(Stats PECL)。