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

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

Arguments

preprocessed

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

date

Date. If SDA site run, format is yyyy/mm/dd; if NEON, yyyy-mm-dd. Restricted to years within file supplied to 'preprocessed' from the 'data_path'.

carbon_pool

Character. Carbon pool of interest. Name must match carbon pool name found within file supplied to 'preprocessed' from the 'data_path'.

covariates

SpatRaster stack. Used as predictors in downscaling. Layers within stack should be named. Recommended that this stack be generated using 'covariates' instructions in assim.sequential/inst folder

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