In full generality this is a quite difficult problem as discussed in
Durbin's (1973) SIAM monograph. An elegant general approach
is provided by Khmaladze
@article{Khma:Arie:1981,
author = {Khmaladze, E. V.},
title = {Martingale approach in the theory of goodness-of-fit
tests},
year =
What about Monte Carlo? I recently produced (with help from
contributors to this list) qq plots for certain complicated mixtures of
distributions. To evaluate goodness of fit, I produced Monte Carlo
confidence intervals from 401 simulated qq plots and took the 11th and
391st of them for