From 953573c4d62f7a70752eed38c9a03a9204f0c6d7 Mon Sep 17 00:00:00 2001 From: mayrandy Date: Mon, 18 Jun 2018 18:23:41 +0200 Subject: [PATCH] make form.type = "classic" default, closing #5 --- R/betaboost.R | 2 +- man/betaboost.Rd | 2 +- tests/glmtest.R | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/R/betaboost.R b/R/betaboost.R index 8a64b6d..0a3bcc5 100644 --- a/R/betaboost.R +++ b/R/betaboost.R @@ -5,7 +5,7 @@ # when ~ bols(x1) + bbs(x2) -> gamboost LSS betaboost <- function(formula = NULL, phi.formula = NULL, data = list(), sl = 0.01, - iterations = 100, form.type = c("gamboost", "classic"), + iterations = 100, form.type = c("classic", "betaboost"), start.mu = NULL, start.phi = NULL, stabilization = c("none", "MAD", "L2"), y = NULL, x = NULL, mat.parameter = c("mean", "both"), diff --git a/man/betaboost.Rd b/man/betaboost.Rd index 11f1ccc..67a6392 100644 --- a/man/betaboost.Rd +++ b/man/betaboost.Rd @@ -8,7 +8,7 @@ Wrapper function to use mode-based boosting via mboost or gamboostLSS to fit bet } \usage{ betaboost(formula = NULL, phi.formula = NULL, data = list(), sl = 0.01, - iterations = 100, form.type = c("gamboost", "classic"), + iterations = 100, form.type = c("classic", "betaboost"), start.mu = NULL, start.phi = NULL, stabilization = c("none", "MAD", "L2"), y = NULL, x = NULL, mat.parameter = c("mean", "both"), diff --git a/tests/glmtest.R b/tests/glmtest.R index 5bd641b..9be02c4 100644 --- a/tests/glmtest.R +++ b/tests/glmtest.R @@ -36,7 +36,7 @@ rb2 <- R2.betaboost(model = b2, data = data) b2b <- betaboost(formula = y ~ bols(x1) + bbs(x2), data = data, form.type = "gamboost", iterations = 120, sl = 0.1) -b2c <- betaboost(formula = y ~ x1 + bbs(x2), data = data, +b2c <- betaboost(formula = y ~ x1 + s(x2), data = data, iterations = 120, sl = 0.1) g2 <- gamboost(y ~ bols(x1) + bbs(x2), data = data, family = BetaReg(), control = boost_control(mstop = 120)) @@ -51,7 +51,7 @@ cbind(rb1, rg1, rb2, rg2) b3 <- betaboost(formula = y ~ x1 + x2, phi.formula = y ~ x3 + x4, - data = data, form.type = "classic", + data = data, iterations = 120, sl = 0.1) R2.betaboost(b3, data = data) @@ -65,7 +65,7 @@ stopifnot(identical(coef(b3, off2int = TRUE), b3b <- betaboost(formula = y ~ x1 + x2, phi.formula = y ~ x3 + x4, - data = data, form.type = "classic", + data = data, iterations = 400, method = "noncyclic", sl = 0.1) R2.betaboost(b3, data = data) @@ -79,7 +79,7 @@ stopifnot(identical(round(unlist(coef(b3b, off2int = TRUE)),2), b4 <- betaboost(formula = y ~ s(x1) + x2, phi.formula = y ~ x3 + s(x4), - data = data, form.type = "classic", + data = data, iterations = 120, sl = 0.1) g4 <- gamboostLSS(list(mu = y ~ bbs(x1) + bols(x2), @@ -127,18 +127,18 @@ stopifnot(identical(coef(b1, off2int = TRUE), ## matrix interface: linear -b5 <- betaboost(formula = NULL, data = data, form.type = "classic", +b5 <- betaboost(formula = NULL, data = data, iterations = 120, sl = 0.1, y= data$y, x = data$x1, mat.effect = "linear") g5 <- glmboost(y ~ x1, data = data, control = boost_control(mstop = 120), family = BetaReg()) stopifnot(identical(as.numeric(coef(b5)), as.numeric(coef(g5)))) -b6 <- betaboost(formula = NULL, data = data, form.type = "classic", +b6 <- betaboost(formula = NULL, data = data, iterations = 120, sl = 0.1, y= data$y, x = data$x1, mat.effect = "linear", mat.parameter = "both") g6 <- glmboostLSS(y ~x1, data = data, control = boost_control(mstop = 120), families = BetaLSS()) stopifnot(identical(as.numeric(unlist(coef(g6))), as.numeric(unlist(coef(b6))))) -b6b <- betaboost(formula = NULL, data = data, form.type = "classic", +b6b <- betaboost(formula = NULL, data = data, iterations = 120, sl = 0.1, y= data$y, x = as.matrix(cbind(data$x1, data$x2, data$x3)), mat.effect = "linear", mat.parameter = "both") g6b <- glmboostLSS(y ~x1 + x2 +x3, data = data, control = boost_control(mstop = 120), @@ -147,12 +147,12 @@ g6b <- glmboostLSS(y ~x1 + x2 +x3, data = data, control = boost_control(mstop = ## matrix interface: nonlinear -b7 <- betaboost(formula = NULL, data = data, form.type = "classic", mat.parameter = "mean", +b7 <- betaboost(formula = NULL, data = data, mat.parameter = "mean", iterations = 120, sl = 0.1, y= data$y, x = data$x1, mat.effect = "smooth") g7 <- gamboost(y ~ x1, data = data, control = boost_control(mstop = 120), family = BetaReg()) stopifnot(identical(as.numeric(unlist(coef(b7))), as.numeric(unlist(coef(g7))))) -b8 <- betaboost(formula = NULL, data = data, form.type = "classic", +b8 <- betaboost(formula = NULL, data = data, iterations = 120, sl = 0.1, y= data$y, x = data$x1, mat.effect = "smooth", mat.parameter = "both") g8 <- gamboostLSS(y ~x1, data = data, control = boost_control(mstop = 120),