public class M
extends java.lang.Object
Constructor and Description |
---|
M() |
Modifier and Type | Method and Description |
---|---|
static double[] |
autoCorr(int[] X)
Calculates auto correlation of the array X, returning an array double[]
of the same length (with 1 as the first and last value).
|
static double[] |
autoCorr(int[] X,
int maxShift)
Calculates an auto correlation of the array int[] X until the
maximum shift of int maxShift, returning an array of correlation
coefficients with the length maxShift.
|
static double |
calcCorr(double[] x,
double[] y)
Computes the Pearson's correlation coefficient of
the arrays x and y and returns a double (between -1 and 1)
|
static double |
calcCorr(int[] x,
int[] y)
Computes the Pearson's correlation coefficient of
the arrays x and y and returns a double (between -1 and 1)
|
static Data2D |
hist(double[] data,
int nBins)
Histogram.
|
static Data2D |
histc(double[] data,
double[] binEdges)
Histogram.
|
static double[][] |
histogram(double[] data,
double binWidth) |
static double[][] |
histogram(double[] data,
double binWidth,
double binZero)
Code from flanagan's stat package.
|
static double[] |
interp1(double[] x,
double[] y,
double[] xx)
INTERP1 1-D interpolation (table lookup);
interpolates linearly to find yy, the values of the
underlying function y at the points in the array xx.
|
static double[] |
lili2arr(java.util.LinkedList<java.lang.Double> L)
Converts a LinkedList into an array.
|
static void |
main(java.lang.String[] args) |
static double |
max(double[] x)
Returns the maximum value of an array.
|
static int |
max(int[] x)
Returns the maximum value of an array.
|
static double |
max(java.util.LinkedList<java.lang.Double> x)
Returns the maximum value of an LinkedList
|
static double |
mean(double[] x)
Returns the arithmetic mean value of an array.
|
static double |
mean(java.util.LinkedList<java.lang.Double> x)
Returns the arithmetic mean value of an LinkedList
|
static double |
mean(long[] x)
Returns the arithmetic mean value of an array.
|
static double |
min(double[] x)
Returns the minimum value of an array.
|
static int |
min(int[] x)
Returns the minimum value of an array.
|
static double |
min(java.util.LinkedList<java.lang.Double> x)
Returns the minimum value of an array.
|
static double |
mode(double[] arr)
Calculates a mode value for the double[] array taking a 10% binWidth
rounded to the nearest power of 10.
|
static double |
mode(double[] arr,
double binWidth)
Calculates a mode values (most often value) of the input array double[]
using double binWidth as categorisation units.
|
static void |
out(java.lang.String str) |
static void |
outn(java.lang.String str) |
static double |
sum(double[] x)
Returns the sum of an array.
|
static double |
sum(java.util.LinkedList<java.lang.Double> x)
Returns the sum of an LinkedList
|
static long |
sum(long[] x)
Returns the sum of an array.
|
static double |
var(double[] x)
Returns the variance of an array.
|
public static int min(int[] x)
x
- input arraypublic static double min(double[] x)
x
- input arraypublic static double min(java.util.LinkedList<java.lang.Double> x)
x
- input LinkedListpublic static int max(int[] x)
x
- input arraypublic static double max(double[] x)
x
- input arraypublic static double max(java.util.LinkedList<java.lang.Double> x)
x
- input arraypublic static double mean(double[] x)
x
- input arraypublic static double mean(long[] x)
x
- input arraypublic static double mean(java.util.LinkedList<java.lang.Double> x)
x
- input arraypublic static double sum(double[] x)
x
- input arraypublic static long sum(long[] x)
x
- input arraypublic static double sum(java.util.LinkedList<java.lang.Double> x)
x
- input arraypublic static double var(double[] x)
x
- input arraypublic static double[] autoCorr(int[] X)
X
- input array int[].public static double[] autoCorr(int[] X, int maxShift)
X
- maxShift
- public static double calcCorr(int[] x, int[] y)
x
- input array (int[]).y
- input array (int[]); must be same length as x.public static double calcCorr(double[] x, double[] y)
x
- input array (double[]).y
- input array (double[]); must be same length as x.public static double mode(double[] arr)
arr
- input array double[]public static double mode(double[] arr, double binWidth)
arr
- double[] array of valuesbinWidth
- double bin widthpublic static double[] lili2arr(java.util.LinkedList<java.lang.Double> L)
L
- input LinkedListpublic static double[] interp1(double[] x, double[] y, double[] xx)
x
- input vectory
- input vector with the same lengthxx
- x values for the interpolated vectorpublic static void main(java.lang.String[] args)
public static Data2D hist(double[] data, int nBins)
data
- Data arraynBins
- Number of bins of the histogrampublic static Data2D histc(double[] data, double[] binEdges)
data
- binEdges
- public static double[][] histogram(double[] data, double binWidth)
data
- binWidth
- public static double[][] histogram(double[] data, double binWidth, double binZero)
data
- binWidth
- binZero
- public static void out(java.lang.String str)
public static void outn(java.lang.String str)