You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

19 lines
478 B

import defaultSource from "./defaultSource.js";
import irwinHall from "./irwinHall.js";
export default (function sourceRandomBates(source) {
var I = irwinHall.source(source);
function randomBates(n) {
// use limiting distribution at n === 0
if ((n = +n) === 0) return source;
var randomIrwinHall = I(n);
return function() {
return randomIrwinHall() / n;
};
}
randomBates.source = sourceRandomBates;
return randomBates;
})(defaultSource);