Why Check Skewness and Tails?
Two fitted positive-response models can describe the same conditional means while implying different probabilities for unusually large outcomes. A model may capture the central observations reasonably well yet systematically understate the right tail, or it may produce residuals whose asymmetry points to a poor fit of the response distribution. Residual quantiles and upper-tail checks make these discrepancies visible.
The checks here concern the conditional response distribution after fitting the mean structure and link. They complement, rather than replace, examination of residual patterns against predictors. The main question is whether observed responses look like draws from the fitted gamma, inverse-Gaussian, or Tweedie distributions, especially in their asymmetry and upper extremes.
Conditional Quantile Residuals
A response that is high relative to its own fitted conditional distribution has a positive residual; one that is low has a negative residual. This is useful when fitted means, and therefore response scales, vary across observations. A raw difference \(y_i-\hat\mu_i\) does not account for the fitted response distribution's changing spread or skewness, whereas the quantile residual uses the full fitted conditional distribution.
For a continuous response and a correctly specified model with known parameters, the conditional percentile is uniform, and the transformed residual is standard normal. With estimated parameters, this is a reference rather than an exact finite-sample claim: fitting the model uses the same responses being checked, so residuals need not be independent standard normals. For a Tweedie distribution with an atom at zero, the ordinary continuous transformation does not apply at zero. A randomized probability integral transform uses \(U_i=\hat F_i(y_i^-)+V_i\{\hat F_i(y_i)-\hat F_i(y_i^-)\}\), where \(V_i\) is an independent uniform random variable; then set \(r_i=\Phi^{-1}(U_i)\). For strictly positive observations from a sample selected to exclude zeros, use the fitted distribution conditional on being positive.
Worked Example: Computing Gamma Quantile Residuals
Suppose three independent observations have the same fitted gamma distribution with shape \(2\) and scale \(2\). Its mean is \(4\), and its CDF for \(y>0\) is \(\hat F(y)=1-\exp(-y/2)(1+y/2)\). The observed responses are \(2,4,\) and \(6\). Compute their conditional quantile residuals.
For \(y=2\), \(\hat F(2)=1-2e^{-1}\approx0.2642\), so \(r_1=\Phi^{-1}(0.2642)\approx-0.63\).
For \(y=4\), \(\hat F(4)=1-3e^{-2}\approx0.5940\), so \(r_2=\Phi^{-1}(0.5940)\approx0.24\).
For \(y=6\), \(\hat F(6)=1-4e^{-3}\approx0.8009\), so \(r_3=\Phi^{-1}(0.8009)\approx0.8447\). The responses increase relative to the common fitted distribution, and so do their residuals. These three values are too few to assess normality; the calculation illustrates the transformation, not a goodness-of-fit conclusion.
What the Quantile Transformation Guarantees
Proof. For any \(0<u<1\), continuity of \(F_i\) gives \(P\{F_i(Y_i)\leq u\mid x_i\}=u\). Thus \(F_i(Y_i)\) is uniform on \((0,1)\). Since \(\Phi\) is continuous and strictly increasing, for any real \(z\),
So each \(R_i\) has the standard normal distribution. Each \(R_i\) is a function of \(Y_i\) alone when the covariates and model are fixed. Conditional independence of the responses therefore implies conditional independence of the residuals. Their joint distribution is consequently that of independent standard normal variables. \(\square\)
A normal quantile plot of fitted quantile residuals can therefore reveal shape discrepancies: systematic curvature suggests that the residual distribution differs from the normal reference, while unusually large positive residuals identify observations lying far into their fitted conditional upper tails. A few extreme points may occur even under a correct model, so their interpretation should account for sample size and parameter estimation.
Worked Example: Reading Residual Skewness
A fitted model produces the following sorted quantile residuals for a small validation sample: \(-1.28,-0.52,0.13,0.84,2.33\). The corresponding standard normal quantiles at plotting positions \(1/6,2/6,3/6,4/6,5/6\) are approximately \(-0.97,-0.43,0,0.43,0.97\).
Compare the ordered values. The first two residuals are somewhat more negative than the reference values, the middle residual is close, and the largest observed residual is \(2.33\), well above the reference maximum \(0.97\). The upper residual is the clearest departure in this small sample: its fitted conditional percentile is approximately \(\Phi(2.33)=0.990\), placing the response near the top one percent of its fitted distribution.
This is a tail warning, not proof of model failure. A single observation can be that extreme by chance, and the plotting positions are only a visual reference. With parameters estimated from this same sample, one should calibrate the size of such departures by simulating data from the fitted model, refitting it, and recalculating the residual summaries.
Upper-Tail Checks With Thresholds Fixed in Advance
A direct way to ask whether the fitted distributions produce enough large responses is to specify thresholds \(c_i\) before observing the responses and count exceedances. The threshold may be a clinically meaningful value, or a model quantile chosen using an independent training sample. For fixed thresholds and known conditional distributions, define \(I_i=1\) if \(Y_i>c_i\), and \(I_i=0\) otherwise. Write \(q_i=P(Y_i>c_i\mid x_i)\).
Proof. Each \(I_i\) is a Bernoulli variable with conditional mean \(q_i\) and conditional variance \(q_i(1-q_i)\). Linearity of conditional expectation gives \(E[N\mid x_1,\ldots,x_n]=\sum_iq_i\). Conditional independence gives zero covariance between distinct indicators, so
This result requires thresholds set independently of the responses being tested. If the conditional probabilities \(q_i\) use parameters estimated on the same data, the displayed moments are a plug-in benchmark, not an exact null distribution for the fitted procedure. A parametric bootstrap that simulates responses from the fitted model, refits the model, and repeats the threshold calculation can account for parameter estimation. For independent validation data and a model fitted on separate training data, the fitted conditional probabilities can be treated as fixed for this check.
Worked Example: A Pre-Specified Exceedance Count
A model has been fitted on a separate training sample. Before examining five independent validation responses, investigators set one clinical threshold for each case. The fitted model assigns the five thresholds exceedance probabilities \(q_i=(0.20,0.10,0.10,0.05,0.05)\). The observed validation responses exceed their respective thresholds in the first two cases only, so \(N=2\).
The expected count is \(0.20+0.10+0.10+0.05+0.05=0.50\). Its variance is
The standard deviation is \(\sqrt{0.435}\approx0.660\), and the observed count is \((2-0.50)/0.660\approx2.27\) standard deviations above its benchmark mean. This standardized difference is a descriptive summary; with only five observations it does not justify a normal-approximation \(p\)-value. The exact count distribution is Poisson-binomial, and an exact tail probability or simulation is preferable for formal calibration.
Comparing Families in Their Upper Tails
Residuals express discrepancies relative to each candidate's own conditional distribution. Upper-tail probabilities also make the difference between candidate families explicit. For example, gamma and inverse-Gaussian models can share a conditional mean and variance while assigning different probabilities to very large responses. In a gamma distribution with shape \(\alpha\), the skewness is \(2/\sqrt{\alpha}\); for an inverse-Gaussian distribution with mean \(\mu\) and shape parameter \(\lambda\), it is \(3\sqrt{\mu/\lambda}\). These formulas describe the distributions, but empirical exceedances are needed to assess which tail better matches the data.
Worked Example: Comparing Gamma and Inverse-Gaussian Tail Probabilities
Compare two candidate distributions with mean \(10\) and variance \(25\), at the fixed threshold \(30\). For the gamma candidate, shape \(\alpha=\mu^2/\operatorname{Var}(Y)=100/25=4\) and scale \(\theta=\operatorname{Var}(Y)/\mu=2.5\). Its upper-tail probability is
For the inverse-Gaussian candidate, the shape parameter giving variance \(\mu^3/\lambda=25\) is \(\lambda=10^3/25=40\). Its CDF is
At \(y=30\), the two normal arguments are approximately \(2.309\) and \(-4.619\). Thus \(F(30)\approx0.98955+e^8\Phi(-4.619)\approx0.98955+0.00575=0.99530\), giving \(P(Y>30)\approx0.00470\). The inverse-Gaussian candidate assigns about twice the gamma candidate's probability to exceeding this threshold, despite matching its mean and variance. That difference is a model implication, not evidence that either distribution fits better; compare the predictions with pre-specified validation thresholds and observed exceedances.
For a Tweedie candidate, conditional tail probabilities can be evaluated from its fitted distribution or by simulation, with care to use the correct distribution when there is probability mass at zero. Across all three families, useful checks include the largest positive quantile residuals, the number of responses above pre-specified conditional quantiles, and whether upper-tail departures recur across cases rather than being driven by one observation.
Common Pitfall and Practical Interpretation
- Choosing thresholds after seeing the responses. If the threshold is the observed response \(y_i\), then the event \(Y_i>y_i\) is not a pre-specified exceedance rule. Probabilities evaluated at those observed values cannot simply be summed and treated as the expected number of flags. Fix thresholds in advance, or calibrate a data-dependent flagging rule by simulation.
- Treating fitted residuals as exactly independent normal variables. The exact theorem assumes known distributions. Estimation and model selection affect the residual reference; use simulation calibration when a formal assessment is needed.
- Calling one large residual a decisive family mismatch. Extreme observations can occur under a correct model. Consider the number and direction of discrepancies, sample size, and the model's estimated-parameter uncertainty.
- Confusing tail shape with mean structure. A tail departure can arise from a misspecified conditional distribution, but it can also reflect an omitted predictor or structure. Interpret the residual check alongside the earlier assessment of residual patterns.
The central diagnostic idea is to compare each observed response with its own fitted conditional distribution, not merely with a common response-scale cutoff. Quantile residuals make conditional percentiles comparable across observations; fixed-threshold exceedance counts make the implications for extreme outcomes concrete. Together, they help determine whether a gamma, inverse-Gaussian, or Tweedie family captures the observed skewness and upper tail well enough for the intended analysis.
Check Your Understanding
Try these questions before moving on.
- Why does a correct continuous conditional model with known parameters produce standard normal quantile residuals?
- What assumptions are needed for the stated mean and variance of a pre-specified exceedance count?
- Why is it invalid to evaluate tail probabilities at each observed response and automatically treat their sum as the expected number of flags?
- How would you account for parameter estimation when assessing an extreme quantile residual?
- Two fitted families share a mean and variance but give different probabilities above a fixed threshold. What does that difference establish, and what does it not establish?