Hi all,

I'm writing to ask some suggestions about the selection of mtry in
randomForest.

I'm running randomForest in a dataset with circa 10 000 observations and 33
variables.

I used the function tuneRF to find the mtry value and it gives me mtry=16 as
the optimal for the several trials I ran.
I applied also smaller mtry values for comparison, since several authors
found that the mtry parameter influences the variable importance measures.

In fact, my results tell me that a larger mtry gives higher importance to
fewer variables, changing the %IncMSE of the variables depending on mtry.
The % variance explained also increases with increasing mtry and I wonder if
it's a case of overfitting. I also read that in general a mtry=1 gives
already high predictive accuracy.

Below are the results of the randomForest regression models for the
different mtry values. Any ideas and comments are appreciated.

Thank you,

Sandra Oliveira

mtry = 2

 randomForest(formula = density ~ ., data = eumed1, importance = TRUE,
     mtry
= 2, ntree = 500, keep.forest = FALSE, na.action = na.fail)

               Type of random forest: regression

                     Number of trees: 500

No. of variables tried at each split: 2

Mean of squared residuals: 0.001436110

                    % Var explained: 88.34



mtry=4

 randomForest(formula = density ~ ., data = eumed1, importance = TRUE,
     mtry
= 4, ntree = 500, keep.forest = FALSE, na.action = na.fail)

               Type of random forest: regression

                     Number of trees: 500

No. of variables tried at each split: 4

           Mean of squared residuals: 0.000750564

                    % Var explained: 93.91



mtry=8:

 randomForest(formula = density ~ ., data = eumed1, importance = TRUE,
     mtry
= 8, ntree = 500, keep.forest = FALSE, na.action = na.fail)

               Type of random forest: regression

                     Number of trees: 500

No. of variables tried at each split: 8

           Mean of squared residuals: 0.0004648443

                    % Var explained: 96.23


mtry=11 (the default, 33/3)

 randomForest(formula = density ~ ., data = eumed1, importance = TRUE,
     mtry
= 11, ntree = 500, keep.forest = FALSE, na.action = na.fail)

               Type of random forest: regression

                     Number of trees: 500

No. of variables tried at each split: 11

           Mean of squared residuals: 0.0004213192

                    % Var explained: 96.58

mtry=16
randomForest(formula = density ~ ., data = eumed1, importance = TRUE,
mtry = 16, ntree = 500, keep.forest = FALSE, na.action = na.fail)
               Type of random forest: regression
                     Number of trees: 500
No. of variables tried at each split: 16
          Mean of squared residuals: 0.0003961789
                    % Var explained: 96.78

	[[alternative HTML version deleted]]

