示例#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);
 }
示例#4
0
 LognormalDistribution(
     RandomSource random
     )
     : base(random)
 {
     _standard = new StandardDistribution(random);
     SetDistributionParameters(0.0, 1.0);
 }
示例#5
0
 ChiSquareDistribution(
     int degreesOfFreedom
     )
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(degreesOfFreedom);
 }
示例#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);
 }
示例#9
0
 StudentsTDistribution(
     int degreesOfFreedom
     )
     : base()
 {
     _standardDistribution  = new StandardDistribution(RandomSource);
     _chiSquareDistribution = new ChiSquareDistribution(RandomSource);
     SetDistributionParameters(degreesOfFreedom);
 }
示例#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)");
     }
 }
示例#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);
 }
示例#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);
 }
示例#18
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);
 }
示例#19
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);
 }
示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#26
0
 LognormalDistribution()
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(0.0, 1.0);
 }
示例#27
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);
 }
示例#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);
 }
示例#29
0
 ChiSquareDistribution()
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(1);
 }
示例#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);
 }
示例#31
0
 NormalDistribution()
 {
     _standard = new StandardDistribution(RandomSource);
     SetDistributionParameters(0.0, 1.0);
 }
 ChiSquareDistribution()
     : base()
 {
     _standard = new StandardDistribution(this.RandomSource);
     SetDistributionParameters(1);
 }