cv_risk_sl_r2: Cross-validated non-parametric R-squared of the super learner

Description Usage Arguments Details Value Examples

Description

In general, the function passed to sl_control$cv_risk should expect a list of outcomes and predictions in validation folds. The function should return a list with names cv_measure, ci_low, ci_high, and p_value. The output of this function is returned irrespective of the names of the list; however, the names are necessary for print methods to work properly.

Usage

1
cv_risk_sl_r2(input, sl_control)

Arguments

input

List where each entry corresponds to a validation fold. Each entry is a list with entries: Y (univariate outcome for this validation fold), pred (matrix of predictions from learner and columns correspond to different leaners).

sl_control

List of super learner control options.

Details

In this case, the confidence intervals are computed on the scale of log(MSE/Var) and back-transformed to the R-squared scale. Here, MSE is the cross-validated mean squared-error of the super learner for predicting a univariate outcome (one of the components of Y) and Var is the cross-validated marginal mean of this outcome. The p-value is for the one-sided hypothesis test that cross-validated R-squared equals zero against the alternative that it is greater than zero.

Value

A list with named entries cv_measure, ci_low, ci_high, and p_value. The list will be returned by max_assoc irrespective of the named entries; however, the print methods will only work if the function returns the above names.

Examples

1
2
3
4
5
6
7
8
9
# simulate data with proper format
input <- list(list(valid_folds=1, Y = rbinom(50,1,0.5),pred = runif(50,0,1)),
              list(valid_folds=2, Y = rbinom(50,1,0.5),pred = runif(50,0,1))) 
     
# alpha value                        
sl_control= list(alpha= 0.05)    

# get risk 
cv_risk <- cv_risk_sl_r2(input, sl_control)                         

benkeser/cvma documentation built on May 5, 2019, 1:37 p.m.