Accord.Statistics.Distributions.Univariate.GeneralizedNormalDistribution.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, "GGD(x; μ = {0}, α = {1}, β = {2})",
                mean.ToString(format, formatProvider),
                alpha.ToString(format, formatProvider),
                beta.ToString(format, formatProvider));
        }

Usage Example

        public void ConstructorTest1()
        {
            var normal = new GeneralizedNormalDistribution(location: 1, scale: 5, shape: 0.42);

            double mean = normal.Mean;     // 1
            double median = normal.Median; // 1
            double mode = normal.Mode;     // 1
            double var = normal.Variance;  // 19200.781700666659

            double cdf = normal.DistributionFunction(x: 1.4); // 0.50877105447218995
            double pdf = normal.ProbabilityDensityFunction(x: 1.4); // 0.024215092283124507
            double lpdf = normal.LogProbabilityDensityFunction(x: 1.4); // -3.7207791921441378

            double ccdf = normal.ComplementaryDistributionFunction(x: 1.4); // 0.49122894552781005
            double icdf = normal.InverseDistributionFunction(p: cdf); // 1.4000000149740104

            double hf = normal.HazardFunction(x: 1.4); // 0.049294921448706883
            double chf = normal.CumulativeHazardFunction(x: 1.4); // 0.71084497569360638

            string str = normal.ToString(CultureInfo.InvariantCulture); // GGD(x; μ = 1, α = 5, β = 0.42)

            Assert.AreEqual(1, mean);
            Assert.AreEqual(1, median);
            Assert.AreEqual(1, mode);
            Assert.AreEqual(19200.781700666659, var);
            Assert.AreEqual(0.71084497569360638, chf);
            Assert.AreEqual(0.50877105447218995, cdf);
            Assert.AreEqual(0.024215092283124507, pdf);
            Assert.AreEqual(-3.7207791921441378, lpdf);
            Assert.AreEqual(0.049294921448706883, hf);
            Assert.AreEqual(0.49122894552781005, ccdf);
            Assert.AreEqual(1.4000000149740104, icdf);
            Assert.AreEqual("GGD(x; μ = 1, α = 5, β = 0.42)", str);
        }
All Usage Examples Of Accord.Statistics.Distributions.Univariate.GeneralizedNormalDistribution::ToString