R
ppoints函数描述如下:
Ordinates for Probability Plotting
Description:
Generates the sequence of probability points ‘(1:m - a)/(m +
(1-a)-a)’ where ‘m’ is either ‘n’, if ‘length(n)==1’, or
‘length(n)’.
Usage:
ppoints(n, a = ifelse(n <= 10, 3/8, 1/2))
...
我一直试图在python
中复制这个函数,但我有几个疑问。在
1-如果(1:m - a)/(m + (1-a)-a)
中的第一个m
总是一个整数:int(n)
(即,n
的整数),否则length(n)==1
和{
2-同一等式中的第二个m
如果length(n)==1
(它假设n
的实值),则它是一个整数(length(n)
),否则它是一个整数(length(n)
)。在
3-在a = ifelse(n <= 10, 3/8, 1/2)
中的n
是实数数n
如果length(n)==1
,则是整数length(n)
。在
这一点在描述中根本没有说清楚,如果有人能证实这一点,我将非常感激。在
这篇文章最初是在https://stats.stackexchange.com/上发布的,因为我希望得到处理ppoints
函数的静态人员的输入。因为它已经迁移到这里,所以我将粘贴到我写的函数下面,在python
中复制ppoints
。我已经对它进行了测试,结果似乎都是一样的,但是如果有人能澄清上面的观点,我会很高兴的,因为它们根本没有被函数的描述弄清楚。在
我会用numpy来实现:
样本输出:
^{pr2}$可以使用R fiddle来测试实现。在
相关问题 更多 >
编程相关推荐