Model validation of model passed as object
using observations y
.
Assuming the loss is a negative log-likelihood and thus a probabilistic model,
the transformation
$$u = F_Y(y;x,\theta) \sim U(0,1),$$
is usually valid.
One parameter, \(\mu=g^{-1}(f(x))\), is given by the model. Remaining parameters
are estimated globally over feature space, assuming they are constant.
This then allow the above transformation to be exploited, so that the
Kolmogorov-Smirnov test for uniformity can be performed.
If the response is a count model (poisson
or negbinom
), the transformation
$$u_i = F_Y(y_i-1;x,\theta) + Uf_Y(y_i,x,\theta), ~ U \sim U(0,1)$$
is used to obtain a continuous transformation to the unit interval, which, if the model is
correct, will give standard uniform random variables.