TreeBagger is an ensemble of trees. All trees are different because they were grown on different bootstrap replicas of the data. For example, one tree can have say 50 nodes and another one can have 60 nodes. Even if both trees have the same number of nodes, the tree structures could be very different. So what is "terminal nodes standard deviation average in TreeBagger"? You could, I suppose, take all leaves (terminal nodes) from all trees in the ensemble and compute the standard deviation over them. I have never seen anyone do this. What statistical interpretation would this number have?
If you want to obtain the standard deviation for a node in a single regression tree, you could use nodeerr method of classregtree. For example
load carsmall
X = [Acceleration Displacement Horsepower Weight];
b = TreeBagger(10,X,MPG,'method','reg')
nodeerr(b.Trees{1})
would give you node variance (standard error squared) for the 1st tree in the ensemble. This number has a clear interpretation: It is the uncertainty of prediction for an observation landing on this node of the tree.
Best Answer