Error running gbm.step in dismo package

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error running gbm.step in dismo package

Ned Horning-2
Hi -

I get the following error occasionally when I run gbm.step in the dismo:
--
Error in var(threshold.stats, use = "complete.obs") :
   no complete element pairs
--

I also get several warnings such as:
--
3: In glm.fit(x = X, y = Y, weights = weights, start = start, etastart =
etastart,  :
   algorithm did not converge
4: In glm.fit(x = X, y = Y, weights = weights, start = start, etastart =
etastart,  :
   fitted probabilities numerically 0 or 1 occurred
5: In cor(y_i, u_i) : the standard deviation is zero
--

Here is the line I use to run gbm.step:
gbm_object <- gbm.step(data=model.data,  gbm.x=9:45,  gbm.y=1,  
family="bernoulli",
     tree.complexity=5, learning.rate=0.001, bag.fraction=0.5)

The response variable is presence/absence (0/1) data for a bird species.
When I run this with the full data set for particular bird species the
data.frame "model.data" has 371 rows (plots) and then the error does not
appear but I still get several warnings. When I run it on a subset of
only 93 rows (I'd like to do k-fold partitioning) I get the error and
warnings mentioned above. For what it's worth, this problem data subset
has 88 presences and only 5 absences. It appears that when I run this
for bird species with more of a balance of presences and absences I
don't get any errors or warnings.

Any thoughts or pointers?

All the best,

Ned

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Error running gbm.step in dismo package

zacksteel
I'm having similar issues with my gbm.step models as Ned described in his original post, but I see that no one posted a solution. Does anyone have any thoughts on how to deal with this? I'm especially interested in what the following error means:

"In cor(y_i, u_i) : the standard deviation is zero"

Thanks