/// <summary> /// 연속 균일 분포의 샘플을 생성합니다. /// </summary> public static IEnumerable<double> Samples(Random rnd, double lower, double upper) { rnd.ShouldNotBeNull("rnd"); AssertParameters(lower, upper); while(true) yield return DoSample(rnd, lower, upper); }
public static IEnumerable<double> Samples(Random rnd, double alpha, double beta) { rnd.ShouldNotBeNull("rnd"); AssertParameters(alpha, beta, 1, 0); return DoSamples(rnd, alpha, beta); }
public static double Sample(Random rnd, double location, double scale) { rnd.ShouldNotBeNull("rnd"); AssertParameters(location, scale); return DoSample(rnd, location, scale); }
/// <summary> /// 연속 균일 분포의 샘플을 생성합니다. /// </summary> public static double Sample(Random rnd, double lower, double upper) { rnd.ShouldNotBeNull("rnd"); AssertParameters(lower, upper); return DoSample(rnd, lower, upper); }
public static double Sample(Random rnd, double shape, double invScale) { rnd.ShouldNotBeNull("rnd"); AssertParameters(shape, invScale); return DoSample(rnd, shape, invScale); }
public static IEnumerable<double> Samples(Random rnd, double shape, double invScale) { rnd.ShouldNotBeNull("rnd"); AssertParameters(shape, invScale); while(true) yield return DoSample(rnd, shape, invScale); }
public static IEnumerable<double> Samples(Random rnd, double scale, double shape) { rnd.ShouldNotBeNull("rnd"); AssertParameters(scale, shape); return DoSamples(rnd, scale, shape); }
public static IEnumerable<int> Samples(Random rnd, double p, int n) { rnd.ShouldNotBeNull("rnd"); AssertParameters(p, n); return DoSamples(rnd, p, n); }
/// <summary> /// 지수 분포의 샘플을 제공합니다. /// </summary> /// <param name="rnd"></param> /// <param name="lambda"></param> /// <returns></returns> public static double Sample(Random rnd, double lambda) { rnd.ShouldNotBeNull("rnd"); AssertParameters(lambda); return DoSample(rnd, lambda); }
public IEnumerable<double> Samples(Random rnd, double location, double scale, double dof) { rnd.ShouldNotBeNull("rnd"); AssertParameters(location, scale, dof); return DoSamples(RandomSource, dof).Select(x => location + (scale * x)); }
public static double Sample(Random rnd, double scale) { rnd.ShouldNotBeNull("rnd"); AssertParameters(scale); return DoSamples(rnd, scale).First(); }
public IEnumerable<double> Samples(Random rnd, double d1, double d2) { rnd.ShouldNotBeNull("rnd"); AssertParameters(d1, d2); while(true) yield return DoSample(rnd, d1, d2); }
public double Sample(Random rnd, double d1, double d2) { rnd.ShouldNotBeNull("rnd"); AssertParameters(d1, d2); return DoSample(rnd, d1, d2); }