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

fun.diag2

Diagnostic function for empirical data distribution fits through the resample Kolmogorov-Smirnoff tests


Description

This function is primarily designed to be used for testing the fitted distribution with reference to an empirical data. It is also tailored for output obtained from the fun.data.fit.ml function.

Usage

fun.diag2(result, data, no.test = 1000, len=100, alpha = 0.05)

Arguments

result

Output from fun.data.fit.ml function.

data

Observations in which the distribution was fitted upon.

no.test

Number of times to do the KS tests.

len

Number of observations to sample from the data. This is also the number of observations sampled from the fitted distribution in each KS test.

alpha

Significance level of KS test.

Value

A vector showing the number of times the KS p-value is greater than alpha for each of the distribution fit strategy.

Note

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

Author(s)

Steve Su

References

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

Su, S. (2007). Numerical Maximum Log Likelihood Estimation for Generalized Lambda Distributions. Journal of 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

## Fits a Normal 3,2 distribution:
# junk<-rnorm(1000,3,2)
# fit<-fun.data.fit.ml(junk)

## Compute the resample K-S test results.
# fun.diag2(fit,junk)

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.