Skip to contents

This function uses either Random Forest or Convolutional Neural Network model based on the model_type parameter.

Usage

SDA_downscale(
  preprocessed,
  carbon_pool,
  covariates,
  model_type = c("rf", "cnn"),
  seed = NULL
)

Arguments

preprocessed

List. Preprocessed data returned as an output from the SDA_downscale_preprocess function.

carbon_pool

Character. Carbon pool of interest. Name must match the carbon pool in `preprocessed`.

covariates

SpatRaster stack or sf object. Used as predictors in downscaling. If providing a raster stack, layers should be named. If providing an sf object, predictor attributes should be present.

model_type

Character. Either "rf" for Random Forest or "cnn" for Convolutional Neural Network. Default is Random Forest.

seed

Numeric or NULL. Optional seed for random number generation. Default is NULL.

Value

A list containing the training and testing data sets, models, predicted maps for each ensemble member, and predictions for testing data.

Details

This function will downscale forecast data to unmodeled locations using covariates and site locations

Author

Joshua Ploshay, Sambhav Dixit