Exemple #1
0
        public void TestStudentTDistribution()
        {
            double[][] para =
            {
                new double[]
                {
                    12,
                    0,
                    -0.6954828655117925816605449,
                    0.3022177430388599749597682,
                    1.782287555649320074526381,
                    0.08490359467537564413509914
                }
            };

            for (int i = 0; i < para.Length; i++)
            {
                var tester = new ContDistTester(para[i], delegate(double a, double b)
                {
                    var ret = new StudentTDistribution
                    {
                        Nu = (int)a
                    };
                    return(ret);
                }
                                                );
                tester.Test(1e-7);
            }
        }
Exemple #2
0
 public void TestErlangDistribution()
 {
     double[][] para =
     {
         new double[] { 3.0, 0.5, 0.8636497089302596965312208, 0.530369629973745149272610, 3.147896810935994870892347, 0.0730924530353432559740299 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new ErlangDistribution((int)a, b);
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #3
0
 public void TestContinuousUniformDistribution()
 {
     double[][] para =
     {
         new double[] { 3, 5, 3.500000000000000000000000, 0.5000000000000000000000000, 4.900000000000000000000000, 0.5000000000000000000000000 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new ContinuousUniformDistribution(a, b);
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #4
0
 public void TestTriangularDistribution()
 {
     double[][] para =
     {
         new double[] {}
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new TriangularDistribution(a, 0.5 * (a + b), b);
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #5
0
 public void TestBetaDistribution()
 {
     double[][] para =
     {
         new double[] { 2.5, 3.5, 0.2739037303169420423172000, 1.749247541974141744140178, 0.7393662913208028693203748, 0.5988730468534031966438193 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new BetaDistribution(a, b);
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #6
0
        public void TestGammaDistribution()
        {
            double[][] para =
            {
                new double[] { 1.375, 0.5, 0.2611286278084653847745789, 1.046077103945108021281691, 1.844156400106479932815508, 0.0918157038807440615366658 }
            };
            for (int i = 0; i < para.Length; i++)
            {
                var tester = new ContDistTester(para[i], delegate(double a, double b)
                {
                    var ret = new GammaDistribution(a, b);

                    return(ret);
                }
                                                );
                tester.Test(1E-14);
            }
        }
Exemple #7
0
 public void TestChiDistribution()
 {
     double[][] para =
     {
         new double[] { 7, 0, 2.062729304476599455816607, 0.488171949494276922953910, 3.750618675544098650248806, 0.130564628233938801736407 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new ChiDistribution
             {
                 N = (int)a
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #8
0
 public void TestChiSquareDistribution()
 {
     double[][] para =
     {
         new double[] { 7, 0, 4.254852183546515743793886, 0.1183315591713442321707384, 14.06714044934016874262697, 0.0174057454954412176379300 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new ChiSquareDistribution
             {
                 Alpha = (int)a
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #9
0
 public void TestExponentialDistribution()
 {
     double[][] para =
     {
         new double[] { 3.5, 0, 0.08219487784336597926834829, 2.625000000000000000000000, 0.8559235067297117124100639, 0.1750000000000000000000000 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new ExponentialDistribution
             {
                 Lambda = a
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #10
0
 public void TestLaplaceDistribution()
 {
     double[][] para =
     {
         new double[] { 1.375, 0.5, 1.028426409720027345291384, 0.500000000000000000000000, 2.526292546497022842008996, 0.1000000000000000000000000 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new LaplaceDistribution
             {
                 Mu    = a,
                 Alpha = b
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #11
0
        public void TestRayleighDistribution()
        {
            double[][] para =
            {
                new double[] { 1.5, 0, 1.137791424661398198866648, 0.379263808220466066288883, 3.671620246021224819564040, 0.081591561022693884879201 }
            };
            for (int i = 0; i < para.Length; i++)
            {
                var tester = new ContDistTester(para[i], delegate(double a, double b)
                {
                    var ret = new RayleighDistribution
                    {
                        Sigma = a
                    };

                    return(ret);
                }
                                                );
                tester.Test(1E-14);
            }
        }
Exemple #12
0
 public void TestPowerDistribution()
 {
     double[][] para =
     {
         new double[] {}
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new PowerDistribution
             {
                 Alpha = a,
                 Beta  = b
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #13
0
 public void TestFDistribution()
 {
     double[][] para =
     {
         new double[] { 3, 4, 0.4183909951315492730074144, 0.6061355268760950491423940, 6.591382116425581280992118, 0.01221670581017468041546974 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new FDistribution
             {
                 Alpha = (int)a,
                 Beta  = (int)b
             };
             return(ret);
         }
                                         );
         tester.Test(1e-14);
     }
 }
Exemple #14
0
 public void TestFisherTippettDistribution()
 {
     double[][] para =
     {
         new double[] { 3.5, 1.8, 2.912058332039094231671373, 0.1925408834888736970603423, 8.846351448275896206409006, 0.0270714609267627815304924 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new FisherTippettDistribution
             {
                 Mu    = a,
                 Alpha = b
             };
             return(ret);
         }
                                         );
         tester.Test(1e-14);
     }
 }
Exemple #15
0
 public void TestParetoDistribution()
 {
     double[][] para =
     {
         new double[] { 1.5, 1.75, 1.768010430487225851453548, 0.742359873769694378113828, 8.30877447091612868489998, 0.0105310356306195679153012 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new ParetoDistribution
             {
                 Alpha = a,
                 Beta  = b
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #16
0
 public void TestCauchyDistribution()
 {
     double[][] para =
     {
         new double[] { 5, 8, -3.000000000000000000000000, 0.01989436788648691697111047, 55.51001211740034479183571, 0.0009736996704704924902896828 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new CauchyDistribution
             {
                 Alpha = a,
                 Gamma = b
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #17
0
 public void TestLognormalDistribution()
 {
     double[][] para =
     {
         new double[] { 1.5, 1.75, 1.376636130958281216854024, 0.1319060344841768348662210, 79.7178756354342770648064, 0.00073929029309046336101277 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new LognormalDistribution
             {
                 Mu    = a,
                 Sigma = b
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #18
0
 public void TestNormalDistribution()
 {
     double[][] para =
     {
         new double[] { 1.5, 1.75, 0.319642937156856949396103, 0.1815866129623468194217694, 4.378493847165077251011736, 0.0589346516430693148362630 }
     };
     for (int i = 0; i < para.Length; i++)
     {
         var tester = new ContDistTester(para[i], delegate(double a, double b)
         {
             var ret = new NormalDistribution
             {
                 Mu    = a,
                 Sigma = b
             };
             return(ret);
         }
                                         );
         tester.Test(1E-14);
     }
 }
Exemple #19
0
        public void TestWeibullDistribution()
        {
            double[][] para =
            {
                new double[] { 1.5, 1.75, 0.762628880480291575561159, 0.424377229596168368465272, 3.63669361568547473062272, 0.061781371833876567930871 }
            };
            for (int i = 0; i < para.Length; i++)
            {
                var tester = new ContDistTester(para[i], delegate(double a, double b)
                {
                    var ret = new WeibullDistribution
                    {
                        Alpha  = a,
                        Lambda = b
                    };

                    return(ret);
                }
                                                );
                tester.Test(1E-14);
            }
        }
		public void TestExponentialDistribution()
		{
			double[][] para = {
new double[]{3.5, 0, 0.08219487784336597926834829, 2.625000000000000000000000, 0.8559235067297117124100639, 0.1750000000000000000000000}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					ExponentialDistribution ret = new ExponentialDistribution();
					ret.Lambda = a;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestErlangDistribution()
		{
			double[][] para = {
new double[]{3.0, 0.5, 0.8636497089302596965312208, 0.530369629973745149272610, 3.147896810935994870892347, 0.0730924530353432559740299}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					ErlangDistribution ret = new ErlangDistribution((int)a, b);
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestFisherTippettDistribution()
		{
			double[][] para = {
new double[]{3.5, 1.8, 2.912058332039094231671373, 0.1925408834888736970603423, 8.846351448275896206409006, 0.0270714609267627815304924}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					FisherTippettDistribution ret = new FisherTippettDistribution();
					ret.Mu = a;
					ret.Alpha = b;
					return ret;
				}
					);
				tester.Test(1e-14);
			}
		}
		public void TestFDistribution()
		{
			double[][] para = {
new double[]{ 3, 4, 0.4183909951315492730074144, 0.6061355268760950491423940, 6.591382116425581280992118, 0.01221670581017468041546974 }
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					FDistribution ret = new FDistribution();
					ret.Alpha = (int)a;
					ret.Beta = (int)b;
					return ret;
				}
					);
				tester.Test(1e-14);
			}
		}
		public void TestWeibullDistribution()
		{
			double[][] para = {
new double[]{1.5, 1.75, 0.762628880480291575561159, 0.424377229596168368465272, 3.63669361568547473062272, 0.061781371833876567930871}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					WeibullDistribution ret = new WeibullDistribution();
					ret.Alpha = a;
					ret.Lambda = b;

					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestGammaDistribution()
		{
			double[][] para = {
new double[]{1.375, 0.5, 0.2611286278084653847745789, 1.046077103945108021281691, 1.844156400106479932815508, 0.0918157038807440615366658}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					GammaDistribution ret = new GammaDistribution(a, b);

					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestNormalDistribution()
		{
			double[][] para = {
new double[]{1.5, 1.75, 0.319642937156856949396103, 0.1815866129623468194217694, 4.378493847165077251011736, 0.0589346516430693148362630}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					NormalDistribution ret = new NormalDistribution();
					ret.Mu = a;
					ret.Sigma = b;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestChiDistribution()
		{
			double[][] para = {
new double[]{7, 0, 2.062729304476599455816607, 0.488171949494276922953910, 3.750618675544098650248806, 0.130564628233938801736407}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					ChiDistribution ret = new ChiDistribution();
					ret.N = (int)a;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestPowerDistribution()
		{
			double[][] para = {
new double[]{}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					PowerDistribution ret = new PowerDistribution();
					ret.Alpha = a;
					ret.Beta = b;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestParetoDistribution()
		{
			double[][] para = {
new double[]{1.5, 1.75, 1.768010430487225851453548, 0.742359873769694378113828, 8.30877447091612868489998, 0.0105310356306195679153012}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					ParetoDistribution ret = new ParetoDistribution();
					ret.Alpha = a;
					ret.Beta = b;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestRayleighDistribution()
		{
			double[][] para = {
new double[]{1.5, 0, 1.137791424661398198866648, 0.379263808220466066288883, 3.671620246021224819564040, 0.081591561022693884879201}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					RayleighDistribution ret = new RayleighDistribution();
					ret.Sigma = a;

					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestStudentTDistribution()
		{
			double[][] para = {
new double[]{12, 0, -0.6954828655117925816605449, 0.3022177430388599749597682, 1.782287555649320074526381, 0.08490359467537564413509914}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					StudentTDistribution ret = new StudentTDistribution();
					ret.Nu = (int)a;
					return ret;
				}
					);
				tester.Test(1e-14);
			}
		}
		public void TestTriangularDistribution()
		{
			double[][] para = {
new double[]{}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					TriangularDistribution ret = new TriangularDistribution(a, 0.5 * (a + b), b);
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestContinuousUniformDistribution()
		{
			double[][] para = {
new double[]{3, 5, 3.500000000000000000000000, 0.5000000000000000000000000, 4.900000000000000000000000, 0.5000000000000000000000000}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					ContinuousUniformDistribution ret = new ContinuousUniformDistribution(a, b);
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestLognormalDistribution()
		{
			double[][] para = {
new double[]{1.5, 1.75, 1.376636130958281216854024, 0.1319060344841768348662210, 79.7178756354342770648064, 0.00073929029309046336101277}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					LognormalDistribution ret = new LognormalDistribution();
					ret.Mu = a;
					ret.Sigma = b;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestChiSquareDistribution()
		{
			double[][] para = {
new double[]{7, 0, 4.254852183546515743793886, 0.1183315591713442321707384, 14.06714044934016874262697, 0.0174057454954412176379300}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					ChiSquareDistribution ret = new ChiSquareDistribution();
					ret.Alpha = (int)a;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestLaplaceDistribution()
		{
			double[][] para = {
new double[]{1.375, 0.5, 1.028426409720027345291384, 0.500000000000000000000000, 2.526292546497022842008996, 0.1000000000000000000000000}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					LaplaceDistribution ret = new LaplaceDistribution();
					ret.Mu = a;
					ret.Alpha = b;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestBetaDistribution()
		{
			double[][] para = {
new double[]{2.5, 3.5, 0.2739037303169420423172000, 1.749247541974141744140178, 0.7393662913208028693203748, 0.5988730468534031966438193}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					BetaDistribution ret = new BetaDistribution(a, b);
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}
		public void TestCauchyDistribution()
		{
			double[][] para = {
new double[]{5, 8, -3.000000000000000000000000, 0.01989436788648691697111047, 55.51001211740034479183571, 0.0009736996704704924902896828}
      };
			for (int i = 0; i < para.Length; i++)
			{
				ContDistTester tester = new ContDistTester(para[i], delegate(double a, double b)
				{
					CauchyDistribution ret = new CauchyDistribution();
					ret.Alpha = a;
					ret.Gamma = b;
					return ret;
				}
					);
				tester.Test(1E-14);
			}
		}