摘要: 为在代码开发中应用逆t分布进行计算,分析并实现一种数值算法。基于不完全Beta函数,利用公式推导得到不完全Beta函数的逆近似值,采用哈雷求根法求出其精确解,根据精确解得到逆t分布的值。该算法是对Matlab实现算法的一种补充,适用于需要嵌入代码的项目。通过C++实现算法,将其计算结果与Excel,Matlab进行对比,结果显示相对误差低于10-11,验证了该算法在工程应用中的正确性。
关键词:
逆t分布,
不完全Beta函数,
Matlab仿真,
相对误差
Abstract: To utilize the inverse t-distribution in a practical code development project,a numerical algorithm based on the incomplete Beta function is analyzed and implemented.First,an initial approximation of the inverse of incomplete Beta function is deducted according to the formula.Then Halley root-finding algorithm is employed to hunt exact solution of the inverse.At last,the value of inverse t-distribution is obtained on the base of exact solution.The analyzed algorithm can be regarded as a supplement to that of Matlab.It can be applied to the project needing to calculate the value of inverse t-distribution in code embedding manner.The algorithm is implemented in C++ language.Compared with the result of Matlab and Excel,the relative error between the algorithm and Matalb and Excel is less than 10-11,this data shows the correctness of the algorithm in engineering applications.
Key words:
inverse t-distribution,
incomplete Beta function,
Matlab simulation,
relative error
中图分类号:
郝萌,范轶翔,夏翔,刘龙,王鹏,黄宁. 一种逆t分布数值算法的原理与实现[J]. 计算机工程.
HAO Meng,FAN Yixiang,XIA Xiang,LIU Long,WANG Peng,HUANG Ning. Principle and Implementation of a Numerical Algorithm of Inverse t-distribution[J]. Computer Engineering.