Downscales a raster to a higher resolution raster using a robust regression

raster.downscale(
  x,
  y,
  p = NULL,
  n = NULL,
  filename = FALSE,
  scatter = FALSE,
  ...
)

Arguments

x

Raster class object representing independent variable(s)

y

Raster class object representing dependent variable

p

Percent sample size

n

Fixed sample size

filename

Name of output raster

scatter

(FALSE/TRUE) Optional scatter plot

...

Additional arguments passed to predict

Value

A list object containing:

  • downscale downscaled raster (omitted if filename is defined)

  • model rlm model object

  • MSE Mean Square Error

  • AIC Akaike information criterion

Author

Jeffrey S. Evans <jeffrey_evans@tnc.org>

Examples

if (FALSE) { library(raster) elev <- raster::getData('alt', country='SWZ', mask=TRUE) tmax <- raster::getData('worldclim', var='tmax', res=10, lon=8.25, lat=46.8) tmax <- crop(tmax[[1]], extent(elev)) # Downscale temperature tmax.ds <- raster.downscale(elev, tmax, scatter=TRUE) opar <- par(no.readonly=TRUE) par(mfrow=c(2,2)) plot(tmax, main="Temp max") plot(elev, main="elevation") plot(tmax.ds$downscale, main="Downscaled Temp max") par(opar) }