コード例 #1
0
 /// <summary>
 /// Computes a central moment of the distribution.
 /// </summary>
 /// <param name="r">The order of the moment to compute.</param>
 /// <returns>The rth central moment of the distribution.</returns>
 /// <seealso cref="RawMoment" />
 public virtual double CentralMoment(int r)
 {
     // This is a terrible way to compute central moments, subject to significant cancelations, so replace it if at all possible.
     double[] M = RawMoments(r);
     return(MomentMath.RawToCentral(M, r));
 }