类 StatsUtil
- java.lang.Object
-
- org.meteoinfo.math.stats.StatsUtil
-
public class StatsUtil extends java.lang.Object- 作者:
- Yaqiang Wang
-
-
构造器概要
构造器 构造器 说明 StatsUtil()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static double[]chiSquareTest(Array o)Chi-square test of independencestatic double[]chiSquareTest(Array e, Array o)Chi-square teststatic java.lang.Objectcov(Array a, boolean bias)Computes covariances for columns of a matrix.static Arraycov(Array x, Array y, boolean bias)Computes covariances for pairs of arrays or columns of a matrix.static doublecovariance(Array x, Array y, boolean bias)Computes covariance of two arrays.static doublekendalltau(Array x, Array y)Calculates Kendall's tau, a correlation measure for ordinal data.static Array[]multipleLineRegress_OLS(Array y, Array x)Implements ordinary least squares (OLS) to estimate the parameters of a multiple linear regression model.static Array[]multipleLineRegress_OLS(Array y, Array x, boolean noIntercept)Implements ordinary least squares (OLS) to estimate the parameters of a multiple linear regression model.static double[]pairedTTest(Array a, Array b)Paired test evaluating the null hypothesis that the mean difference between corresponding (paired) elements of the double[] arrays sample1 and sample2 is zero.static double[]pearsonr(Array x, Array y)Calculates a Pearson correlation coefficient.static Array[]pearsonr(Array x, Array y, int axis)Calculates a Pearson correlation coefficient.static doublepercentile(Array a, double p)Returns an estimate of the pth percentile of the values in the array.static Arraypercentile(Array a, double p, int axis)Returns an estimate of the pth percentile of the values in the array along an axis.static java.lang.Objectspearmanr(Array a)Computes Spearman's rank correlation for columns of a matrix.static Arrayspearmanr(Array x, Array y)Computes Spearman's rank correlation for pairs of arrays or columns of a matrix.static double[]tTest(Array a, double mu)One sample t teststatic double[]tTest(Array a, Array b)unpaired, two-sided, two-sample t-test.
-
-
-
方法详细资料
-
covariance
public static double covariance(Array x, Array y, boolean bias)
Computes covariance of two arrays.- 参数:
x- X datay- Y databias- If true, returned value will be bias-corrected- 返回:
- The covariance
-
cov
public static Array cov(Array x, Array y, boolean bias)
Computes covariances for pairs of arrays or columns of a matrix.- 参数:
x- X datay- Y databias- If true, returned value will be bias-corrected- 返回:
- The covariance matrix
-
cov
public static java.lang.Object cov(Array a, boolean bias)
Computes covariances for columns of a matrix.- 参数:
a- Matrix databias- If true, returned value will be bias-corrected- 返回:
- Covariant matrix or value
-
kendalltau
public static double kendalltau(Array x, Array y)
Calculates Kendall's tau, a correlation measure for ordinal data.- 参数:
x- X datay- Y data- 返回:
- Kendall's tau correlation.
-
pearsonr
public static double[] pearsonr(Array x, Array y)
Calculates a Pearson correlation coefficient.- 参数:
x- X datay- Y data- 返回:
- Pearson correlation and p-value.
-
pearsonr
public static Array[] pearsonr(Array x, Array y, int axis) throws InvalidRangeException
Calculates a Pearson correlation coefficient.- 参数:
x- X datay- Y dataaxis- Special axis for calculation- 返回:
- Pearson correlation and p-value.
- 抛出:
InvalidRangeException
-
spearmanr
public static Array spearmanr(Array x, Array y)
Computes Spearman's rank correlation for pairs of arrays or columns of a matrix.- 参数:
x- X datay- Y data- 返回:
- Spearman's rank correlation
-
spearmanr
public static java.lang.Object spearmanr(Array a)
Computes Spearman's rank correlation for columns of a matrix.- 参数:
a- Matrix data- 返回:
- Spearman's rank correlation
-
multipleLineRegress_OLS
public static Array[] multipleLineRegress_OLS(Array y, Array x)
Implements ordinary least squares (OLS) to estimate the parameters of a multiple linear regression model.- 参数:
y- Y sample data - one dimension arrayx- X sample data - two dimension array- 返回:
- Estimated regression parameters and residuals
-
multipleLineRegress_OLS
public static Array[] multipleLineRegress_OLS(Array y, Array x, boolean noIntercept)
Implements ordinary least squares (OLS) to estimate the parameters of a multiple linear regression model.- 参数:
y- Y sample data - one dimension arrayx- X sample data - two dimension arraynoIntercept- No intercept- 返回:
- Estimated regression parameters and residuals
-
percentile
public static double percentile(Array a, double p)
Returns an estimate of the pth percentile of the values in the array.- 参数:
a- Input arrayp- The percentile value to compute- 返回:
- The pth percentile
-
percentile
public static Array percentile(Array a, double p, int axis) throws InvalidRangeException
Returns an estimate of the pth percentile of the values in the array along an axis.- 参数:
a- Input arrayp- The percentile value to computeaxis- The axis- 返回:
- The pth percentile
- 抛出:
InvalidRangeException
-
tTest
public static double[] tTest(Array a, double mu)
One sample t test- 参数:
a- Input datamu- Expected value in null hypothesis- 返回:
- t_statistic and p_value
-
tTest
public static double[] tTest(Array a, Array b)
unpaired, two-sided, two-sample t-test.- 参数:
a- Sample a.b- Sample b.- 返回:
- t_statistic and p_value
-
pairedTTest
public static double[] pairedTTest(Array a, Array b)
Paired test evaluating the null hypothesis that the mean difference between corresponding (paired) elements of the double[] arrays sample1 and sample2 is zero.- 参数:
a- Sample a.b- Sample b.- 返回:
- t_statistic and p_value
-
chiSquareTest
public static double[] chiSquareTest(Array e, Array o)
Chi-square test- 参数:
e- Expected.o- Observed.- 返回:
- Chi-square_statistic and p_value
-
chiSquareTest
public static double[] chiSquareTest(Array o)
Chi-square test of independence- 参数:
o- Observed.- 返回:
- Chi-square_statistic and p_value
-
-