public class Statistics
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
autocorrelation |
protected int |
beginIndex |
protected double[] |
dSeries |
protected int |
endIndex |
protected float[] |
fSeries |
protected int[] |
iSeries |
protected double[] |
minMaxMean
index 0 has min, index 1 has max, index 2 has mean.
|
protected boolean |
minMaxMeanCalculated
Has min/max/mean already been calculated and cached.
|
protected double[] |
partialautocorr |
protected short[] |
sSeries |
protected double |
variance |
protected boolean |
varianceCalculated
Has the variable been calculated and cached.
|
| Constructor and Description |
|---|
Statistics(double[] dSeries)
Creates a new
Statistics instance. |
Statistics(float[] fSeries)
Creates a new
Statistics instance. |
Statistics(int[] iSeries)
Creates a new
Statistics instance. |
Statistics(java.util.List<edu.iris.Fissures.model.QuantityImpl> vals) |
Statistics(java.util.List<edu.iris.Fissures.model.QuantityImpl> vals,
edu.iris.Fissures.model.UnitImpl unit) |
Statistics(edu.iris.Fissures.seismogramDC.LocalSeismogramImpl seismo)
Creates a new
Statistics instance. |
Statistics(short[] sSeries)
Creates a new
Statistics instance. |
| Modifier and Type | Method and Description |
|---|---|
double[] |
acf(int maxlag)
Calculates the autocovariance function out to the given lag.
|
double[] |
acf95conf(int maxlag)
Describe
acf95conf method here. |
double[] |
acfTRatio(int maxlag)
Calculates the TRatio for the acf out to the given max lag.
|
double |
binaryIndexSum(int start,
int finish)
Calulates the sum(i*yi) from beginIndex to endIndex-1.
|
double |
binarySum(int start,
int finish)
Calulates the sum of the series from beginIndex to endIndex-1.
|
double |
binarySumDevLag(int start,
int finish,
double mean,
int lag)
Describe
binarySumDevLag method here. |
double |
binarySumDevSqr(int start,
int finish,
double mean)
Calulates the sum of the square of the difference from the mean.
|
double |
correlation(double[] other) |
double |
covariance(double[] other) |
double |
covariance(Statistics otherStat) |
int |
getLength()
The length of the series.
|
int[] |
histogram(double start,
double width,
int number)
Creates a histogram of the values.
|
double[] |
linearLeastSquares()
Calculates the linear Least Squares slope and intercept for this series.
|
double |
max()
Finds the
max value. |
double |
max(int beginIndex,
int endIndex)
Finds the
max value between index beginIndex and endIndex-1. |
double |
maxDeviation()
Finds the
max deviation from the mean. |
double |
maxDeviation(int beginIndex,
int endIndex)
Finds the
max deviation from the mean between index
beginIndex and endIndex-1. |
double |
mean()
Calulates
mean of the data. |
double |
mean(int beginIndex,
int endIndex)
Finds the
mean value between index beginIndex and endIndex-1. |
double |
min()
Finds the
min value. |
double |
min(int beginIndex,
int endIndex)
Finds the
min value between index beginIndex and endIndex-1. |
double[] |
minMaxMean()
Calculates the min, max and mean.
|
double[] |
minMaxMean(int beginIndex,
int endIndex)
Calculates the min, max and mean from beginIndex to endIndex-1.
|
double[] |
pacf(int maxlag)
Computes the partial autocorrelation function, after Wei, William S.
|
double |
pacf95conf(int maxlag)
Calculates the 95 percent confidence for the pacf.
|
double[] |
pacfTRatio(int maxlag)
Calculates the TRatio for the pacf.
|
double |
rms() |
double |
stddev()
Calulates the standard deviation.
|
java.lang.String |
toString() |
double |
var()
Calualates the unbiased variance, ie 1/(n-1) SUM{(x-mean)^2}.
|
double |
var(double mean)
calculates the unbiased variance w.r.t the given mean.
|
protected int[] iSeries
protected short[] sSeries
protected float[] fSeries
protected double[] dSeries
protected boolean minMaxMeanCalculated
protected double[] minMaxMean
protected double variance
protected boolean varianceCalculated
protected double[] autocorrelation
protected double[] partialautocorr
protected int beginIndex
protected int endIndex
public Statistics(int[] iSeries)
Statistics instance.iSeries - an int[] valuepublic Statistics(short[] sSeries)
Statistics instance.sSeries - a short[] valuepublic Statistics(float[] fSeries)
Statistics instance.fSeries - a float[] valuepublic Statistics(double[] dSeries)
Statistics instance.dSeries - a double[] valuepublic Statistics(edu.iris.Fissures.seismogramDC.LocalSeismogramImpl seismo)
throws edu.iris.Fissures.FissuresException
Statistics instance.seismo - a LocalSeismogramImpl valueedu.iris.Fissures.FissuresExceptionpublic Statistics(java.util.List<edu.iris.Fissures.model.QuantityImpl> vals)
public Statistics(java.util.List<edu.iris.Fissures.model.QuantityImpl> vals,
edu.iris.Fissures.model.UnitImpl unit)
public double min()
min value.public double min(int beginIndex,
int endIndex)
min value between index beginIndex and endIndex-1.beginIndex - first index to searchendIndex - end index, last + 1double valuepublic double max()
max value.double valuepublic double max(int beginIndex,
int endIndex)
max value between index beginIndex and endIndex-1.beginIndex - an int valueendIndex - an int valuedouble valuepublic double maxDeviation()
max deviation from the mean.double valuepublic double maxDeviation(int beginIndex,
int endIndex)
max deviation from the mean between index
beginIndex and endIndex-1.beginIndex - an int valueendIndex - an int valuedouble valuepublic double mean()
mean of the data.double valuepublic double mean(int beginIndex,
int endIndex)
mean value between index beginIndex and endIndex-1.beginIndex - an int valueendIndex - an int valuedouble valuepublic double[] minMaxMean()
public double[] minMaxMean(int beginIndex,
int endIndex)
beginIndex - first indexendIndex - last index +1public double var()
public double var(double mean)
public double rms()
public double stddev()
public double covariance(double[] other)
public double covariance(Statistics otherStat)
public double correlation(double[] other)
public double[] linearLeastSquares()
public double[] acf(int maxlag)
maxlag - the maximum lag to calculate the acfpublic double[] acf95conf(int maxlag)
acf95conf method here.maxlag - an int valuedouble[] valuepublic double[] acfTRatio(int maxlag)
maxlag - the maximu lagpublic double[] pacf(int maxlag)
maxlag - the maximum lagpublic double pacf95conf(int maxlag)
maxlag - the maximum lagpublic double[] pacfTRatio(int maxlag)
maxlag - the maximum lagpublic int getLength()
public int[] histogram(double start,
double width,
int number)
start - binning start valuewidth - bin widthnumber - number of binspublic java.lang.String toString()
toString in class java.lang.Objectpublic double binarySum(int start,
int finish)
start - starting indexfinish - last index +1public double binarySumDevSqr(int start,
int finish,
double mean)
start - first indexfinish - last index+1mean - the meanpublic double binarySumDevLag(int start,
int finish,
double mean,
int lag)
binarySumDevLag method here.start - an int valuefinish - an int valuemean - a double valuelag - an int valuedouble valuepublic double binaryIndexSum(int start,
int finish)
start - starting indexfinish - last index +1