/// <summary> /// Gets the log-probability density function (pdf) for /// this distribution evaluated at point <c>w</c>. /// </summary> /// /// <param name="x">A single point in the distribution range.</param> /// /// <returns> /// The logarithm of the probability of <c>x</c> /// occurring in the current distribution. /// </returns> /// /// <remarks> /// The Probability Density Function (PDF) describes the /// probability that a given value <c>x</c> will occur. /// </remarks> /// protected internal override double InnerLogProbabilityDensityFunction(double x) { if (this.exact) { return(Math.Log(count(x, table)) - Math.Log(table.Length)); } return(approximation.LogProbabilityDensityFunction(x)); }
/// <summary> /// Not supported. /// </summary> /// public override double LogProbabilityDensityFunction(double x) { if (x <= 0 || x >= 1) { return(Double.NegativeInfinity); } double z = g(x); return(normal.LogProbabilityDensityFunction(z)); }
/// <summary> /// Gets the log-probability density function (pdf) for /// this distribution evaluated at point <c>x</c>. /// </summary> /// <param name="x">A single point in the distribution range.</param> /// <returns>The logarithm of the probability of <c>x</c> /// occurring in the current distribution.</returns> /// <remarks>The Probability Density Function (PDF) describes the /// probability that a given value <c>x</c> will occur.</remarks> protected internal override double InnerLogProbabilityDensityFunction(double x) { double z = g(x); return(normal.LogProbabilityDensityFunction(z)); }
public void LogProbabilityDensityFunctionTest() { double x = 3; double mean = 7; double dev = 5; NormalDistribution target = new NormalDistribution(mean, dev); double expected = System.Math.Log(0.0579383105522966); double actual = target.LogProbabilityDensityFunction(x); Assert.IsFalse(double.IsNaN(actual)); Assert.AreEqual(expected, actual, 1e-15); }
/// <summary> /// Not supported. /// </summary> /// public override double LogProbabilityDensityFunction(double x) { return(normal.LogProbabilityDensityFunction(g(x))); }