Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fun.diag.ks.g

Compute the simulated Kolmogorov-Smirnov tests for the unimodal dataset


Description

This function counts the number of times the p-value exceed 0.05 for the null hypothesis that the observations simulated from the fitted distribution is the same as the observations simulated from the unimodal data set.

Usage

fun.diag.ks.g(result, data, no.test = 1000, len = floor(0.9 * length(data)), 
param, alpha = 0.05)

Arguments

result

A vector representing the four parameters of the generalised lambda distribution.

data

The unimodal dataset.

no.test

Total number of tests required.

len

Number of data to sample.

param

Type of the generalised lambda distribution, "rs" or "fmkl".

alpha

Significance level of KS test.

Value

A numerical value representing number of times the p-value exceeds alpha.

Note

If there are ties, jittering is used in ks.gof.

Author(s)

Steve Su

References

Stephens, M. A. (1986). Tests based on EDF statistics. In Goodness-of-Fit Techniques. D'Agostino, R. B. and Stevens, M. A., eds. New York: Marcel Dekker.

Su, S. (2005). A Discretized Approach to Flexibly Fit Generalized Lambda Distributions to Data. Journal of Modern Applied Statistical Methods (November): 408-424.

Su (2007). Nmerical Maximum Log Likelihood Estimation for Generalized Lambda Distributions. Computational Statistics and Data Analysis: *51*, 8, 3983-3998.

Su (2007). Fitting Single and Mixture of Generalized Lambda Distributions to Data via Discretized and Maximum Likelihood Methods: GLDEX in R. Journal of Statistical Software: *21* 9.

See Also

Examples

## Generate 1000 random observations from Normal distribution with mean=100, 
## standard deviation=10. Save this as junk
# junk<-rnorm(1000,100,10)

## Fit junk using RPRS method via the maxmum likelihood.
# fit1<-fun.RPRS.ml(junk, c(-1.5, 1.5), leap = 3)

## Calculate the simulated KS test result:
# fun.diag.ks.g(fit1,junk,param="rs")

GLDEX

Fitting Single and Mixture of Generalised Lambda Distributions (RS and FMKL) using Various Methods

v2.0.0.7
GPL (>= 3)
Authors
Steve Su, with contributions from: Diethelm Wuertz, Martin Maechler and Rmetrics core team members for low discrepancy algorithm, Juha Karvanen for L moments codes, Robert King for gld C codes and starship codes, Benjamin Dean for corrections and input in ks.gof code and R core team for histsu function.
Initial release
2020-02-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.