Package oms3.util
Class Stats
- java.lang.Object
-
- oms3.util.Stats
-
public class Stats extends Object
- Author:
- Olaf David
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublebias(double[] pred, double[] valid)static doubleerr_sum(double[] validation, double[] prediction)static doublegradient(double[] xData, double[] yData)static doubleintercept(double[] xData, double[] yData)static doubleioa(double[] prediction, double[] validation, double pow)Calculates the index of agreement (ioa) between a test data set and a verification data set after Willmot & Wicks (1980).static doublelag1(double[] vals)Returns the lag-1 autocorrelation of a dataset;static intlength(double[] vals)static doublemax(double[] vals)static doublemean(double[] vals)static doublemeandev(double[] vals)static doublemedian(double[] vals)static doublemin(double[] vals)static doublenashsut(double[] prediction, double[] validation, double pow)Calculates the efficiency between a test data set and a verification data set after Nash & Sutcliffe (1970).static doublenashsut_log(double[] prediction, double[] validation, double pow)Calculates the efficiency between the log values of a test data set and a verification data set after Nash & Sutcliffe (1970).static doublenorm_vec(double x, double y, double z)Normalized Vector.static doubleproduct(double[] vals)static doublequantile(double[] vals, double phi)static doubler2(double[] xData, double[] yData)static doublerandom(double min, double max)Generate a random number in a range.static doublerange(double[] vals)static doublermse(double[] pred, double[] valid)static doubleround(double val, int places)Round a double value to a specified number of decimal places.static floatround(float val, int places)Round a float value to a specified number of decimal places.static doublestddev(double[] vals)static doublestderr(double[] vals)static doublesum(double[] vals)static doublevariance(double[] vals)
-
-
-
Method Detail
-
norm_vec
public static double norm_vec(double x, double y, double z)Normalized Vector.
-
max
public static double max(double[] vals)
-
min
public static double min(double[] vals)
-
range
public static double range(double[] vals)
-
length
public static int length(double[] vals)
-
median
public static double median(double[] vals)
-
mean
public static double mean(double[] vals)
-
stddev
public static double stddev(double[] vals)
-
stderr
public static double stderr(double[] vals)
-
variance
public static double variance(double[] vals)
-
meandev
public static double meandev(double[] vals)
-
sum
public static double sum(double[] vals)
-
product
public static double product(double[] vals)
-
quantile
public static double quantile(double[] vals, double phi)
-
lag1
public static double lag1(double[] vals)
Returns the lag-1 autocorrelation of a dataset;
-
rmse
public static double rmse(double[] pred, double[] valid)
-
bias
public static double bias(double[] pred, double[] valid)
-
nashsut
public static double nashsut(double[] prediction, double[] validation, double pow)Calculates the efficiency between a test data set and a verification data set after Nash & Sutcliffe (1970). The efficiency is described as the proportion of the cumulated cubic deviation between both data sets and the cumulated cubic deviation between the verification data set and its mean value.- Parameters:
prediction- the simulation data setvalidation- the validation (observed) data setpow- the power for the deviation terms- Returns:
- the calculated efficiency or -9999 if an error occurs
-
nashsut_log
public static double nashsut_log(double[] prediction, double[] validation, double pow)Calculates the efficiency between the log values of a test data set and a verification data set after Nash & Sutcliffe (1970). The efficiency is described as the proportion of the cumulated cubic deviation between both data sets and the cumulated cubic deviation between the verification data set and its mean value.- Parameters:
prediction- the simulation data setvalidation- the validation (observed) data setpow- the power for the deviation terms- Returns:
- the calculated log_efficiency or -9999 if an error occurs
-
err_sum
public static double err_sum(double[] validation, double[] prediction)
-
ioa
public static double ioa(double[] prediction, double[] validation, double pow)Calculates the index of agreement (ioa) between a test data set and a verification data set after Willmot & Wicks (1980). The ioa is described as the proportion of the cumulated cubic deviation between both data sets and the squared sum of the absolute deviations between the verification data set and the test mean value and the test data set and its mean value.- Parameters:
prediction- the test Data setvalidation- the verification data setpow- the power- Returns:
- the calculated ioa or -9999 if an error occurs
-
intercept
public static double intercept(double[] xData, double[] yData)
-
gradient
public static double gradient(double[] xData, double[] yData)
-
r2
public static double r2(double[] xData, double[] yData)
-
round
public static double round(double val, int places)Round a double value to a specified number of decimal places.- Parameters:
val- the value to be rounded.places- the number of decimal places to round to.- Returns:
- val rounded to places decimal places.
-
round
public static float round(float val, int places)Round a float value to a specified number of decimal places.- Parameters:
val- the value to be rounded.places- the number of decimal places to round to.- Returns:
- val rounded to places decimal places.
-
random
public static double random(double min, double max)Generate a random number in a range.- Parameters:
min-max-- Returns:
- the random value in the min/max range
-
-