public void SampleArrayTest() { var normal = new Normal(0.0, 1.0); var rnd = new MersenneTwister(); var ms = new MetropolisHastingsSampler <double>(0.2, normal.Density, (x, y) => (new Normal(x, 0.1)).Density(y), x => Normal.Sample(rnd, x, 0.1), 10) { RandomSource = rnd }; ms.Sample(5); }
public void SampleTest() { var normal = new Normal(0.0, 1.0); var rnd = new MersenneTwister(); var ms = new MetropolisHastingsSampler<double>(0.2, normal.Density, (x, y) => (new Normal(x, 0.1)).Density(y), x => Normal.Sample(rnd, x, 0.1), 10) { RandomSource = rnd }; ms.Sample(); }
public void SampleArrayTest() { var normal = new Normal(0.0, 1.0); var rnd = new SystemRandomSource(1); var ms = new MetropolisHastingsSampler <double>(0.2, normal.Density, (x, y) => Normal.PDF(x, 0.1, y), x => Normal.Sample(rnd, x, 0.1), 10) { RandomSource = rnd }; ms.Sample(5); }
public void SampleTest() { var normal = new Normal(0.0, 1.0); var rnd = new SystemRandomSource(1); var ms = new MetropolisHastingsSampler<double>(0.2, normal.Density, (x, y) => Normal.PDF(x, 0.1, y), x => Normal.Sample(rnd, x, 0.1), 10) { RandomSource = rnd }; ms.Sample(); }