Documentation of 'jhplot.math.StatisticSample' Java class.
StatisticSample
jhplot.math

Class StatisticSample



  • public class StatisticSample
    extends java.lang.Object
    A package to create random 1D and 2D arrays.
    • Constructor Summary

      Constructors 
      Constructor and Description
      StatisticSample() 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static double[][] correlation(double[][] v)
      Correlation
      static double[][] correlation(double[][] v1, double[][] v2)
      Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)
      static double correlation(double[] v1, double[] v2)
      Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)
      static double[][] covariance(double[][] v)
      Covariance
      static double[][] covariance(double[][] v1, double[][] v2)
      Covariance
      static double covariance(double[] v1, double[] v2)
      Covariance
      static double mean(double[] v)
      Get mean value
      static double[] mean(double[][] v)
      Get mean
      static double[] randomBeta(int m, double a, double b)
      1D Random Beta distribution
      static double[][] randomBeta(int m, int n, double a, double b)
      Random beata distribution
      static double[] randomCauchy(int m, double mu, double sigma)
      1D Cauchy PDF
      static double[][] randomCauchy(int m, int n, double mu, double sigma)
      2D Cauchy PDF
      static double[] randomChi2(int m, int d)
      1D array with random numbers
      static double[][] randomChi2(int m, int n, int d)
      2D array with Chi2
      static double[] randomDirac(int m, double[] values, double[] prob)
      1D array with Dirac random values
      static double[][] randomDirac(int m, int n, double[] values, double[] prob)
      2D array with Dirac random values
      double[][] randomDoubleArray(int rows, int columns, AbstractDistribution dist)
      Build 2D integer array list with integer numbers from input random number generator
      DoubleArrayList randomDoubleArrayList(int Ntot, AbstractDistribution dist)
      Build double array list with integer numbers from input random number generator
      static double[] randomExponential(int m, double lambda)
      1D array with exponential numbers
      static double[][] randomExponential(int m, int n, double lambda)
      2D array with exponential random distribution
      static int[] randomInt(int m, int i0, int i1)
      Random array with integers
      static int[][] randomInt(int m, int n, int i0, int i1)
      Random 2D array with integers
      int[] randomIntArray(int Ntot, Binomial dist)
      Build integer array list with integer numbers from input random number generator
      int[][] randomIntArray(int rows, int columns, AbstractDistribution dist)
      Build 2D integer array list with integer numbers from input random number generator
      IntArrayList randomIntArrayList(int Ntot, AbstractDistribution dist)
      Build integer array list with integer numbers from input random number generator
      static double[] randomLogNormal(int m, double mu, double sigma)
      1D array with random Log-normal values
      static double[][] randomLogNormal(int m, int n, double mu, double sigma)
      2D Log-normal distribution
      static double[] randomNormal(int m, double mu, double sigma)
      1D array with Gaussian numbers
      static double[][] randomNormal(int m, int n, double mu, double sigma)
      2D array with Gaussian numbers
      static int[] randomPoisson(int m, double mean)
      Build an array with Poisson distribution
      static double[] randomRejection(int m, Expression fun, double maxFun, double min, double max)
      Build 1D array using analytic function.
      static double[][] randomRejection(int m, int n, Expression fun, double maxFun, double min, double max)
      Build 2D random array using analytic function.
      static double[] randomTriangular(int m, double min, double max)
      1D array with Triangular random PDF
      static double[] randomTriangular(int m, double min, double med, double max)
      1D array for Triangular
      static double[][] randomTriangular(int m, int n, double min, double max)
      2D array for Triangular random PDF
      static double[][] randomTriangular(int m, int n, double min, double med, double max)
      2D array for Triangular
      static double[] randomWeibull(int m, double lambda, double c)
      1D Weibull
      static double[][] randomWeibull(int m, int n, double lambda, double c)
      2D Weibull
      static double[] randUniform(int m, double min, double max)
      2D array with uniform values
      static double[][] randUniform(int m, int n, double min, double max)
      2D array with random uniform values
      static double stddeviation(double[] v)
      Standard deviation
      static double[] stddeviation(double[][] v)
      Standard deviation
      static double variance(double[] v)
      Variance
      static double[] variance(double[][] v)
      Variance
      • Methods inherited from class java.lang.Object

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

      • StatisticSample

        public StatisticSample()
    • Method Detail

      • randomInt

        public static int[][] randomInt(int m,
                                        int n,
                                        int i0,
                                        int i1)
        Random 2D array with integers
        Parameters:
        m - Rows
        n - Columns
        i0 - Min value
        i1 - max value
        Returns:
        2D array
      • randomInt

        public static int[] randomInt(int m,
                                      int i0,
                                      int i1)
        Random array with integers
        Parameters:
        m - array size
        i0 - min value
        i1 - max value
        Returns:
        array
      • randUniform

        public static double[] randUniform(int m,
                                           double min,
                                           double max)
        2D array with uniform values
        Parameters:
        m - Total number
        min - Min value
        max - Max value
        Returns:
        array
      • randUniform

        public static double[][] randUniform(int m,
                                             int n,
                                             double min,
                                             double max)
        2D array with random uniform values
        Parameters:
        m - Rows
        n - Columns
        min - Min value
        max - Max value
        Returns:
        array
      • randomDirac

        public static double[][] randomDirac(int m,
                                             int n,
                                             double[] values,
                                             double[] prob)
        2D array with Dirac random values
        Parameters:
        m - Rows
        n - Columns
        values - Values for function
        prob - Probabilities
        Returns:
        array
      • randomDirac

        public static double[] randomDirac(int m,
                                           double[] values,
                                           double[] prob)
        1D array with Dirac random values
        Parameters:
        m - Total number
        values - array with values for the function
        prob - probability
        Returns:
        array
      • randomPoisson

        public static int[] randomPoisson(int m,
                                          double mean)
        Build an array with Poisson distribution
        Parameters:
        mean - mean of Poisson distribution
      • randomNormal

        public static double[][] randomNormal(int m,
                                              int n,
                                              double mu,
                                              double sigma)
        2D array with Gaussian numbers
        Parameters:
        m - Rows
        n - Columns
        mu - mean
        sigma - standard deviation
        Returns:
        array
      • randomNormal

        public static double[] randomNormal(int m,
                                            double mu,
                                            double sigma)
        1D array with Gaussian numbers
        Parameters:
        m - Total number
        mu - mean
        sigma - standard deviation
        Returns:
        array
      • randomChi2

        public static double[][] randomChi2(int m,
                                            int n,
                                            int d)
        2D array with Chi2
        Parameters:
        m - Rows
        n - Columns
        d - degrees of freedom
        Returns:
        array
      • randomChi2

        public static double[] randomChi2(int m,
                                          int d)
        1D array with random numbers
        Parameters:
        m - Total number
        d - degree of freedoms
        Returns:
        array
      • randomLogNormal

        public static double[][] randomLogNormal(int m,
                                                 int n,
                                                 double mu,
                                                 double sigma)
        2D Log-normal distribution
        Parameters:
        m - Rows
        n - Columns
        mu - mean
        sigma - sigma
        Returns:
        array
      • randomLogNormal

        public static double[] randomLogNormal(int m,
                                               double mu,
                                               double sigma)
        1D array with random Log-normal values
        Parameters:
        m - total number
        mu - mean
        sigma - sigma
        Returns:
        array
      • randomExponential

        public static double[][] randomExponential(int m,
                                                   int n,
                                                   double lambda)
        2D array with exponential random distribution
        Parameters:
        m - Rows
        n - Colums
        lambda - lambda
        Returns:
        array
      • randomExponential

        public static double[] randomExponential(int m,
                                                 double lambda)
        1D array with exponential numbers
        Parameters:
        m - total numbers
        lambda - lambda
        Returns:
        array
      • randomTriangular

        public static double[][] randomTriangular(int m,
                                                  int n,
                                                  double min,
                                                  double max)
        2D array for Triangular random PDF
        Parameters:
        m - Rows
        n - Columns
        min - Min
        max - max
        Returns:
        array
      • randomTriangular

        public static double[] randomTriangular(int m,
                                                double min,
                                                double max)
        1D array with Triangular random PDF
        Parameters:
        m - total number
        min - Min
        max - max
        Returns:
        array
      • randomTriangular

        public static double[][] randomTriangular(int m,
                                                  int n,
                                                  double min,
                                                  double med,
                                                  double max)
        2D array for Triangular
        Parameters:
        m - Rows
        n - Columns
        min - Min
        med - Median
        max - Max
        Returns:
        array
      • randomTriangular

        public static double[] randomTriangular(int m,
                                                double min,
                                                double med,
                                                double max)
        1D array for Triangular
        Parameters:
        m - total number
        min - Min
        med - Median
        max - Max
        Returns:
        array
      • randomBeta

        public static double[][] randomBeta(int m,
                                            int n,
                                            double a,
                                            double b)
        Random beata distribution
        Parameters:
        m - Rows
        n - Columns
        a - alpha
        b - beta
        Returns:
        array
      • randomBeta

        public static double[] randomBeta(int m,
                                          double a,
                                          double b)
        1D Random Beta distribution
        Parameters:
        m - total number
        a - alpha
        b - beta
        Returns:
        array
      • randomCauchy

        public static double[][] randomCauchy(int m,
                                              int n,
                                              double mu,
                                              double sigma)
        2D Cauchy PDF
        Parameters:
        m - Rows
        n - Colums
        mu - Mean
        sigma - Sigma
        Returns:
        array
      • randomCauchy

        public static double[] randomCauchy(int m,
                                            double mu,
                                            double sigma)
        1D Cauchy PDF
        Parameters:
        m - total number
        mu - mean
        sigma - sigma
        Returns:
      • randomWeibull

        public static double[][] randomWeibull(int m,
                                               int n,
                                               double lambda,
                                               double c)
        2D Weibull
        Parameters:
        m - Rows
        n - Columns
        lambda - lambda
        c - C
        Returns:
        array
      • randomWeibull

        public static double[] randomWeibull(int m,
                                             double lambda,
                                             double c)
        1D Weibull
        Parameters:
        m - Rows
        lambda - lambda
        c - C
        Returns:
        array
      • randomRejection

        public static double[][] randomRejection(int m,
                                                 int n,
                                                 Expression fun,
                                                 double maxFun,
                                                 double min,
                                                 double max)
        Build 2D random array using analytic function. First build F1D, than get parse (getParse()) and use it as input for this method.
        Parameters:
        m - Number of points
        fun - ParseFunction (get it as getParse() for F1D)
        maxFun - max of the function
        min - Min value in X
        max - Max value in X
      • randomRejection

        public static double[] randomRejection(int m,
                                               Expression fun,
                                               double maxFun,
                                               double min,
                                               double max)
        Build 1D array using analytic function. First build F1D, than get parse (getParse()) and use it as input for this method.
        Parameters:
        m - Number of points
        fun - ParseFunction (get it as getParse() for F1D)
        maxFun - max of the function
        min - Min value in X
        max - Max value in X
      • mean

        public static double mean(double[] v)
        Get mean value
        Parameters:
        v - vector
      • mean

        public static double[] mean(double[][] v)
        Get mean
        Parameters:
        v - 2D array
        Returns:
      • stddeviation

        public static double stddeviation(double[] v)
        Standard deviation
        Parameters:
        v - vector
        Returns:
      • variance

        public static double variance(double[] v)
        Variance
        Parameters:
        v -
        Returns:
        vector
      • stddeviation

        public static double[] stddeviation(double[][] v)
        Standard deviation
        Parameters:
        v -
        Returns:
      • variance

        public static double[] variance(double[][] v)
        Variance
        Parameters:
        v - vector
        Returns:
      • covariance

        public static double covariance(double[] v1,
                                        double[] v2)
        Covariance
        Parameters:
        v1 - first vector
        v2 - second vector
        Returns:
      • covariance

        public static double[][] covariance(double[][] v1,
                                            double[][] v2)
        Covariance
        Parameters:
        v1 - first 2D array
        v2 - second 2D array
        Returns:
      • covariance

        public static double[][] covariance(double[][] v)
        Covariance
        Parameters:
        v -
        Returns:
      • correlation

        public static double correlation(double[] v1,
                                         double[] v2)
        Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)
        Parameters:
        v1 - first vector
        v2 - second vector
        Returns:
      • correlation

        public static double[][] correlation(double[][] v1,
                                             double[][] v2)
        Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)
        Parameters:
        v1 - first vector
        v2 - second vector
        Returns:
      • correlation

        public static double[][] correlation(double[][] v)
        Correlation
        Parameters:
        v -
        Returns:
      • randomIntArrayList

        public IntArrayList randomIntArrayList(int Ntot,
                                               AbstractDistribution dist)
        Build integer array list with integer numbers from input random number generator
        Parameters:
        Ntot - total numbers
        dist - input random number distribution
        Returns:
        array
      • randomIntArray

        public int[] randomIntArray(int Ntot,
                                    Binomial dist)
        Build integer array list with integer numbers from input random number generator
        Parameters:
        Ntot - total numbers
        dist - input random number distribution
        Returns:
        array
      • randomIntArray

        public int[][] randomIntArray(int rows,
                                      int columns,
                                      AbstractDistribution dist)
        Build 2D integer array list with integer numbers from input random number generator
        Parameters:
        rows - rows
        colums - columns
        dist - input random number distribution
        Returns:
        array
      • randomDoubleArray

        public double[][] randomDoubleArray(int rows,
                                            int columns,
                                            AbstractDistribution dist)
        Build 2D integer array list with integer numbers from input random number generator
        Parameters:
        rows - rows
        colums - columns
        dist - input random number distribution
        Returns:
        array
      • randomDoubleArrayList

        public DoubleArrayList randomDoubleArrayList(int Ntot,
                                                     AbstractDistribution dist)
        Build double array list with integer numbers from input random number generator
        Parameters:
        Ntot -
        dist -
        Returns:
        array

DMelt 3.0 © DataMelt by jWork.ORG