Kotlin Notebook
Probieren Sie diesen Leitfaden als Kotlin Notebook mit Kandy-Visualisierungen aus — führen Sie die Zellen aus, um Diagramme zu sehen und die Daten interaktiv zu erkunden.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Überprüfen Sie Normalität, Varianzhomogenität und Verteilungsanpassung, bevor Sie parametrische Methoden anwenden.
| Test | Funktion | Geeignet für |
|---|---|---|
| Shapiro-Wilk | shapiroWilkTest(sample) | Universeller Standard, Stichproben bis ~5000 |
| Anderson-Darling | andersonDarlingTest(sample) | Empfindlich gegenüber Abweichungen in den Rändern |
| D’Agostino-Pearson | dagostinoPearsonTest(sample) | Omnibus-Test über Schiefe und Kurtosis, n > 20 |
| Jarque-Bera | jarqueBeraTest(sample) | Große Stichproben, prüft Schiefe und Kurtosis gemeinsam |
val sensorReadings =
doubleArrayOf(
150.2,
151.8,
149.6,
152.1,
150.9,
151.3,
149.8,
152.5,
150.4,
151.1,
150.7,
149.5,
151.6,
150.0,
152.3,
151.0,
149.9,
150.8,
151.5,
150.3,
151.2,
149.7,
150.6,
152.0,
150.1,
151.4,
149.4,
151.9,
150.5,
151.7,
)
val shapiro = shapiroWilkTest(sensorReadings)
val anderson = andersonDarlingTest(sensorReadings)
val dagostino = dagostinoPearsonTest(sensorReadings)
val jarqueBera = jarqueBeraTest(sensorReadings)
shapiro.pValue // Shapiro-Wilk
anderson.pValue // Anderson-Darling
dagostino.pValue // D'Agostino-Pearson
jarqueBera.pValue // Jarque-Bera
val summary = sensorReadings.describe()
summary.skewness // close to 0 for symmetric data
summary.kurtosis // close to 0 (excess) for Normal-like tails
| Test | Funktion | Setzt Normalität voraus? |
|---|---|---|
| Levene | leveneTest(group1, group2, ...) | Nein — robust gegenüber Nicht-Normalität |
| Bartlett | bartlettTest(group1, group2, ...) | Ja — trennschärfer bei normalverteilten Daten |
| Fligner-Killeen | flignerKilleenTest(group1, group2, ...) | Nein — nicht-parametrisch, medianbasiert |
val batchA = doubleArrayOf(48.2, 47.8, 49.1, 48.5, 47.9, 48.7, 48.3, 49.0, 48.1, 48.6)
val batchB = doubleArrayOf(51.3, 50.8, 52.1, 51.0, 51.7, 50.5, 51.9, 51.2, 50.9, 51.5)
val batchC = doubleArrayOf(49.5, 50.2, 49.8, 50.0, 49.3, 50.4, 49.7, 50.1, 49.6, 50.3)
val levene = leveneTest(batchA, batchB, batchC)
val bartlett = bartlettTest(batchA, batchB, batchC)
val fligner = flignerKilleenTest(batchA, batchB, batchC)
levene.pValue // Levene
bartlett.pValue // Bartlett
fligner.pValue // Fligner-Killeen
val anova = oneWayAnova(batchA, batchB, batchC)
anova.fStatistic
anova.pValue
val temperatureReadings =
doubleArrayOf(
155.2,
154.8,
156.1,
155.5,
154.3,
155.9,
155.0,
156.3,
154.7,
155.4,
155.8,
154.5,
156.0,
155.3,
154.9,
155.7,
155.1,
156.2,
154.6,
155.6,
)
// Fit Normal from sample
val fitted =
NormalDistribution(
mu = temperatureReadings.mean(),
sigma = temperatureReadings.standardDeviation(),
)
val ks = kolmogorovSmirnovTest(temperatureReadings, fitted)
ks.statistic // smaller means better fit
ks.pValue
// Defect counts across 5 product categories
val observedDefects = intArrayOf(12, 18, 25, 15, 30)
// Test against uniform expectation (null = equal probability per category)
val uniform = chiSquaredTest(observedDefects)
uniform.pValue
// Test against specific expected counts
val expectedCounts = doubleArrayOf(20.0, 20.0, 20.0, 20.0, 20.0)
val specific = chiSquaredTest(observedDefects, expectedCounts)
specific.pValue
val morningReadings =
doubleArrayOf(
155.2,
154.8,
156.1,
155.5,
154.3,
155.9,
155.0,
156.3,
154.7,
155.4,
)
val nightReadings =
doubleArrayOf(
156.1,
155.3,
157.0,
156.5,
155.8,
156.8,
155.5,
157.2,
155.9,
156.3,
)
val twoSampleKs = kolmogorovSmirnovTest(morningReadings, nightReadings)
twoSampleKs.pValue // low p-value suggests different underlying distributions
War diese Seite hilfreich?