Example #1
0
 StudentsTDistribution()
     : base()
 {
     _standardDistribution  = new StandardDistribution(RandomSource);
     _chiSquareDistribution = new ChiSquareDistribution(RandomSource);
     SetDistributionParameters(1);
 }
 LognormalDistribution(
     double mu,
     double sigma)
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(mu, sigma);
 }
 StudentsTDistribution()
     : base()
 {
     _standardDistribution = new StandardDistribution(RandomSource);
     _chiSquareDistribution = new ChiSquareDistribution(RandomSource);
     SetDistributionParameters(1);
 }
Example #4
0
 LognormalDistribution(
     RandomSource random
     )
     : base(random)
 {
     _standard = new StandardDistribution(random);
     SetDistributionParameters(0.0, 1.0);
 }
Example #5
0
 ChiSquareDistribution(
     int degreesOfFreedom
     )
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(degreesOfFreedom);
 }
Example #6
0
 ChiSquareDistribution(
     RandomSource random
     )
     : base(random)
 {
     _standard = new StandardDistribution(random);
     SetDistributionParameters(1);
 }
 ChiSquareDistribution(
     RandomSource random
     )
     : base(random)
 {
     _standard = new StandardDistribution(random);
     SetDistributionParameters(1);
 }
 NormalDistribution(
     RandomSource random
     )
     : base(random)
 {
     _standard = new StandardDistribution(random);
     SetDistributionParameters(0.0, 1.0);
 }
Example #9
0
 StudentsTDistribution(
     int degreesOfFreedom
     )
     : base()
 {
     _standardDistribution  = new StandardDistribution(RandomSource);
     _chiSquareDistribution = new ChiSquareDistribution(RandomSource);
     SetDistributionParameters(degreesOfFreedom);
 }
Example #10
0
 NormalDistribution(
     double mu,
     double sigma
     )
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(mu, sigma);
 }
 public void TestOrthogonalReflection()
 {
     StandardDistribution gaussian = new StandardDistribution();
     for(int i = 0; i < 100; i++)
     {
         Vector v = Vector.Random(4, gaussian);
         Matrix reflection = Orthogonal.Reflection(v);
         Vector res = reflection * v;
         Assert.That(Matrix.Transpose(reflection) * reflection, NumericIs.AlmostEqualTo(Matrix.Identity(4, 4)), "orthogonal reflection matrix");
         Assert.That(reflection.Norm2(), NumericIs.AlmostEqualTo((double) 1), "reflection matrix norm");
         Assert.That(Math.Abs(res[0]), NumericIs.AlmostEqualTo(v.Norm(), 1e-12), "res(1)");
         Assert.That(res[1], NumericIs.AlmostEqualTo((double) 0, 1e-12), "res(2)");
         Assert.That(res[2], NumericIs.AlmostEqualTo((double) 0, 1e-12), "res(3)");
         Assert.That(res[3], NumericIs.AlmostEqualTo((double) 0, 1e-12), "res(4)");
     }
 }
 public void TestOrthogonalReflectionComplex()
 {
     StandardDistribution gaussian = new StandardDistribution();
     for(int i = 0; i < 100; i++)
     {
         ComplexVector v = new ComplexVector(new Complex[] { Complex.Random(gaussian), Complex.Random(gaussian), Complex.Random(gaussian), Complex.Random(gaussian) });
         ComplexMatrix reflection = Orthogonal.Reflection(v);
         ComplexVector res = reflection * v;
         Assert.That(reflection.HermitianTranspose() * reflection, NumericIs.AlmostEqualTo(ComplexMatrix.Identity(4, 4)), "orthogonal reflection matrix");
         Assert.That(reflection[0, 0].IsReal, "c1 real");
         Assert.That(reflection[1, 1].IsReal, "c2 real");
         Assert.That(reflection[2, 2].IsReal, "c3 real");
         Assert.That(reflection[3, 3].IsReal, "c4 real");
         Assert.That(res[0].Modulus, NumericIs.AlmostEqualTo(v.Norm(), 1e-12), "res(1)");
         Assert.That(res[1], NumericIs.AlmostEqualTo((Complex) 0, 1e-12), "res(2)");
         Assert.That(res[2], NumericIs.AlmostEqualTo((Complex) 0, 1e-12), "res(3)");
         Assert.That(res[3], NumericIs.AlmostEqualTo((Complex) 0, 1e-12), "res(4)");
     }
 }
