apaRandomForest.Regression.R2(Y, X, maxDepth, minSamplesSplit, nLags, nTrees, minObs, maxObs, minFeatures, maxFeatures)
Excel
=apaRandomForest.Regression.R2(Y, X, maxDepth, minSamplesSplit, nLags, nTrees, minObs, maxObs, minFeatures, maxFeatures)Result
Returns the R-squared of a random forest regression.
Syntax
Y: r x 1 vector of the dependent variable
X: r x c matrix of predictors
maxDepth: maximum depth of the trees (determines the number of branches)
minSamplesSplit: minimum number of observations required to split a node
nLags: number of lags
nTrees: number of trees in the forest
minObs: minimum number of observations sampled per tree
maxObs: maximum number of observations sampled per tree
minFeatures: minimum number of features sampled per tree
maxFeatures: maximum number of features sampled per tree
