search for: stepzero

Displaying 1 result from an estimated 1 matches for "stepzero".

Did you mean: set_zero
2000 Aug 22
0
Using RNG from MS [forwarded message from Xiaoqiang Li]
...ble mu ){ double d_y; int k; d_y=sqrt(-8*log(y)); k=(int)floor( (mu+d_y/2-z)/d_y ); return z+k*d_y; } double norm(double mu,double sigma,double x){ double pi=3.141592679565; return 1/sqrt(2*pi*sigma)*exp(-(x-mu)*(x-mu)/sigma/sigma/2); } void stepzero(double *X0, double *mu0, long *length, double *X1){ long i; double Z1, Y1; GetRNGstate(); Z1=rnorm(0,1); Y1=norm(0,1,Z1)*unif_rand(); for (i=0;i<*length;i++) X1[i]=MS(Z1,Y1,*X0+mu0[i]); PutRNGstate(); } ******************...