<p>To summarize, the difference between the two approaches boils down to how the "partial dependence function" of the two predictors is estimated. </p>

<p>The <code>dismo</code> package is based on code originally given in  <a href="http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2656.2008.01390.x/full" rel="noreferrer">Elith et al., 2008</a> and you can find the original source in the supplementary material. The paper very briefly describes the procedure. Basically the model predictions are obtained over a grid of two predictors, <em>setting all other predictors at their means</em>. The model predictions are then regressed onto the grid. The mean squared errors of this model are then multiplied by 1000. This statistic indicates departures of the model predictions from a linear combination of the predictors, indicating a possible interaction. </p>

<p>From the <code>dismo</code> package, we can also obtain the relevant source code for <code>gbm.interactions</code>. The interaction test boils down to the following commands (copied directly from source):</p>

<pre><code>interaction.test.model &lt;- lm(prediction ~ as.factor(pred.frame[,1]) + as.factor(pred.frame[,2]))

interaction.flag &lt;- round(mean(resid(interaction.test.model)^2) * 1000,2)
</code></pre>

<p><code>pred.frame</code> contains a grid of the two predictors in question, and <code>prediction</code> is the prediction from the original <code>gbm</code> fitted model where all but two predictors under consideration are set at their means. </p>

<p>This is different than Friedman's H statistic <a href="http://arxiv.org/pdf/0811.1679.pdf" rel="noreferrer">(Friedman &amp; Popescue, 2005)</a>, which is estimated via formula (44) for any pair of predictors. This is essentially the departure from additivity for any two predictors <em>averaging over</em> the values of the other variables, NOT setting the other variables at their means. It is expressed as a percent of the total variance of the partial dependence function of the two variables (or model implied predictions) so will always be between 0-1. </p>
gbm::interact.gbm vs. dismo::gbm.interactions
<p><strong>Background</strong></p>

<p>The reference manual for the <code>gbm package</code> states the <code>interact.gbm</code> function computes Friedman's H-statistic to assess the strength of variable interactions. the H-statistic is on the scale of [0-1].</p>

<p>The reference manual for the <code>dismo package</code> does not reference any literature for how the <code>gbm.interactions</code> function detects and models interactions. Instead it gives a list of general procedures used to detect and model interactions. The <code>dismo</code> vignette "Boosted Regression Trees for ecological modeling" states that the <code>dismo</code> package extends functions in the <code>gbm</code> package. </p>

<p><strong>Question</strong></p>

<p>How does <code>dismo::gbm.interactions</code> actually detect and model interactions?</p>

<p><strong>Why</strong></p>

<p>I am asking this question because <code>gbm.interactions</code> in the <code>dismo package</code> yields results >1, which the <code>gbm package</code> reference manual says is not possible. </p>

<p>I checked the tar.gz for each of the packages to see if the source code was similar. It is different enough that I cannot determine if these two packages are using the same method to detect and model interactions.</p>