Skip to content

ENH: EDF tests for regression residuals  #7154

Open

Description

@josef-pkt

mainly parking a theoretical result

quote from Stephens' reference entry
"have shown that the asymptotic distributions of EDF statistics are the same as if both 𝜇 and 𝜎 were estimated"

This means we should use the p-values from the tables where loc and scale are estimated, e.g. for gaussian, and not for known distribution.

Pierce, Donald A., and Kenneth J. Kopecky. 1979. “Testing Goodness of Fit for the Distribution of Errors in Regression Models.” Biometrika 66 (1): 1–5. https://doi.org/10.1093/biomet/66.1.1.

Stephens, Michael A. 2016. “Empirical Distribution Function (EDF) Statistics.” In Wiley StatsRef: Statistics Reference Online, 1–13. American Cancer Society. https://doi.org/10.1002/9781118445112.stat02711.pub2.

I didn't read details and don't know if that applies to other distributions, e.g. can we use it for continuous distributions in GLM.
We could get simulated p-values but just simulating a loc-scale model instead of the full regression model.

Activity

  1. josef-pkt commented on Nov 13, 2020

    @josef-pkt
    MemberAuthor

    Maybe the shortcut doesn't work for Poisson. In this paper they simulate with estimating the full regression model

    Spinelli, John J., Richard A. Lockhart, and Michael A. Stephens. 2002. “Tests for the Response Distribution in a Poisson Regression Model.” Journal of Statistical Planning and Inference, C.R. Rao 80th Birthday Felicitation Volume, Part II, 108 (1): 137–54. https://doi.org/10.1016/S0378-3758(02)00275-6.

    sounds a bit too much work and computer intensive to get discrete edf statistic and pvalues for it.
    They integrate the step function of discrete edf to compute anderson-darling and other cramer-von mises statistic.
    Maybe linear interpolation in Czado et al is easier.

    maybe we should just clean up the statistics as "distance measures" as I used them in my notebook for count model comparison.

    Aside: In the Statistics Reference article Stephens mentions that pvalues are a better distance measure for ranking distributions in how well the fit the data, because the distribution of gof statistic like KS, AD, CvM depends on the distribution.

  2. josef-pkt commented on Nov 13, 2020

    @josef-pkt
    MemberAuthor

    R package for CvM statistics and tests of discrete distributions and grouped continuous data

    https://cran.r-project.org/web/packages/cvmdisc/index.html

  3. josef-pkt commented on Nov 13, 2020

    @josef-pkt
    MemberAuthor

    related: Ordered multinomial has similar pattern as grouped data.
    i.e. we can look at the cumulative counts/probalities similar to EDF

  4. josef-pkt commented on Nov 15, 2020

    @josef-pkt
    MemberAuthor

    more modern theory

    Kheifets, Igor, and Carlos Velasco. 2017. “New Goodness-of-Fit Diagnostics for Conditional Discrete Response Models.” Journal of Econometrics 200 (1): 135–49. https://doi.org/10.1016/j.jeconom.2017.05.017.

    uses the interpolation extension of discrete cdf as in Czado et al.
    uses bootstrap for inference distribution
    allows for dynamic models
    convergence to some Gaussian process

    similar, this has some brownian motion limiting distribution
    Lee, Sangyeol. 2014. “Goodness of Fit Test for Discrete Random Variables.” Computational Statistics & Data Analysis 69 (January): 92–100. https://doi.org/10.1016/j.csda.2013.07.026.

    This literature is on empirical processes, not linked/referenced to Stephens et al. gof testing

    citation count is low for those two articles

  5. josef-pkt commented on Nov 16, 2020

    @josef-pkt
    MemberAuthor

    this looks pretty good for the one sample, no-regression case.

    Lockhart, Richard A., John J. Spinelli, and Michael A. Stephens. 2007. “Cramér-von Mises Statistics for Discrete Distributions with Unknown Parameters.” Canadian Journal of Statistics 35 (1): 125–33. https://doi.org/10.1002/cjs.5550350111.

    The asymptotic distribution is also the distribution of a weighted sum of chi2 random variables. They provide matrix formulas for the eigenvalues and recommend an approximation that matches the first 3 cumulants, which they say is accurate in the upper tail alpha < 0.15.
    Matrices are of dimension with number of cells, so looks feasible for smaller cases (not Poisson with large counts unless binned)

    Power of CvM type tests is higher than Pearson chisquare test in the ordered case, integer counts or ordinal (*), because it takes order into account.

    It's much easier than the regression case because integral is just the sum of a finite, fixed number of terms (equal to number of cells).

    (*) I'm not sure about ordinal because integral computation requires metric random variable, and uses equal distance the the provided formulas, AFAICS,

    aside: as a tool function
    They have the matrix formulas for the variance of cumulative multinomial/ordinal probabilities. The latter are just a linear transformation of the cell probabilities with a partial-sum transformation matrix, so we can get the variance of cdf from variance of cell probabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions