# How do I calculate prediction intervals for random forest predictions?

In regression problems random forests yield a prediction for each case by averaging the results of each single tree in the forest. I would like to draw a 95% prediction interval around each prediction. There is a nice option interval="prediction" for the prediction method of linear models, but there's no such thing for random forests (at least in the R package randomForest). Can I presume that the casewise predictions of the single trees are normally distributed and apply the formula http://mathurl.com/bbvuvx9 or should I determine it by bootstrapping? If so, how can this be done?

I'm assuming you're talking about the continuous response case. If so, I'd recommend the quantregForest package that layers on top of the basic randomForest package and gives conditional quantile predictions. The documentation is quite good. Instead of assuming a gaussian distribution, it build an empirical density function from the terminal nodes.
The ranger package supports quantile predictions and hence prediction intervals: predict(ranger_fit, type = "quantile", quantiles = c(0.025, 0.975)).