double cls_random::randomBeta( double alpha, double beta) { /*Johnk's beta generator*/ double u, v; double x, y; do { u=cls_random::randomUniform(); v=cls_random::randomUniform(); x=pow(u,1/alpha); y=pow(v,1/beta); } while (x+y>1); return x/(x+y); }
期望:
方差:V=