积分估算计算器
最佳估计 = 0.45695
估计 MLE 点 = 0.45161
估计威尔逊点 = 0.45695
杰弗里点估计 = 0.45313
估计拉普拉斯点 = 0.45455
function calc() {
//get input values var x = document.getElementById('x').value*1; var n = document.getElementById('n').value*1; var conf = (1 - document.getElementById('conf').value/100)/2; var z = Math.abs(jStat.normal.inv(conf, 0, 1));
//find estimates var mle = x/n; var wilson = (x - ((-z*z)/2)) / (n - (-z*z)); var jeffrey = (x - (-.5)) / (n - (-1)); var laplace = (x - (-1)) / (n - (-2));
//find best estimate var val = x/n; var best = x/n; if (val <= 0.5) { best = wilson; } else if (val < 0.9) { best = mle; } else if (val < 1) { best = Math.min(laplace, jeffrey); } else { best = laplace; } //output results document.getElementById('best').innerHTML = best.toFixed(5); document.getElementById('mle').innerHTML = mle.toFixed(5); document.getElementById('wilson').innerHTML = wilson.toFixed(5); document.getElementById('jeffrey').innerHTML = jeffrey.toFixed(5); document.getElementById('laplace').innerHTML = laplace.toFixed(5); }