Class ProbabilityWeightedMoments


  • @Reference(authors="J. R. M. Hosking, J. R. Wallis, E. F. Wood",title="Estimation of the generalized extreme-value distribution by the method of probability-weighted moments.",booktitle="Technometrics 27.3",url="https://doi.org/10.1080/00401706.1985.10488049",bibkey="doi:10.1080/00401706.1985.10488049") @Reference(authors="J. R. M. Hosking",title="Fortran routines for use with the method of L-moments Version 3.03",booktitle="IBM Research Technical Report",bibkey="tr/ibm/Hosking00")
    public final class ProbabilityWeightedMoments
    extends java.lang.Object
    Estimate the L-Moments of a sample.

    Reference:

    J. R. M. Hosking, J. R. Wallis, E. F. Wood
    Estimation of the generalized extreme-value distribution by the method of probability-weighted moments.
    Technometrics 27.3

    Also based on:

    J. R. M. Hosking
    Fortran routines for use with the method of L-moments Version 3.03
    IBM Research.

    Since:
    0.6.0
    Author:
    Erich Schubert
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ProbabilityWeightedMoments()
      Private constructor, use static methods!
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <A> double[] alphaBetaPWM​(A data, NumberArrayAdapter<?,​A> adapter, int nmom)
      Compute the alpha_r and beta_r factors in parallel using the method of probability-weighted moments.
      static <A> double[] alphaPWM​(A data, NumberArrayAdapter<?,​A> adapter, int nmom)
      Compute the alpha_r factors using the method of probability-weighted moments.
      static <A> double[] betaPWM​(A data, NumberArrayAdapter<?,​A> adapter, int nmom)
      Compute the beta_r factors using the method of probability-weighted moments.
      private static void normalizeLMR​(double[] sum, int nmom)
      Normalize the moments
      static <A> double[] samLMR​(A sorted, NumberArrayAdapter<?,​A> adapter, int nmom)
      Compute the sample L-Moments using probability weighted moments.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProbabilityWeightedMoments

        private ProbabilityWeightedMoments()
        Private constructor, use static methods!
    • Method Detail

      • alphaPWM

        public static <A> double[] alphaPWM​(A data,
                                            NumberArrayAdapter<?,​A> adapter,
                                            int nmom)
        Compute the alpha_r factors using the method of probability-weighted moments.
        Parameters:
        data - Presorted data array.
        adapter - Array adapter.
        nmom - Number of moments to compute
        Returns:
        Alpha moments (0-indexed)
      • betaPWM

        public static <A> double[] betaPWM​(A data,
                                           NumberArrayAdapter<?,​A> adapter,
                                           int nmom)
        Compute the beta_r factors using the method of probability-weighted moments.
        Parameters:
        data - Presorted data array.
        adapter - Array adapter.
        nmom - Number of moments to compute
        Returns:
        Beta moments (0-indexed)
      • alphaBetaPWM

        public static <A> double[] alphaBetaPWM​(A data,
                                                NumberArrayAdapter<?,​A> adapter,
                                                int nmom)
        Compute the alpha_r and beta_r factors in parallel using the method of probability-weighted moments. Usually cheaper than computing them separately.
        Parameters:
        data - Presorted data array.
        adapter - Array adapter.
        nmom - Number of moments to compute
        Returns:
        Alpha and Beta moments (0-indexed, interleaved)
      • samLMR

        public static <A> double[] samLMR​(A sorted,
                                          NumberArrayAdapter<?,​A> adapter,
                                          int nmom)
        Compute the sample L-Moments using probability weighted moments.
        Parameters:
        sorted - Presorted data array.
        adapter - Array adapter.
        nmom - Number of moments to compute
        Returns:
        Array containing Lambda1, Lambda2, Tau3 ... TauN
      • normalizeLMR

        private static void normalizeLMR​(double[] sum,
                                         int nmom)
        Normalize the moments
        Parameters:
        sum - Sums
        nmom - Number of moments