 Usage:  resu = prunecv (tr, alfaseq, x, y, type)  

 

 Input:



  tr                     list of vectors: data structure which represents a binary tree 

                         and is produced by cartsplit procedure, contains vectors 

                         tr.val, tr.vec, tr.mean, tr.ssr, tr.nelem. 

                         See cartsplit for the description of tr. 

                         

  alfaseq                m x 1 vector: m different values for the complexity 

                         parameter. 

                         

  x                      n x p vector: represents n points in the sample space 

                         at which the prediction error of the regression trees will 

                         be calculated. 

                         

  y                      n x 1 vector: 

                         contains the values of the response variable. 

                         

  type                   p x 1 vector: 

                         contains the types of the original regression variables, 

                         1 means that the corresponding variable is continuous and 

                         0 that it is categorical. This vector should be similar to 

                         the vector which was given originally as an input to the 

                         cartsplit which produced the regression tree tr. 

                         

 Output:



  resu                   vector whose length 

                         equals the number of leaves in the original tree. 

                         Elements of the vector are 

                         means of the squared residuals, that is, 

                         sums of squared differences between predictions and 

                         observations, divided by the number of observations n. 

                         The program prunecv prunes original tree and calculates 

                         mean of the squared residuals for every subtree in the 

                         sequence of the pruned subtrees. 

                         

--------------------------------------------------------------

(C) MD*TECH Method and Data Technologies, 21.9.2000

