View source: R/measure.ks.pval.R
measure.ks.pval | R Documentation |
Function to compute the p-value of the K-S test, optionally performing a correction by the effective sanmple size
measure.ks.pval(
indexObs = NULL,
indexPrd = NULL,
obs,
prd,
dates = NULL,
corrected = TRUE
)
indexObs |
index computed from the observations |
indexPrd |
index computed from the predictions |
obs |
A vector of observations |
prd |
A vector of predictions |
dates |
Ignored. Introduced for compatibility with the rest of measures |
corrected |
Logical flag. SHound the p-value be corrected by the effective sample size?. Default to |
The two-sample Kolmogorov-Smirnov test has the null hypothesis (H0) that x and y were drawn from the same continuous distribution. Therefore, the null hypothesis can be rejected only when p-values obtained are “small” (i.e. < 0.05 with ci=0.95). Larger values will indicate the H0 can't be rejected. Since the daily time series often used are serially correlated, this function calculates their effective sample size before estimating the p value of the KS statistic in order to avoid the inflation of type I error (i.e. erroneous rejection of the H0). Under the assumption that the underlying time series follow a first-order autoregressive process (Wilks 2006), the effective sample size, neff is defined as follows: neff=n(1-p1)/(1+p1), where p1 is the lag-1 autocorrelation coefficient.
A float number corresponding to the p-value of the K-S test
J. Bedia, S. Brands
Wilks, D. (2006) Statistical methods in the atmospheric sciences, 2nd ed. Elsevier, Amsterdam
The atomic function measure.ks
, returning the KS statistic
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.