Performs the nonparametric Pettitt test to detect a single abrupt change in the central tendency of a time series. Under the null hypothesis, there is no change.
eda_pettitt_test(data, years, alpha = 0.05)
A list containing the test results, including:
data
: The data
argument.
years
: The years
argument.
alpha
: The significance level as specified in the alpha
argument.
null_hypothesis
: A string describing the null hypothesis.
alternative_hypothesis
: A string describing the alternative hypothesis.
u_series
: Numeric vector of absolute U-statistics for all years.
statistic
: The test statistic and maximum absolute U-statistic.
bound
: The critical value of the test statistic based on alpha
.
change_points
: A dataframe containing the potential change point.
p_value
: An asymptotic approximation of the p-value for the test.
reject
: Logical scalar. If TRUE
, the null hypothesis was rejected.
change_points
contains the years, test statistics, and p-values of each
potential change point. If no change points were identified, change_points
is empty.
Numeric vector of observed annual maximum series values. Must be strictly positive, finite, and not missing.
Numeric vector of observation years corresponding to data
.
Must be the same length as data
and strictly increasing.
Numeric scalar in \([0.01, 0.1]\). The significance level for confidence intervals or hypothesis tests. Default is 0.05.
Pettitt, A.N., 1979. A Non-parametric Approach to the Change-point Problem. J. Royal Statistics Society 28 (2), 126–135. http://www.jstor.org/stable/2346729
plot_pettitt_test()
, eda_mks_test()
data <- rnorm(n = 100, mean = 100, sd = 10)
years <- seq(from = 1901, to = 2000)
eda_pettitt_test(data, years)
Run the code above in your browser using DataLab