quantregForest        package:quantregForest        R Documentation

_Q_u_a_n_t_i_l_e _R_e_g_r_e_s_s_i_o_n _F_o_r_e_s_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Quantile Regression Forests infer conditional quantile functions
     from data

_U_s_a_g_e:

     quantregForest(x, y, mtry = ceiling(ncol(x)/3), nodesize = 10, ntree = 1000)

_A_r_g_u_m_e_n_t_s:

       x: A matrix or data.frame containing the predictor variables 

       y: The response variable; a numerical vector  

    mtry: The number of variables to try for each split; same default
          setting as for Random Forests 

nodesize: The minimal number of instances in each terminal node; the
          default setting is slightly higher than for Random Forests 

   ntree: The number of trees to be grown 

_D_e_t_a_i_l_s:

     It might be useful to try various values of 'mtry' and see which
     one works best; however, results are typically not heavily
     dependent on this parameter.

_V_a_l_u_e:

     A value of class 'quantregForest', for which 'print', 'plot', and
     'predict' methods are available.

_A_u_t_h_o_r(_s):

     Nicolai Meinshausen

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://stat.ethz.ch/~nicolai/quantregForest>

_S_e_e _A_l_s_o:

     For prediction, see 'predict.quantregForest'

_E_x_a_m_p_l_e_s:

     ################################################
     ##  Load air-quality data (and preprocessing) ##
     ################################################

     data(airquality)
     set.seed(1)

     ## remove observations with mising values
     airquality <- airquality[ !apply(is.na(airquality), 1,any), ]

     ## number of remining samples
     n <- nrow(airquality)

     ## divide into training and test data
     indextrain <- sample(1:n,round(0.6*n),replace=FALSE)
     Xtrain     <- airquality[ indextrain,2:6]
     Xtest      <- airquality[-indextrain,2:6]
     Ytrain     <- airquality[ indextrain,1]
     Ytest      <- airquality[-indextrain,1]


     ################################################
     ##     compute Quantile Regression Forests    ##
     ################################################

     qrf <- quantregForest(x=Xtrain, y=Ytrain)

     ## plot out-of-bag predictions for the training data
     plot(qrf)

     ## compute out-of-bag predictions 
     quant.outofbag <- predict(qrf)

     ## predict test data
     quant.newdata  <- predict(qrf, newdata= Xtest)

