Boosting models for fitting generalized additive models for location, shape and scale (GAMLSS) to potentially high dimensional data. The current relase version can be found on CRAN (https://cran.r-project.org/package=gamboostLSS).
26
stars
11
forks
source link
bug in cvrisk.mboostLSS() if families at default #9
If the families argument is not specified explicitly in mboostLSSone gets an error in cvrisk.mboostLSS() (spotted by Almond Stöcker).
See the following MWP:
library(gamboostLSS)
### Data generating process:
set.seed(1907)
x1 <- rnorm(1000)
mu <- 2*x1
sigma <- rep(1, 1000)
y <- numeric(1000)
for( i in 1:1000)
y[i] <- rnorm(1, mean = mu[i], sd=sigma[i])
dat <- data.frame(x1=x1, y=y)
## model with default families
model <- mboostLSS(y ~ bbs(x1), data = dat)
## cvrisk.mboostLSS() does not work as families was not specified in model call
cvr <- cvrisk(model, folds = cv(model.weights(model), B=3), trace=FALSE)
## model with families = GaussianLSS()
model2 <- mboostLSS(y ~ bbs(x1), families = GaussianLSS())
## works as families was specified in model call
cvr2 <- cvrisk(model2, folds = cv(model.weights(model2), B=3), trace=FALSE)
If the
families
argument is not specified explicitly inmboostLSS
one gets an error incvrisk.mboostLSS()
(spotted by Almond Stöcker). See the following MWP:I think that a possible fix is to define
families
incl
inmboostLSS
after line https://github.com/hofnerb/gamboostLSS/blob/master/pkg/R/mboostLSS.R#L8 by addingBest