View source: R/fix_family_cdf.R
fix_family_cdf | R Documentation |
Fix $cdf() slot of a mgcv family.
fix_family_cdf(fam)
fam |
an |
library(mgcvUtils); library(MASS)
b <- gam(list(accel~s(times,k=20,bs="ad"),~s(times)),
data=mcycle,family=gaulss())
b$family <- fix_family_cdf( b$family )
# Quantile residuals should look uniformly distributed
qres <- b$family$cdf(mcycle$accel, b$fitted.values,
wt = rep(1, nrow(mcycle)), scale = 1)
hist(qres)
# Not too bad
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.