Closed fabian-s closed 6 years ago
Good point, I think that one possible solution would be to normalize the residuals using the residuals simulated from the model, as done in l_gridCheck1D
.
By doing that the normalization will work also for general cases (e.g. gaulss), when it is not possible to normalize using, for instance, fittedGam$sig2 (for some families the variance function is not provided by mgcv at all).
Ok, the easiest solution to avoid the potential misuse of this function is using the residuals types "tnormal" or "tunif", under which the reference distribution are standard normal or U(0, 1). If residuals "tnormal" or "tunif" are unavailable (because the CDF of the response distribution is unavailable), then an alternative solution is providing an user-defined distance. The function now warns about this potential problem, which is explained in the updated documentation (?l_densCheck). The relevant commit is 36257ff334a04515e4975b10d1ec283a2775ac68
Not sure how often this comes up if you don't set the scale manually but it seems dangerous to me:
Created on 2018-09-11 by the reprex package (v0.2.0).