public ToString ( string format, IFormatProvider formatProvider ) : string | ||
format | string | |
formatProvider | IFormatProvider | |
Résultat | string |
public void ConstructorTest1() { var log = new LogisticDistribution(location: 0.42, scale: 1.2); double mean = log.Mean; // 0.42 double median = log.Median; // 0.42 double mode = log.Mode; // 0.42 double var = log.Variance; // 4.737410112522892 double cdf = log.DistributionFunction(x: 1.4); // 0.693528308197921 double pdf = log.ProbabilityDensityFunction(x: 1.4); // 0.17712232827170876 double lpdf = log.LogProbabilityDensityFunction(x: 1.4); // -1.7309146649427332 double ccdf = log.ComplementaryDistributionFunction(x: 1.4); // 0.306471691802079 double icdf = log.InverseDistributionFunction(p: cdf); // 1.3999999999999997 double hf = log.HazardFunction(x: 1.4); // 0.57794025683160088 double chf = log.CumulativeHazardFunction(x: 1.4); // 1.1826298874077226 string str = log.ToString(CultureInfo.InvariantCulture); // Logistic(x; μ = 0.42, scale = 1.2) Assert.AreEqual(0.41999999999999998, mean); Assert.AreEqual(0.41999999999999998, median); Assert.AreEqual(4.737410112522892, var); Assert.AreEqual(1.1826298874077226, chf); Assert.AreEqual(0.693528308197921, cdf); Assert.AreEqual(0.17712232827170876, pdf); Assert.AreEqual(-1.7309146649427332, lpdf); Assert.AreEqual(0.57794025683160088, hf); Assert.AreEqual(0.306471691802079, ccdf); Assert.AreEqual(1.3999999999999997, icdf); Assert.AreEqual("Logistic(x; μ = 0.42, scale = 1.2)", str); }