【问题标题】:mathematic statistical library for PHP [closed]PHP的数学统计库[关闭]
【发布时间】:2012-12-10 16:40:31
【问题描述】:

我想知道,是否有类似的统计测试库

  • t 检验
  • 方差分析测试
  • 科尔莫哥洛夫·斯米尔诺夫 等等..... 对于 PHP?

我找到了一个 pecl 扩展:http://php.net/manual/de/book.stats.php,它提供了一些基本参数,但还没有找到测试

【问题讨论】:

标签: php statistics


【解决方案1】:

如果你想要一个完整的 PHP 库你可以看看here,但我不知道它是否真的很好。

这个统计测试很牛逼,我不知道用php计算它是否是个不错的选择。正如 cmets 中所建议的,您应该用 R 语言编写脚本,然后调用它。 根据您的服务器架构,有两种方法可以调用另一种语言。假设你只有一台服务器,你可以使用proc_open

$descriptorspec = array(
   0 => array("pipe", "r"),  //a pipe where you will read
   1 => array("pipe", "w"),  //std out : a pipe where you will write
   2 => array("file", "/tmp/error-output.txt", "a") // stderr : a log file, not mandatory here
);
 $pipes = array();
$process = proc_open('R yourfile.r',$decriptorspec,$pipes);

fwrite($pipes[0],$yourStatsToBeCompute);
$result = stream_get_contents($pipes[1]);
fclose($pipes[0]);
fclose($pipes[1]);
proc_close($process);

您还可以使用 cURL 通过 RCurl 联系另一台服务器上的 Rscript。

【讨论】:

    猜你喜欢
    • 2012-02-04
    • 2011-07-04
    • 1970-01-01
    • 1970-01-01
    • 2011-06-08
    • 2011-04-28
    • 2015-01-27
    • 2010-10-11
    • 2013-01-29
    相关资源
    最近更新 更多