This function does the heavy lifting in the final function of the tdm workflow titled predict_subdaily_met(). It uses a linear regression approach by generating the hourly values from the coarse data of the file the user selects to downscale based on the hourly models and betas generated by gen.subdaily.models().

lm_ensemble_sims(dat.mod, n.ens, path.model, direction.filter,
  lags.list = NULL, lags.init = NULL, dat.train, precip.distribution,
  force.sanity = TRUE, sanity.tries = 25, seed = Sys.time(),
  print.progress = FALSE)

Arguments

dat.mod

- dataframe to be predicted at the time step of the training data

n.ens

- number of hourly ensemble members to generate

path.model

- path to where the training model & betas is stored

direction.filter

- Whether the model will be filtered backward or forward in time. options = c("backward", "forward") (PalEON will go backward, anybody interested in the future will go forward)

lags.init

- a data frame of initialization parameters to match the data in dat.mod

dat.train

- the training data used to fit the model; needed for night/day in surface_downwelling_shortwave_flux_in_air

precip.distribution

- a list with 2 sub-lists containing the number of observations with precip in the training data per day & the hour of max rain in the training data. This will be used to help solve the "constant drizzle" problem

force.sanity

- (logical) do we force the data to meet sanity checks?

sanity.tries

- how many time should we try to predict a reasonable value before giving up? We don't want to end up in an infinite loop

seed

- (optional) set the seed manually to allow reproducible results

print.progress

- if TRUE will print progress bar

Details

Linear Regression Ensemble Simulation Met downscaling function that predicts ensembles of downscaled meteorology

See also