ポイント推定計算ツール
最良の推定値 = 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); }