Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaults for cross-validation for non-cyclical FDboostLSS #14

Closed
Almond-S opened this issue Apr 18, 2018 · 1 comment
Closed

defaults for cross-validation for non-cyclical FDboostLSS #14

Almond-S opened this issue Apr 18, 2018 · 1 comment

Comments

@Almond-S
Copy link
Collaborator

@Almond-S Almond-S commented Apr 18, 2018

When fitting an FDboostLSS model with method = "noncyclic" the resulting S3-object has the classes nc_mboostLSS, FDboostLSS and mboostLSS in this order. Thus, the defaults specified in FDboost:::cvrisk.FDboostLSS won't apply. (See code below.)
Two quick ideas would be to A) change the class order, if that's unproblematic, or B), stress that the folds have to be specified manually in the documentation and deprecate FDboost:::cvrisk.FDboostLSS.

library(FDboost)
library(gamboostLSS)

########### simulate Gaussian function-on-scalar data
n <- 50 ## number of observations
G <- 12 ## number of observations per functional covariate

set.seed(123) ## ensure reproducibility
n_innerknots <- 4
B <- mboost:::bsplines(1:G, knots = 4, boundary.knots = c(1,G), degree = 2)
theta <- rnorm(ncol(B)) ## sample coefficients for x = 1

x <- runif(n) ## sample covariates
y <- B %*% matrix( rnorm(n*length(theta), mean = rep(theta, n) * rep(x, each = length(theta)), sd = rep(x, each = length(theta))), ncol = n) ## sample response

dat_list <- list(y = t(y), x = x, t = 1:G)

## model fit assuming Gaussian location scale model 
model <- FDboostLSS(formula = y ~ bols(x, df = 2), 
                    timeformula = ~ bbs(t, df = 2), 
                    data = dat_list, method = "noncyclic")

class(model)

## -> cvrisk.nc_mboostLSS is directly applied
debug(cvrisk)
cvrisk(model)
@sbrockhaus
Copy link
Member

@sbrockhaus sbrockhaus commented Apr 29, 2018

thank you for the bug report. this was unintended. Now a model object that is fitted by FDboostLSS has as first class 'FDboostLSS' and thus the correct version of cvrisk is called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.