Learn R Programming

BTLLasso (version 0.1-1)

boot.BTLLasso: Bootstrap function for BTLLasso

Description

Performs bootstrap for BTLLasso to get bootstrap confidence intervals. Main input argument is a cv.BTLLasso object. The bootstrap is performed on level of the cross-validation. Therefore, within every bootstrap iteration the complete cross-validation procedure from the cv.BTLLasso object is performed. The resulting boot.BTLLasso object is put into ci.BTLLasso to plot bootstrap confidence intervals.

Usage

boot.BTLLasso(model, B = 500, lambda = NULL, cores = 1, trace = TRUE, trace.cv = TRUE,
              control = BTLLasso.ctrl())

Arguments

model
A cv.BTLLasso object.
B
Number of bootstrap iterations.
lambda
Vector of tuning parameters. If not specified (default), tuning parameters from cv.BTLLasso object are used. See also details.
cores
Number of cores for (parallelized) computation.
trace
Should the trace of the BTLLasso algorithm be printed?
trace.cv
Should the trace fo the cross-validation be printed? If parallelized, the trace is not working on Windows machines.
control
Function for control arguments, mostly for internal use. See also BTLLasso.ctrl.

Value

  • cv.modelcv.BTLLasso object
  • estimatesBMatrix containing all B estimates for original parameters. For internal use.
  • estimatesBreparMatrix containing all B estimates for reparameterized (symmetric side constraints) parameters.
  • lambdaBvector of used tuning parameters
  • conf.intsBootstrap confidence intervals for original parameters. For internal use.
  • conf.ints.reparBootstrap confidence intervals for reparameterized (symmetric side constraint) parameters.
  • lambda.max.alertWas the largest value of lambda chosen in at least one bootstrap iteration?
  • lambda.min.alertWas the smallest value of lambda chosen in at least one bootstrap iteration?

Details

The method can be highly time-consuming, for high numbers of tuning parameters, high numbers of folds in the crossvalidation and high number of bootstrap iterations B. The number of tuning parameters can be reduced by specifying lambda in the boot.BTLLasso function. You can control if the range of prespecified tuning parameters was to small by looking at the output values lambda.max.alert and lambda.min.alert. They are set TRUE if the smallest or largest of the specifed lambda values was chosen in at least one bootstrap iteration.

References

Schauberger, Gunther and Tutz, Gerhard (2015): Modelling Heterogeneity in Paired Comparison Data - an L1 Penalty Approach with an Application to Party Preference Data, Department of Statistics, LMU Munich, Technical Report 183

See Also

BTLLasso, cv.BTLLasso, ci.BTLLasso

Examples

Run this code
# load data set
data(GLESsmall)

# define response and covariate matrix
X <- scale(GLESsmall[, 11:14])
Y <- as.matrix(GLESsmall[, 1:10])

# vector of subtitles, containing the coding of the single covariates
subs <- c("(in years)","female (1); male (0)",
"East Germany (1); West Germany (0)","(very) good (1); else (0)")

# vector of tuning parameters
lambda <- exp(seq(log(31),log(1),length=50))-1

# compute 10-fold cross-validation
set.seed(5)
m.cv <- cv.BTLLasso(Y = Y, X = X, folds = 10, lambda = lambda, cores = 10)

# compute bootstrap confidence intervals
m.boot <- boot.BTLLasso(m.cv, B = 100, cores = 25)

# plot bootstrap confidence intervals
op <- par(no.readonly = TRUE) 
par(mar=c(5,5,4,3))
ci.BTLLasso(m.boot, subs = subs)

par(op)

Run the code above in your browser using DataLab