# With Random Forests, is it possible to provide an error term for each variable or each sample?

I'm wondering if there are any implementations of random forests that allow one to provide error terms for the inputs.

An error term could be based on a per-variable basis, or on a per-sample/variable basis.

If an error term was specified on a per variable basis, we would let the random forest algorithm know that "this variable $A$ has a sampling error of $\pm 5\%$, whereas this variable $B$ has a sampling error of $\pm 10\%$".

If an error term was specified on a per sample/variable basis, we would specify the error terms on all individual samples. We would let the random forest know that "for sample 1, variable $A$ has a sampling error of $\pm 5\%$, and variable B has a sampling error of $\pm 8\%$, whereas sample 2, variable $A$ has a sampling error of $\pm 6\%$ and variable $B$ has a sampling error of $\pm 12\%$".

I am particularly interested in implementations in R, C++, C# or Python.

• @Glen_b Thanks for the edit, it looks much cleaner now. – Contango Sep 7 '14 at 11:00

You may replace each training example ($x$, $\sigma(x)$, y) with a set of training examples (or just one training example) distributed as $N(x, \sigma(x))\rho(x)$, where $\rho(x)$ is the prior distribution of $x$.
• Brilliant answer. I'm wondering if its possible to deal with variables that might have some known correlation? I'm assuming that you would randomly generate the first variable $A$ then generate the second variable $B$ assuming the correlation? – Contango Sep 7 '14 at 11:03