I had a problem when I tried to test the fitting of my data with the generalized Pareto distribution. I used the MLE to estimate the two parameters 'shape' and 'scale' and I generated a vector of random variables GPD with them. Does this make sense if I test the goodness of fit (with Cramer von Mises criterion – cvm.test – but it still doesn't work) between my data and the vector generated?
I found some lines at the end of page 5 in this pdf saying that the test may not true (I'm not sure that I correctly understood). But if I don't fit my data with the values generated, so what should be fitted?
A Cramer von Mises test is for a fully specified distribution, not one where you fitted parameters.
When you fit the parameters, the test statistic is nearly always smaller than the one for a prespecified set of parameters. The fitted model will be too close, and your significance level will be far smaller than you intend (and consequently power will also be low).
You can deal with it if you adjust the test for the fitting*, but it's no longer distribution free.
*(e.g. by simulating the distribution of the test statistic under estimation and using that simulated null distribution rather than the tabulated distribution)
- Solved – Goodness of fit test: question about Anderson–Darling test and Cramér–von Mises criterion
- Solved – R -Goodness of fit for t distribution with estimated parameters
- Solved – R and SAS produce the same test-statistics but different p values for normality tests
- Solved – Compare distributions of two ECDFs
- Solved – 2 Sample Kolmogorov-Smirnov vs. Anderson-Darling vs Cramer-von-Mises