http://upload.wikimedia.org/wikipedia/commons/d/d7/Tail_Function_Graph.pdf gaussian tail 近似式 は 1/(x*sqrt(2*pi))*exp(-x*x/2)) Gaussianとは1/sigma*sqrt(2*pi)*exp{-x*x/(2*sigma*sigma)} erfc=1-erf(x) erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(-t*t) dt だからgaus分布に使うときは Prob(>x)=2.*erf(x/sqrt(2))と使わなくてはならない。 ============================================- erfc.cxx program #include #include int main() { for (int i=0; i<30; i++) { //for (double x=0.;x<6.; x+=0.1){ double x=i*0.5; double y=0.5*erfc(x/sqrt(2.)); double xx=x; double yy=1./(xx*sqrt(2.*3.141592))*exp(-xx*xx/2.); for (int j=0; j<1000000; j++){ xx=j*0.0001; //double y1=1./(xx*sqrt(2.*3.141592))*exp(-xx*xx/2.); double y1=0.5*erfc(xx/sqrt(2.)); if(y1x "<x:0.0001 0.5 0.308538 0.704131 y->x:0.5001 1 0.158655 0.241971 y->x:1.0001 1.5 0.0668072 0.0863451 y->x:1.5001 2 0.0227501 0.0269955 y->x:2.0001 2.5 0.00620967 0.00701132 y->x:2.5001 3 0.0013499 0.00147728 y->x:3.0001 3.5 0.000232629 0.000249338 y->x:3.5001 4 3.16712e-05 3.34576e-05 y->x:4.0001 4.5 3.39767e-06 3.55194e-06 y->x:4.5001 5 2.86652e-07 2.97344e-07 y->x:5.0001 5.5 1.89896e-08 1.95814e-08 y->x:5.5001 6 9.86588e-10 1.01265e-09 y->x:6.0001 6.5 4.016e-11 4.10701e-11 y->x:6.5001 7 1.27981e-12 1.30496e-12 y->x:7.0001 7.5 3.19089e-14 3.24576e-14 y->x:7.5001 8 6.22096e-16 6.31534e-16 y->x:8.0001 8.5 9.47953e-18 9.60734e-18 y->x:8.5001 9 1.12859e-19 1.1422e-19 y->x:9.0001 9.5 1.04945e-21 1.06084e-21 y->x:9.5001 10 7.61985e-24 7.6946e-24 y->x:10.0001 10.5 4.31901e-26 4.3575e-26 y->x:10.5001 11 1.91066e-28 1.9262e-28 y->x:11.0001 11.5 6.59577e-31 6.64492e-31 y->x:11.5001 12 1.77648e-33 1.78865e-33 y->x:12.0001 12.5 3.73256e-36 3.75616e-36 y->x:12.5001 13 6.11716e-39 6.15295e-39 y->x:13.0001 13.5 7.81881e-42 7.86125e-42 y->x:13.5001 14 7.79354e-45 7.8329e-45 y->x:14.0001 14.5 6.05749e-48 6.08604e-48 y->x:14.5001