【问题标题】:Convert Z-Score to Percentile (objective-c) [closed]将 Z 分数转换为百分位数(objective-c)[关闭]
【发布时间】:2013-11-27 14:47:41
【问题描述】:

我已经使用平均值和标准差计算了一大堆 z 分数,现在我希望将它们变成百分位数。 iPhone应用程序在objective-c中执行此操作的方法是什么?

我只是在高中的统计课上使用 z-score 图表做到了这一点。

我发现这个等式是我想要重新创建的一个:

这个线程Cumulative Normal Distribution function in objective C 似乎是一个答案,但我仍然不明白发生了什么。谁能向我解释这一切是如何运作的?比如erfc函数是什么?

0.5 * erfc(z-score * M_SQRT1_2); 会起作用吗?

提前致谢!

【问题讨论】:

  • 好吧,从找到算法开始,然后实现它。这个问题太模糊了。 “我只是不确定哪个是正确的”在什么和什么之间?来吧提供一些信息!
  • 你明白了,看看编辑

标签: ios objective-c math statistics


【解决方案1】:

好的,我找到了解决方案。

第二个等式返回百分位数,其中 x 是 z 分数。

所以0.5 * (1 + erf(z_score*M_SQRT1_2))是我问题的答案

还有,erfc(x) = 1 - erf(x)

【讨论】:

    【解决方案2】:

    我学过微积分,但从未学过统计数据,而且我很长时间都无法不费吹灰之力地记住这些东西。我可以提供的一件事是如何查找 erfc 函数。打开终端应用程序并输入“man erfc”,这将为您提供该功能的 UNIX 手册页。这是它显示的第一部分:

    名字 erf, erfc -- 误差函数运算符

    概要 #包括

     double
     erf(double x);
    
     long double
     erfl(long double x);
    
     float
     erff(float x);
    
     double
     erfc(double x);
    
     long double
     erfcl(long double x);
    
     float
     erfcf(float x);
    

    描述 这些函数计算 x 的误差函数。

     The erf() function calculates the error function of x; where
    
           erf(x) = 2/sqrt(pi)*integral from 0 to x of exp(-t*t) dt.
    
     The erfc() function calculates the complementary error function of x; that is erfc() com-
     putes the difference of the error function erf(x) from 1.0.  This is useful, since for
     large x use of erfc() avoids loss of precision due to cancellation.
    

    特殊价值 erf(+-0) 返回 +-0。

     erf(+-infinity) returns +-1.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-20
      • 1970-01-01
      • 1970-01-01
      • 2011-07-29
      • 1970-01-01
      • 2012-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多