Beispiel #1
0
        /// <summary>
        /// Updates the helper variables that store intermediate results for generation of beta-prime distributed random
        ///   numbers.
        /// </summary>
        public void Initialize(double alpha, double beta)
        {
            if (!IsValidAlpha(alpha))
            {
                throw new ArgumentOutOfRangeException("alpha has to be greater than 1");
            }
            if (!IsValidBeta(beta))
            {
                throw new ArgumentOutOfRangeException("beta has to be greater than 1");
            }

            this.alpha       = alpha;
            this.beta        = beta;
            betaDistribution = new BetaDistribution();
            betaDistribution.Initialize(this.alpha, this.beta);
        }
Beispiel #2
0
		/// <summary>
		/// Updates the helper variables that store intermediate results for generation of beta-prime distributed random
		///   numbers.
		/// </summary>
		public void Initialize(double alpha, double beta)
		{
			if (!IsValidAlpha(alpha))
				throw new ArgumentOutOfRangeException("alpha has to be greater than 1");
			if (!IsValidBeta(beta))
				throw new ArgumentOutOfRangeException("beta has to be greater than 1");

			this.alpha = alpha;
			this.beta = beta;
			this.betaDistribution = new BetaDistribution();
			this.betaDistribution.Initialize(this.alpha, this.beta);
		}
		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);
			}
		}