predict.gradientForest: Predict for gradientForest

predict.gradientForestR Documentation

Predict for gradientForest

Description

Predict method for gradientForest or combinedGradientForest objects.

Usage

## S3 method for class 'gradientForest'
predict(object, newdata, extrap=TRUE, ...)
## S3 method for class 'combinedGradientForest'
predict(object, newdata, extrap=TRUE, ...)

Arguments

object

an object of class gradientForest or combinedGradientForest.

newdata

An optional data frame in which to look for variables with which to predict. If omitted, the environmental variables at the sites in object$X are used.

extrap

Controls extrapolation to predictor values outside the range of the original site data.

CAUTION: Extrapolation is an experimental feature. No studies have been done to determine what kinds of extrapolation are meaningful. Extrapolation is provided as a convenience to the user who wants extrapolation anyway, and is willing to experiment with their dataset to find useful extrapolation levels.

  • extrap = NA: returns NA for any extrapolated point.

  • extrap = TRUE: use linear extrapolation.

  • extrap = FALSE: predictor values outside the range of the original site data are set to the limits of the original site data.

  • extrap is a number in the range [0,1]: extrapolate with compression. See details.

...

further arguments passed to cumimp.

Details

The predictor cumulative functions can be used to transform grid data layers of environmental variables to a common biological importance scale. This transformation of the multi-dimensional environment space is to a biological space in which coordinate position represents composition associated with the predictors. These inferred compositional patterns can be mapped in biological space and geographic space in a manner analogous to ordination, that takes into account the non-linear and sometimes threshold changes that occur along gradients.

Where environmental values lie outside the range of the original site data, by default extrapolation is performed.

CAUTION: Extrapolation is an experimental feature. No studies have been done to determine what kinds of extrapolation are meaningful. Extrapolation is provided as a convenience to the user who wants extrapolation anyway, and is willing to experiment with their dataset to find useful extrapolation levels.

If (xmin,xmax) are the range of the site predictors with corresponding cumulative importance values (ymin,ymax), the prediction y at a new environmental value outside the range (xmin,xmax) is ymin + (y-ymin)*(x-xmin)/(xmax-xmin). This is equivalent to assigning the average importance inside (xmin,xmax) to all values outside the range. If extrap=FALSE, linear extrapolation is not performed; instead predictions below xmin are fixed at ymin and predictions above xmax are fixed at ymax. This is equivalent to assigning zero importance outside the range of the site data. If 0 <= extrap <= 1, then extrapolation is compressed by ((x - xmax) * (ymax-ymin)/(xmax-xmin))^extrap with some offsets applied to keep the extrapolation below linear extrapolation at all times. A similar transformation is applied to new environmental values below xmin. Values of extrap close to 1 approach linear extrapolation, and values close to 0 approach fixing predictions at ymax.

Value

an object of class predict.gradientForest. It is a dataframe in which each predictor has been transformed to the biological scale by the cumulative importance function, as defined by cumimp.

Author(s)

N. Ellis, CSIRO, Cleveland, Australia. <Nick.Ellis@csiro.au>

References

Ellis, N., Smith, S.J., and Pitcher, C.R. (2012) Gradient Forests: calculating importance gradients on physical predictors. Ecology, 93, 156–168.

See Also

gradientForest

Examples

data(CoMLsimulation)
preds <- colnames(Xsimulation)
specs <- colnames(Ysimulation)
f1 <- gradientForest(data.frame(Ysimulation,Xsimulation), preds, specs, ntree=10)
f1.pred<-predict(f1)


gradientForest documentation built on Aug. 24, 2023, 3:03 p.m.