public class Statistics extends Object
Constructor and Description |
---|
Statistics() |
Modifier and Type | Method and Description |
---|---|
static double |
autoCorrelation(double[] a,
double[] b)
Autocorrelation between 2 arrays a, b.
|
static double |
autoCorrelation(double[] a,
int a1,
double[] b,
int b1,
int w)
Autocorrelation between 2 arrays a, b.
|
static double |
covariance(double[] a,
double[] b) |
static double |
covariance(double[] a,
int a1,
double[] b,
int b1,
int w) |
static double |
mean(byte... a) |
static double |
mean(double... a) |
static double |
mean(double[] arr,
int a,
int b)
Get the average value of
arr within [a,... |
static double |
mean(float... a) |
static double |
mean(float[] arr,
int a,
int b)
Get the average value of
arr within [a,... |
static double |
mean(int... a) |
static double |
mean(int[] arr,
int a,
int b)
Get the average value of
arr within [a,... |
static double |
median(double[] a)
Computes the median of an array which is already sorted.
|
static double |
stdev(double[] a)
Computes the standard deviation of a sample based on the result of
var(double[]) . |
static double |
var(double[] a)
Computes the maximum likelihood estimate (assuming a normal distribution) and NOT the empirical variance.
|
static double |
var(double[] arr,
int a,
int b)
Computes the maximum likelihood estimate (assuming a normal distribution) and not the empirical variance.
|
static double |
weightedStdev(double[] values,
java.util.function.IntToDoubleFunction weightFunction) |
public static double mean(double... a)
public static double mean(byte... a)
public static double mean(float... a)
public static double mean(int... a)
public static double mean(double[] arr, int a, int b)
arr
within [a,...,b]
.arr
- the input arraya
- start index inclusiveb
- end index inclusive[a,...,b]
public static double mean(float[] arr, int a, int b)
arr
within [a,...,b]
.arr
- the input arraya
- start index inclusiveb
- end index inclusive[a,...,b]
public static double mean(int[] arr, int a, int b)
arr
within [a,...,b]
.arr
- the input arraya
- start index inclusiveb
- end index inclusive[a,...,b]
public static double median(double[] a)
a
is not sorted, this method will just
return some arbitrary value of a
(impair number of elements)
or the average value of two arbitrary values of a
.a
- A sorted array.a
.public static double var(double[] a)
a
- 1 / n * sumi=1n(ai - avg(a))
,1 / n * sumi=1n(ai2) - avg(a)2
public static double var(double[] arr, int a, int b)
arr
- a
- from indexb
- to index (inclusive)1 / n * sumi=1n(ai - avg(a))
,1 / n * sumi=1n(ai2) - avg(a)2
public static double stdev(double[] a)
var(double[])
.a
- sqrt(1 / n * sumi=1n(ai - avg(a)))
,sqrt(1 / n * sumi=1n(ai2) - avg(a)2)
public static double covariance(double[] a, double[] b)
public static double covariance(double[] a, int a1, double[] b, int b1, int w)
public static double autoCorrelation(double[] a, int a1, double[] b, int b1, int w)
a
- array 1a1
- start index INCLUSIVEb
- array 2b1
- start index INCLUSIVEw
- with of the compare windowpublic static double autoCorrelation(double[] a, double[] b)
a
- array 1b
- array 2public static double weightedStdev(double[] values, java.util.function.IntToDoubleFunction weightFunction)
values
- weightFunction
- that receives the index of the array as input and outputs the accorind weighthttp://en.wikipedia.org/wiki/Mean_square_weighted_deviation
Copyright © 2015. All Rights Reserved.