damker 发表于 2010-3-8 15:40 
想知道如何计算两个正态分布的重叠面积,有现成的公式或者现成的计算程序吗?最好是较常用的编程语言。
//bow
Here is the example to calculate 两个正态分布的重叠面积 in SAS/IML with call quad routine. See detail explaination in PGM.
****numerical integration***;
proc iml;
/* Define the integrand */
start fun(t) global (cnt);
cnt=cnt+1;
/*PDF('NORMAL',t , 1, 1)=normal (1,1)
PDF('NORMAL',t , 0, 1 ) ) = normal (0,1)*/
/* Overlap parts = integal of (-m to +m) v dx */
v = min( PDF('NORMAL',t , 1, 1), PDF('NORMAL',t , 0, 1 ) );
return(v);
finish;
/* Call QUAD */
a = { .M .P};
cnt=0;
call quad(z,"fun",a);
print z[format=best.] cnt;
quit;