| PBGoF-precomputed-tests | R Documentation |
Computes a skew-normal goodness-of-fit statistic and obtains an approximate p-value from a precomputed 100,000-replicate quantile table.
PBGoF_ks_test(data, ks_table = NULL)
PBGoF_cvm_test(data, cvm_table = NULL)
data |
A numeric vector whose length is represented in the table. |
ks_table, cvm_table |
Optional custom quantile tables. If |
The fitted absolute CP skewness is rounded to two decimal places and truncated
to [0.01, 0.99]. P-values are conservative step-function approximations
between 0.01 and 0.99. No interpolation is performed.
If the fitted gamma1 is negative, table lookup uses
abs(gamma1). Reflection of a skew-normal variable changes the signs of
the DP shape parameter and CP skewness, but the null distributions of the EDF
statistics are invariant to this sign change (Mateu-Figueras et al., 2007).
The bundled tables therefore require only non-negative skewness values.
For samples larger than 500, all observations remain in the fit and empirical
distribution function, while the external statistic multiplier and table row
use n_used = 500.
A list containing statistic, actual sample size n, lookup and
scaling sample size n_used, gamma1_hat, gamma1_used, and
p.value.
Mateu-Figueras, G., Puig, P., and Pewsey, A. (2007). Goodness-of-fit tests for the skew-normal distribution when the parameters are estimated from the data. Communications in Statistics—Theory and Methods, 36(9), 1735–1755. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/03610920601126217")}
set.seed(123)
x <- sn::rsn(50, xi = 0, omega = 1, alpha = 3)
PBGoF_ks_test(x)
PBGoF_cvm_test(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.