Maybe it would be useful to add a quantile.gam method that works as in the example below. One can do the same thing by using family$qf, but maybe this is more convenient (especially considering the fact that prior weights and scale are not relevant for many gamlss families). Similarly wrappers could be provided to access family$cdf or other slots more conveniently.
library(gamUtils); library(MASS)
b <- gam(list(accel~s(times,k=20,bs="ad"),~s(times)),
data=mcycle,family=gaulss())
qfit <- quantile(b, c(0.05, 0.25, 0.5, 0.75, 0.95))
plot(mcycle, ylim = c(-160, 100))
for(ii in 1:ncol(qfit)){
lines(mcycle$times, qfit[ , ii], col = 2)
}
Sorry for the late reply on this! This is very cool! I end up wanting this kind of thing quite often so this will likely save me some time. Thanks for adding this!
Maybe it would be useful to add a
quantile.gam
method that works as in the example below. One can do the same thing by usingfamily$qf
, but maybe this is more convenient (especially considering the fact that prior weights and scale are not relevant for many gamlss families). Similarly wrappers could be provided to accessfamily$cdf
or other slots more conveniently.