monte carlo

Simulations

Overview


Other Distributions


Once you have a generator for a uniform distribution, you can get a generator for any distribution for which you have a function that is the inverse cumulative function, using the following formula.

{% X = F^{-1}(U) %}

The following code geneartes 100 samples takne from a anormal distribution by using the inverse cumulative normal function.

let nm = await import('/lib/statistics/distributions/normal/v1.0.0/normal.js');
let sample = [];
for(let i=0;i<100;i++){ 
	sample.push(nm.invCumulative(Math.random()));
}
					

Contents