WOLFRAM

KuiperTest[data]

tests whether data is normally distributed using the Kuiper test.

KuiperTest[data,dist]

tests whether data is distributed according to dist using the Kuiper test.

KuiperTest[data,dist,"property"]

returns the value of "property".

Details and Options

  • KuiperTest performs the Kuiper goodness-of-fit test with null hypothesis that data was drawn from a population with distribution dist and alternative hypothesis that it was not.
  • By default a probability value or -value is returned.
  • A small -value suggests that it is unlikely that the data came from dist.
  • The dist can be any symbolic distribution with numeric and symbolic parameters or a dataset.
  • The data can be univariate {x1,x2,} or multivariate {{x1,y1,},{x2,y2,},}.
  • The Kuiper test assumes that the data came from a continuous distribution.
  • The Kuiper test effectively uses a test statistic based on where is the empirical CDF of data and is the CDF of dist.
  • For multivariate tests, the sum of the univariate marginal -values is used and is assumed to follow a UniformSumDistribution under .
  • KuiperTest[data,dist,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • KuiperTest[data,dist,"property"] can be used to directly give the value of "property".
  • Properties related to the reporting of test results include:
  • "PValue"-value
    "PValueTable"formatted version of "PValue"
    "ShortTestConclusion"a short description of the conclusion of a test
    "TestConclusion"a description of the conclusion of a test
    "TestData"test statistic and -value
    "TestDataTable"formatted version of "TestData"
    "TestStatistic"test statistic
    "TestStatisticTable"formatted "TestStatistic"
  • The following properties are independent of which test is being performed.
  • Properties related to the data distribution include:
  • "FittedDistribution"fitted distribution of data
    "FittedDistributionParameters"distribution parameters of data
  • The following options can be given:
  • Method Automaticthe method to use for computing -values
    SignificanceLevel0.05cutoff for diagnostics and reporting
  • For a test for goodness-of-fit, a cutoff is chosen such that is rejected only if . The value of used for the "TestConclusion" and "ShortTestConclusion" properties is controlled by the SignificanceLevel option. By default is set to 0.05.
  • With the setting Method->"MonteCarlo", datasets of the same length as the input are generated under using the fitted distribution. The EmpiricalDistribution from KuiperTest[si,dist,"TestStatistic"] is then used to estimate the -value.

Examples

open allclose all

Basic Examples  (4)Summary of the most common use cases

Perform a Kuiper test for normality:

Out[2]=2

Test the fit of some data to a particular distribution:

Out[2]=2

Compare the distributions of two datasets:

Out[3]=3

Extract the test statistic from a Kuiper test:

Out[2]=2

Scope  (9)Survey of the scope of standard use cases

Testing  (6)

Perform a Kuiper test for normality:

The -value for the normal data is large compared to the -value for the non-normal data:

Out[3]=3
Out[4]=4

Test the goodness-of-fit to a particular distribution:

Out[2]=2
Out[3]=3

Compare the distributions of two datasets:

Out[2]=2

The two datasets do not have the same distribution:

Out[4]=4

Test for multivariate normality:

Out[2]=2
Out[3]=3

Test for goodness-of-fit to any multivariate distribution:

Out[3]=3
Out[4]=4

Create a HypothesisTestData object for repeated property extraction:

Out[2]=2

The properties available for extraction:

Out[3]=3

Reporting  (3)

Tabulate the results of the Kuiper test:

The full test table:

Out[3]=3

A -value table:

Out[4]=4

The test statistic:

Out[5]=5

Retrieve the entries from a Kuiper test table for custom reporting:

Out[2]=2
Out[3]=3
Out[4]=4

Report test conclusions using "ShortTestConclusion" and "TestConclusion":

Out[3]=3

The conclusion may differ at a different significance level:

Out[6]=6

Options  (3)Common values & functionality for each option

Method  (3)

Use Monte Carlo-based methods for a computation formula:

Out[2]=2
Out[3]=3

Set the number of samples to use for Monte Carlo-based methods:

The Monte Carlo estimate converges to the true -value with increasing samples:

Out[4]=4

Set the random seed used in Monte Carlo-based methods:

The seed affects the state of the generator and has some effect on the resulting -value:

Out[4]=4

Applications  (2)Sample problems that can be solved with this function

A power curve for the Kuiper test:

Visualize the approximate power curve:

Out[4]=4

Estimate the power of the Kuiper test when the underlying distribution is a UniformDistribution[{-4,4}], the test size is 0.05, and the sample size is 12:

Out[5]=5

Spatial signs transform bivariate data to points on a unit circle and are often used in tests of location. The null hypothesis can be tested by determining whether the spatial signs are significantly clustered:

The spatial sign function:

Clustering occurs for nonzero mean vectors:

Out[3]=3

A bivariate test for location using spatial signs and Kuiper's test:

Out[5]=5

The test does not reject when the mean is close to the null value:

Out[6]=6

The test rejects the null hypothesis when the mean is not close to the null value:

Out[7]=7

Properties & Relations  (7)Properties of the function, and connections to other functions

By default, univariate data is compared to a NormalDistribution:

Out[3]=3

The parameters have been estimated from the data:

Out[4]=4

Multivariate data is compared to a MultinormalDistribution by default:

Out[3]=3

The parameters of the test distribution are estimated from the data if not specified:

Out[2]=2

Specified parameters are not estimated:

Out[3]=3
Out[4]=4

Maximum-likelihood estimates are used for unspecified parameters of the test distribution:

Out[2]=2
Out[3]=3

If the parameters are unknown, KuiperTest applies a correction when possible:

Out[2]=2

The parameters are estimated but no correction is applied:

Out[3]=3

The fitted distribution is the same as before and the -value is corrected:

Out[5]=5
Out[6]=6

Independent marginal densities are assumed in tests for multivariate goodness-of-fit:

Out[2]=2

The test statistic is identical when independence is assumed:

Out[3]=3

The Kuiper test works with the values only when the input is a TimeSeries:

Out[2]=2
Out[3]=3

Possible Issues  (3)Common pitfalls and unexpected behavior

The Kuiper test is not intended for discrete distributions:

Out[2]=2

The test tends to be quite conservative:

Out[5]=5

Use Monte Carlo methods or PearsonChiSquareTest in these cases:

Out[6]=6
Out[7]=7

The Kuiper test is not valid for some distributions when parameters have been estimated from the data:

Out[2]=2

Provide parameter values if they are known:

Out[3]=3

Alternatively, use Monte Carlo methods to approximate the -value:

Out[4]=4

Ties in the data are ignored:

Out[2]=2
Out[3]=3

Differences may be more apparent with larger numbers of ties:

Out[4]=4
Out[5]=5

Neat Examples  (1)Surprising or curious use cases

Compute the statistic when the null hypothesis is true:

The test statistic given a particular alternative:

Compare the distributions of the test statistics:

Out[4]=4
Wolfram Research (2010), KuiperTest, Wolfram Language function, https://reference.wolfram.com/language/ref/KuiperTest.html.
Wolfram Research (2010), KuiperTest, Wolfram Language function, https://reference.wolfram.com/language/ref/KuiperTest.html.

Text

Wolfram Research (2010), KuiperTest, Wolfram Language function, https://reference.wolfram.com/language/ref/KuiperTest.html.

Wolfram Research (2010), KuiperTest, Wolfram Language function, https://reference.wolfram.com/language/ref/KuiperTest.html.

CMS

Wolfram Language. 2010. "KuiperTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KuiperTest.html.

Wolfram Language. 2010. "KuiperTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KuiperTest.html.

APA

Wolfram Language. (2010). KuiperTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KuiperTest.html

Wolfram Language. (2010). KuiperTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KuiperTest.html

BibTeX

@misc{reference.wolfram_2025_kuipertest, author="Wolfram Research", title="{KuiperTest}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/KuiperTest.html}", note=[Accessed: 19-June-2025 ]}

@misc{reference.wolfram_2025_kuipertest, author="Wolfram Research", title="{KuiperTest}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/KuiperTest.html}", note=[Accessed: 19-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_kuipertest, organization={Wolfram Research}, title={KuiperTest}, year={2010}, url={https://reference.wolfram.com/language/ref/KuiperTest.html}, note=[Accessed: 19-June-2025 ]}

@online{reference.wolfram_2025_kuipertest, organization={Wolfram Research}, title={KuiperTest}, year={2010}, url={https://reference.wolfram.com/language/ref/KuiperTest.html}, note=[Accessed: 19-June-2025 ]}