You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## monotonicity with interaction and factor
library("mboost")
## simulate some data
set.seed(1234)
x1<- rnorm(1000)
x2<- sample(1:5, 1000, replace=TRUE)
y<--x1^3* (6-x2) + rnorm(1000, sd=0.1)
x2<- as.factor(x2)
## Works with numeric valuesx2<- as.numeric(x2)
mod<- mboost(y~ bmono(x1, x2, df=5, constraint=list("decreasing", "increasing")),
control= boost_control(trace=TRUE, mstop=10))
plot(mod)
## Interaction currently does not work with ordinalsx2<- as.ordered(x2)
## Does work as single effectmod2<- mboost(y~ bmono(x2, constraint="decreasing"))
plot(mod2)
## Doesn't workmod3<- mboost(y~ bmono(x1, x2, df=5, constraint=list("decreasing", "increasing")),
control= boost_control(trace=TRUE, mstop=10))
## Error in seq.default(boundary.knots[1] - degree * dx, boundary.knots[1], : ## 'from' cannot be NA, NaN or infinite
Of note:
x1<- as.ordered(x1)
x2<- as.ordered(x2)
mod<- mboost(y~ bmono(x1, x2, constraint=list("decreasing", "increasing")))
## Error in bl_mono(ret, Xfun = X_ols, args = args) : ## Bivariate monotonic effects currently not implemented for ordered factors
The text was updated successfully, but these errors were encountered:
Of note:
The text was updated successfully, but these errors were encountered: