A function to compute cross-validation errors
Xvalid_all(func, mf, maxL, n.fold, minbucket, minsplit, cp, lookahead)
func
: the function used to fit the modelmf
: the data set with formula specifiedmaxL
: the maximum number of splitsn.fold
: the number of foldsminbucket
: the minimum number of the studies in a terminal nodeminsplit
: the minimal number of studies in a parent node to be splitcp
: the stopping rule for decrease of between-subgroups Q. Any split that does not decrease the between-subgroups Q is not attempted.lookahead
: an argument indicating whether to apply the "look-ahead" strategy when fitting the treeUseful links