Gnuplot:不完整的 beta 函数

Gnuplot: Incomplete beta function

Gnuplot 的 ibeta 函数似乎以一种在靠近域边界的常规输入上失败的方式实现,但对于更近的方法则不一致。

例如,我得到以下结果(在 Gnuplot 5.2 补丁级别 8 上):

gnuplot> print ibeta(.1,1e-3,.93), ibeta(.1,1e-3,.94), ibeta(.1,1e-3,.95)   
0.0123146537078641 0.0124763579765399
gnuplot> print ibeta(.1,1e-3,.93), ibeta(.1,1e-3,.94), ibeta(.1,1e-3,.95) 
                                                       ^
         undefined value

或者,更奇怪的是,

gnuplot> print ibeta(.1,5e-3,.93)   
0.0591743782874705
gnuplot> print ibeta(.1,5e-3,.95)   

gnuplot> print ibeta(.1,5e-3,.95) 
               ^
         undefined value

gnuplot> print ibeta(.1,5e-3,.99)   
0.0685440281786021

有没有办法改变一些敏感度阈值或诸如此类的东西让 gnuplot 计算更接近边界?

恐怕不会。 ibeta 的当前 gnuplot 实现使用连续分数近似,在有效域中具有已知限制。来自当前文档:

gnuplot> help ibeta
 The `ibeta(p,q,x)` function returns the incomplete beta function of the real
 parts of its arguments. p, q > 0 and x in [0:1].  If the arguments are
 complex, the imaginary components are ignored.  The function is approximated by
 the method of continued fractions (Abramowitz and Stegun, 1964).
 The approximation is only accurate in the region x < (p-1)/(p+q-2). 

您显示的参数不在此限制域内。

gnuplot 现在有一个开发分支,其重点是更新对复杂函数的支持、精度更高的新算法以及一组扩展的特殊函数。我不希望它很快就会出现在新的发布版本中,但我会将 ibeta() 添加到候选函数列表中进行更新,如果它还不存在的话。