This layer bins the residuals, r, according to the value of the corresponding covariates, x1 and x2. Then we calculate the proportion of negative residuals in each bin, which should not deviate too much from the theoretical proportion (eg 0.5 if we fit the median). Mainly useful in conjuction with check2D.
l_gridQCheck2D(qu = NULL, bw = c(NA, NA), stand = TRUE, binFun = NULL, ...)
qu | the quantile of interest. Should be in (0, 1). |
---|---|
bw | numeric vector giving bin width in the vertical and horizontal directions. See the |
stand | if left to |
binFun | the |
... | graphical arguments to be passed to |
An object of class gamLayer
library(mgcViz); set.seed(4124) n <- 4e2 dat <- data.frame(x = rnorm(n), y = rnorm(n)) # Simulate some data, residuals are heteroscedastic w.r.t. x dat$ob <- (dat$x)^2 + (dat$y)^2 + (0.2*abs(dat$x) + 1) * rnorm(n) b <- qgamV(ob ~ x + s(y), qu = 0.3, data = dat)#> Estimating learning rate. Each dot corresponds to a loss evaluation. #> qu = 0.3........done