Serving the Quantitative Finance Community

 
User avatar
zeta
Topic Author
Posts: 26
Joined: September 27th, 2005, 3:25 pm
Location: Houston, TX
Contact:

acceptance/rejection methods and quasi numbers

July 24th, 2007, 11:13 am

The idea is simple, I want to use quasi random numbers in sampling (say) the gamma distribution. Problem is that in acceptance/rejection methods I will lose some fraction of the (say) sobol set and therefore what's gained in speed over pseudo RNG will be lost in convergence. I'm implementing marsaglia's method from 2000 using GSL for the sobol series.Any ideas guys and gals?
 
User avatar
LordR
Posts: 1
Joined: July 14th, 2002, 3:00 am

acceptance/rejection methods and quasi numbers

July 24th, 2007, 11:57 am

Yes - don't use them 'Just' invert the cdf...
 
User avatar
zeta
Topic Author
Posts: 26
Joined: September 27th, 2005, 3:25 pm
Location: Houston, TX
Contact:

acceptance/rejection methods and quasi numbers

July 24th, 2007, 12:07 pm

actually, maybe it isn't so bad for gamma, there's at least one article eg., this one hereso in all seriousness thank you!I'm trying to grid a MC simulation, each node considers a different piece of sample space which is why (amongst other reasons) I want to use all the numbers
 
User avatar
LordR
Posts: 1
Joined: July 14th, 2002, 3:00 am

acceptance/rejection methods and quasi numbers

July 24th, 2007, 2:25 pm

And thank you for a reference I hadn't found yet! Looks useful...
 
User avatar
zeta
Topic Author
Posts: 26
Joined: September 27th, 2005, 3:25 pm
Location: Houston, TX
Contact:

acceptance/rejection methods and quasi numbers

July 24th, 2007, 10:40 pm

thanks outrun, I should have used the search function before I go to the trouble of coding up the solution in the paper, I've dug up and tried to implement the inv cdf funtions in gsl. No joy so far, but I may have made a stupid mistake:gsl_qrng *qq = gsl_qrng_alloc(gsl_qrng_sobol, 2);double A=30.0;double B=4.0;for (i = 0; i < 256; i++){ double vv[2];gsl_qrng_get(qq, vv);double cc=gsl_cdf_gamma_Pinv(vv[0],A,B);printf("%f\n",cc);}
 
User avatar
zeta
Topic Author
Posts: 26
Joined: September 27th, 2005, 3:25 pm
Location: Houston, TX
Contact:

acceptance/rejection methods and quasi numbers

July 25th, 2007, 12:40 pm

no such luck but the good news is that the following works:gsl_qrng *qq = gsl_qrng_alloc(gsl_qrng_sobol, 2);sob_ptr=malloc(256*sizeof(double));gam_ptr=malloc(256*sizeof(double));double A=3.0;double B=4.0;for (i = 0; i < 256; i++) { double vv[2]; gsl_qrng_get(qq, vv);*(sob_ptr+i)=vv[0];*(gam_ptr+i)=gsl_cdf_gamma_Qinv(*(sob_ptr+i),A,B); /* printf("%f\n",*(gam_ptr+i)); */}I had simply forgotten to #include <gsl/gsl_cdf.h> each node in the cluster works on a different part of sample space, all I hand to the exec as arguments are the a)proc number b)total procsThanks again guys
 
User avatar
zeta
Topic Author
Posts: 26
Joined: September 27th, 2005, 3:25 pm
Location: Houston, TX
Contact:

acceptance/rejection methods and quasi numbers

July 25th, 2007, 1:03 pm

That's a good suggestion, I'll try to get my head around it. Although on the plus side, if one node drops out under condor, another will be brought in, it's fairly easy. Unless of course you've asked for all the CPU's This is an ongoing physics simulation project whose code will be directly applicable to, well, you know