8
$\begingroup$

I have 5 variables for each countries of the world and I need to analyze their effect and interactions on an independent variable. Random Forest would be adequate for my scope as it deals with non-linear relationships and predicts variables importance. However, I'm wondering if spatial dependence may be an issue. I've never seen spatial dependence discussed in RF applications even if it has been widely used for spatial data.

$\endgroup$
8
$\begingroup$

It has no problem with spatial autocorrelation of your response or explanatory variables. It's a totally non-parametric technique. I have used it for the interpolation of structural diversity variables across my country based on in situ data from a regular grid and introducing the coordinates as covariables even produces better predictions. This is because Random Forest is based on a divide and conquer approach (classification and regression trees), meaning it separates your feature space into disjoint subsets where simpler models (by default a simple average in the case of regression) can produce good predictions. Introducing the coordinates as variables, in my case, exploits spatial autocorrelation as it makes sense that certain geographic subsets of the country behave homogeneously.

$\endgroup$
  • $\begingroup$ While I tend to agree with the answer, are you aware of any empirical studies that show this to be the case? RF definitely has issues wrt importance scores and highly correlated variables (e.g., Strobl et al). $\endgroup$ – Prophet60091 Sep 10 '14 at 21:34
  • 2
    $\begingroup$ This makes a lot of sense since when you grow a tree, at each split, it must be decided what variable it's going to use. In the extreme case, if you have two perfectly correlated variables the splitting scheme would simply choose one of them randomly. Thus if you re-train the random forest you would see the importance scores being very unstable in these correlated variables. They would be very prone to switch places in the hierarchy. $\endgroup$ – JEquihua Dec 5 '14 at 17:02
  • $\begingroup$ @JEquihua I know I am very late to the party but I'd be very interested to know how you incorporated coordinates as covariables? I am using the randomForest package in R and am not aware of any options to include covariables yet it makes a lot of sense especially with clustered spatially autocorrelated data. $\endgroup$ – Kristina Jun 28 '18 at 1:44
  • $\begingroup$ Hello @Kristina. I just introduced them as additional features, i.e. lat and lon as two different columns in your train table. This only works if your train data represents well your geographical space, in my example I had around 25,000 points located on a regular grid over my area of interest. $\endgroup$ – JEquihua Jul 3 '18 at 22:32
  • $\begingroup$ @JEquihua Thanks for your response! I tried this before, however, I had the impression that this heavily skewed the model. However, this might be due to the fact that I have several independent regions (marine protected areas across the globe) in my data. Do you have any suggestions how best to handle this as I'd very much like to include location. Thank you! $\endgroup$ – Kristina Jul 4 '18 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.