摘要
为在代码开发中应用逆t分布进行计算,分析并实现一种数值算法。基于不完全Beta函数,利用公式推导得到不完全Beta函数的逆近似值,采用哈雷求根法求出其精确解,根据精确解得到逆t分布的值。该算法是对M atlab实现算法的一种补充,适用于需要嵌入代码的项目。通过C++实现算法,将其计算结果与Excel,M atlab进行对比,结果显示相对误差低于10-11,验证了该算法在工程应用中的正确性。
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
出处
《计算机工程》
CAS
CSCD
北大核心
2015年第7期91-94,共4页
Computer Engineering