Example #13
0
 ChiDistribution()
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(1);
 }
 /// <summary>
 /// Initializes a new instance of the LognormalDistribution class,
 /// using a <see cref="SystemRandomSource"/> as underlying random number generator.
 /// </summary>
 public LognormalDistribution()
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(0.0, 1.0);
 }
 /// <summary>
 /// Initializes a new instance of the LognormalDistribution class,
 /// using a <see cref="SystemRandomSource"/> as underlying random number generator.
 /// </summary>
 public LognormalDistribution(
     double mu,
     double sigma)
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(mu, sigma);
 }
Example #16
0
 /// <summary>
 /// Initializes a new instance, using a <see cref="SystemRandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 public ChiDistribution()
     : base()
 {
     SetDistributionParameters(1);
     _standard = new StandardDistribution(this.RandomSource);
 }
 ChiSquareDistribution(
     int degreesOfFreedom
     )
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(degreesOfFreedom);
 }
 /// <summary>
 /// Initializes a new instance, using a <see cref="SystemRandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 public ChiDistribution(int degreesOfFreedom)
     : base()
 {
     SetDistributionParameters(degreesOfFreedom);
     _standard = new StandardDistribution(this.RandomSource);
 }
 /// <summary>
 /// Initializes a new instance, using a <see cref="SystemRandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 public ChiDistribution()
     : base()
 {
     SetDistributionParameters(1);
     _standard = new StandardDistribution(this.RandomSource);
 }
Example #20
0
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public ChiDistribution(RandomSource random)
     : base(random)
 {
     SetDistributionParameters(1);
     _standard = new StandardDistribution(random);
 }
 StudentsTDistribution(
     int degreesOfFreedom
     )
     : base()
 {
     _standardDistribution = new StandardDistribution(RandomSource);
     _chiSquareDistribution = new ChiSquareDistribution(RandomSource);
     SetDistributionParameters(degreesOfFreedom);
 }
Example #22
0
 /// <summary>
 /// Initializes a new instance, using a <see cref="SystemRandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 public ChiDistribution(int degreesOfFreedom)
     : base()
 {
     SetDistributionParameters(degreesOfFreedom);
     _standard = new StandardDistribution(this.RandomSource);
 }
 NormalDistribution()
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(0.0, 1.0);
 }
Example #24
0
 ChiDistribution(int degreesOfFreedom)
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(degreesOfFreedom);
 }
 NormalDistribution(
     double mu,
     double sigma
     )
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(mu, sigma);
 }
Example #26
0
 LognormalDistribution()
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(0.0, 1.0);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public ChiDistribution(RandomSource random)
     : base(random)
 {
     SetDistributionParameters(1);
     _standard = new StandardDistribution(random);
 }
Example #28
0
 /// <summary>
 /// Initializes a new instance of the ChiDistribution class,
 /// using a <see cref="SystemRandomSource"/> as underlying random number generator.
 /// </summary>
 public ChiDistribution()
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(1);
 }
Example #29
0
 ChiSquareDistribution()
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(1);
 }
Example #30
0
 /// <summary>
 /// Initializes a new instance of the ChiDistribution class,
 /// using a <see cref="SystemRandomSource"/> as underlying random number generator.
 /// </summary>
 public ChiDistribution(int degreesOfFreedom)
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(degreesOfFreedom);
 }
Example #31
0
 NormalDistribution()
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(0.0, 1.0);
 }
 ChiSquareDistribution()
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(1);
 }