bboost | R Documentation |
Wrapper function for applying bootstrap estimation using gradient boosting.
## Bootstrap boosting.
bboost(..., data, type = 1, cores = 1,
n = 2, prob = 0.623, fmstop = NULL,
trace = TRUE, drop = FALSE, replace = FALSE)
## Plotting function.
bboost_plot(object, col = NULL)
## Predict method.
## S3 method for class 'bboost'
predict(object, newdata, ..., cores = 1, pfun = NULL)
... |
Arguments passed to |
data |
The data frame to be used for modeling. |
type |
Type of algorithm, |
cores |
The number of cores to be used. |
n |
The number of bootstrap iterations. |
prob |
The fraction that should be used to fit the model in each bootstrap iteration. |
fmstop |
The function that should return the optimum stopping iteration. The function must
have two arguments: (1) the |
trace |
Prints out the current state of the bootstrap algorithm. |
drop |
Should only the best set of parameters be saved? |
replace |
Sampling with replacement, or sampling |
object |
The |
col |
The color that should be used for plotting. |
newdata |
The data frame predictions should be made for. |
pfun |
The prediction function that should be used, for example |
A list of bamlss
objects.
bamlss
, boost
, lasso
, BayesX
## Not run: ## Simulate data.
set.seed(123)
d <- GAMart()
## Estimate model.
f <- num ~ s(x1) + s(x2) + s(x3) + s(lon,lat)
## Function for evaluation of hold out sample
## criterion to find the optimum mstop.
fmstop <- function(model, data) {
p <- predict(model, newdata = data, model = "mu")
mse <- NULL
for(i in 1:nrow(model$parameters))
mse <- c(mse, mean((data$num - p[, i])^2))
list("MSE" = mse, "mstop" = which.min(mse))
}
## Bootstrap boosted models.
b <- bboost(f, data = d, n = 50, cores = 3, fmstop = fmstop)
## Plot hold out sample MSE.
bboost_plot(b)
## Predict for each bootstrap sample.
nd <- data.frame("x2" = seq(0, 1, length = 100))
p <- predict(b, newdata = nd, model = "mu", term = "x2")
plot2d(p ~ x2, data = nd)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.