val normality = shapiroWilkTest(sample)normality.statistic // W statisticnormality.pValue // > 0.05 → no evidence against normalitynormality.isSignificant() // false
val normal = NormalDistribution(mu = stats.mean, sigma = stats.standardDeviation)normal.cdf(6.0) // probability that X ≤ 6.0normal.quantile(0.95) // value below which 95% of the distribution falls
val sample = doubleArrayOf(5.1, 4.9, 5.3, 5.0, 4.8)val result = tTest(sample, mu = 5.0, alternative = Alternative.GREATER)result.statistic // t valueresult.pValue // one-sided p-valueresult.isSignificant() // true or false at α = 0.05result.confidenceInterval // one-sided CI
Kopieren
val x = doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0)val y = doubleArrayOf(2.1, 3.9, 6.2, 7.8, 10.1)pearsonCorrelation(x, y).coefficient // 0.9987simpleLinearRegression(x, y).slope // 1.99