 Usage:  cross = cartcv (x, y, type, opt, wv)  

 

 Input:



  x                      n x p matrix: data matrix of regression variables 

                         

  y                      n x 1 vector: contains the values of the response variable 

                         

  type                   p x 1 vector: contains the types of the regression 

                         variables, 

                         1 means that the corresponding variable is continuous and 

                         0 that it is categorical 

                         

  opt                    list of scalars: determines when the growing of the 

                         tree is stopped. Consists of opt.mincut, opt.minsize, 

                         opt.mindev. See cartsplit for the description of these 

                         parameters. 

                         

  wv                     integer >=2, wv fold cross-validation is performed, that 

                         is, the data is divided in wv number of ways to an 

                         estimation set and a test set. 

                         Division is formed randomly. 

                         

 Output:



  cross                  list of vectors, consists of cross.alfa, cross.lnumber, 

                         cross.cv, cross.cvstd. 

                         The elements of the list cross are vectors with the number 

                         of elements equal to the number of trees in the 

                         sequence of pruned subtrees of the tree grown 

                         with data x and y. 

                         The vector cross.alfa contains the values of the complexity 

                         parameter alfa. 

                         The vector cross.lnumber contains the numbers of leaves 

                         in the sequence of the pruned subtrees. 

                         The vector cross.cv contains the estimates for the 

                         expected value of the mean of squared residuals. 

                         The vector cross.cvstd contains the estimates for the 

                         standard deviation of the estimator for the 

                         expected value of the mean of squared residuals. 

                         

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

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

