dimanche 23 septembre 2018

Why is random number generation from a kernel distribution up to 1000x slower if truncated?

I would prefer to truncate my Distribution, but at the moment it is simply not possible given the time penalty.

Standard Kernel Distribution:

expectation=fitdist(BTS,'kernel');

Result:

tic;expectation.random(10000,1);toc;
Elapsed time is 0.000745 seconds.

Truncate Code:

Exp{i,j}=truncate(expectation,min(BTS)-1,max(BTS)+1);

Result:

tic;random(Exp{i,j},1,10000);toc
Elapsed time is 0.772295 seconds.




Aucun commentaire:

Enregistrer un commentaire