computeTestKolmogorovTriangular {rotRPackage} | R Documentation |
This ROT function, called from a Test C++ object, is given a sample, a point, the necessary distribution parameters and optionnaly a test level. It then returns the result of a K-S test against the null hypothesis that the sample has un underlying Triangular distribution of the given parameters and returns a list containing the result and test p-value.
computeTestKolmogorovTriangular(numericalSample, a, m, b, testLevel = 0.95, estimatedParameters)
numericalSample |
the sample to be tested (numeric vector) |
a |
The Triangular distribution aParameter. |
m |
The Triangular distribution bParameter. |
b |
The Triangular distribution mParameter. |
testLevel |
the test level. (scalar in [0:1]) |
estimatedParameters |
the test level. (scalar in [0:1]) |
A list is returned, containing :
testResult |
The result. 1 means H0 is not rejected. (scalar) |
threshold |
The threshold applied to the p-value when deciding the outcome of the test. |
pValue |
The test p-value. (scalar) |
Pierre-Matthieu Pair, Softia for EDF.
# Standard Triangular distribution example. a <- -1.0 m <- 2.0 b <- 6.0 point <- runif(1000) sample <- ifelse(point < (m - a) / (b - a), a + sqrt(point * (b - a) * (m - a)), b - sqrt((1.0 - point) * (b - a) * (b - m))) print(computeTestKolmogorovTriangular(sample, -1, 2, 6)) print(computeTestKolmogorovTriangular(sample, -1, 1.5, 6))