Accord.Statistics.Distributions.Univariate.KumaraswamyDistribution.ToString C# (CSharp) Method

ToString() public method

Returns a System.String that represents this instance.
public ToString ( string format, IFormatProvider formatProvider ) : string
format string
formatProvider IFormatProvider
return string
        public override string ToString(string format, IFormatProvider formatProvider)
        {
            return String.Format(formatProvider, "Kumaraswamy(x; a = {0}, b = {1})",
                a.ToString(format, formatProvider),
                b.ToString(format, formatProvider));
        }

Usage Example

        public void Constructor_ExtensiveTestForDocumentation()
        {
            // Create a new Kumaraswamy distribution with shape (4,2)
            var kumaraswamy = new KumaraswamyDistribution(a: 4, b: 2);

            double mean = kumaraswamy.Mean;     // 0.71111111111111114
            double median = kumaraswamy.Median; // 0.73566031573423674
            double mode = kumaraswamy.Mode;     // 0.80910671157022118
            double var = kumaraswamy.Variance;  // 0.027654320987654302

            double cdf = kumaraswamy.DistributionFunction(x: 0.4);           // 0.050544639999999919
            double pdf = kumaraswamy.ProbabilityDensityFunction(x: 0.4);     // 0.49889280000000014
            double lpdf = kumaraswamy.LogProbabilityDensityFunction(x: 0.4); // -0.69536403596913343

            double ccdf = kumaraswamy.ComplementaryDistributionFunction(x: 0.4); // 0.94945536000000008
            double icdf = kumaraswamy.InverseDistributionFunction(p: cdf);       // 0.40000011480618253

            double hf = kumaraswamy.HazardFunction(x: 0.4);            // 0.52545155993431869
            double chf = kumaraswamy.CumulativeHazardFunction(x: 0.4); // 0.051866764053008864

            string str = kumaraswamy.ToString(CultureInfo.InvariantCulture); // Kumaraswamy(x; a = 4, b = 2)

            Assert.AreEqual(0.71111111111111114, mean);
            Assert.AreEqual(0.73566031573423674, median);
            Assert.AreEqual(0.80910671157022118, mode);
            Assert.AreEqual(0.027654320987654302, var);
            Assert.AreEqual(0.051866764053008864, chf);
            Assert.AreEqual(0.050544639999999919, cdf);
            Assert.AreEqual(0.49889280000000014, pdf);
            Assert.AreEqual(-0.69536403596913343, lpdf);
            Assert.AreEqual(0.52545155993431869, hf);
            Assert.AreEqual(0.94945536000000008, ccdf);
            Assert.AreEqual(0.40000011480618253, icdf);
            Assert.AreEqual("Kumaraswamy(x; a = 4, b = 2)", str);

            var range1 = kumaraswamy.GetRange(0.95);
            var range2 = kumaraswamy.GetRange(0.99);
            var range3 = kumaraswamy.GetRange(0.01);

            Assert.AreEqual(0.39890408640473385, range1.Min);
            Assert.AreEqual(0.93868623055832956, range1.Max);
            Assert.AreEqual(0.26608174016394209, range2.Min);
            Assert.AreEqual(0.97400390609144138, range2.Max);
            Assert.AreEqual(0.26608174016394187, range3.Min);
            Assert.AreEqual(0.97400390609144138, range3.Max);
        }
All Usage Examples Of Accord.Statistics.Distributions.Univariate.KumaraswamyDistribution::ToString