Skip to content

Commit

Permalink
Discourage using bbs(, constraint "!= "none")
Browse files Browse the repository at this point in the history
(solves #36)
  • Loading branch information
hofnerb committed Jul 27, 2016
1 parent 1546058 commit 99f41b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
6 changes: 6 additions & 0 deletions R/bl.R
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ bbs <- function(..., by = NULL, index = NULL, knots = 20, boundary.knots = NULL,

cll <- match.call()
cll[[1]] <- as.name("bbs")

constraint <- match.arg(constraint)
if (constraint != "none")
warning("Using ", sQuote('bbs()'), ' with constraint != "none" is discouraged. Preferably use ',
sQuote('bmono()'), " instead.\n",
"See section ", sQuote("Details"), " of ?bbs for more information.")

mf <- list(...)
if (length(mf) == 1 && ((is.matrix(mf[[1]]) || is.data.frame(mf[[1]])) &&
Expand Down
19 changes: 12 additions & 7 deletions man/baselearners.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,14 @@ bl1 \%O\% bl2
obtained using \code{\link[party]{ctree_control}}.
Defines hyper-parameters for the trees which are used as base-learners,
stumps are fitted by default.}
\item{constraint}{ type of constraint to be used. The constraint can
be either monotonic "increasing" (default), "decreasing" or "convex"
or "concave". Additionally, "none" can be used to specify
unconstrained P-splines. This is especially of interest in
conjunction with \code{boundary.constraints = TRUE}.}
\item{constraint}{type of constraint to be used. For \code{bmono},
the constraint can be either monotonic \code{"increasing"} (default),
\code{"decreasing"}, or \code{"convex"} or \code{"concave"}.
Additionally, \code{"none"} can be used to specify unconstrained P-splines.
This is especially of interest in conjunction with \code{boundary.constraints = TRUE}.
For \code{bbs}, the constraint can be \code{"none"}, monotonic \code{"increasing"}, or
\code{"decreasing"}. In general it is advisable to use \code{bmono} to fit
monotonic splines.}
\item{type}{
determines how the constrained least squares problem should be
solved. If \code{type = "quad.prog"}, a numeric quadratic
Expand Down Expand Up @@ -263,7 +266,7 @@ bl1 \%O\% bl2
\code{boundary.knots = c(0, 2 * pi)} for angles as in a sine function
or \code{boundary.knots = c(0, 24)} for hours during the day). For
details on cylcic splines in the context of boosting see Hofner et
al. (2014).
al. (2014).

\code{bspatial} implements bivariate tensor product P-splines for the
estimation of either spatial effects or interaction surfaces. Note
Expand Down Expand Up @@ -393,7 +396,9 @@ bl1 \%O\% bl2
Mueller and Hothorn (2011b). The quadratic-programming based algorithm
is described in Hofner et al. (2014). Alternative monotonicity
constraints are implemented via T-splines in \code{bbs()} (Beliakov,
2000).
2000). In general it is advisable to use \code{bmono} to fit monotonic splines
as T-splines show undesirable behaviour if the observed data deviates
from monotonicty.

Two or more linear base-learners can be joined using \code{\%+\%}. A
tensor product of two or more linear base-learners is returned by
Expand Down

0 comments on commit 99f41b3

Please sign in to comment.