EITrans::EITrans is the main function for ensemble forecast calibration with the empirical inverse transform function method.
EITrans( ens, ens_times, ens_flts, ens_times_train, ens_times_test, obs, deltas, infinity_estimators, multipliers, circular_ens = F, pre_sorted = F, save_intermediate = F, optimize_lead_time = F )
ens | A 4-dimensional array for ensemble forecasts. Dimensions should be
|
---|---|
ens_times | A vector for ensemble forecast times. |
ens_flts | A vector for ensemble forecast lead times. |
ens_times_train | Training times from the ensemble forecast times. |
ens_times_test | Testing times from the ensemble forecast times. |
obs | A 3-dimensional array for observations that correspond to the
ensemble forecasts. Dimensions should be |
deltas | A vector of deltas to experiment. It can also be a list with
|
infinity_estimators | A vector of values to experiment for estimating
the ensemble spread. Or a list with named members |
multipliers | A vector of values to experiment for adjusting the ensemble member offset. |
circular_ens | Whether the ensemble forecast variable is circular. |
pre_sorted | Whether the ensemble members are presorted. |
save_intermediate | Whether to save intermediate data. |
optimize_lead_time | Whether to calibrate each forecast lead time respectively. Theoretically, this would lead to better calibration results, but also significantly more computation because calibration needs to be evaluated per lead time. |
A list with the calibrated ensemble forecasts and intermediate results.
This function uses foreach
parallel mechanism. Parallelization is handled
by users creating the parallel backend. Please see examples. It is recommended
to use doSNOW
for handling the parallel backend.
if (FALSE) { # Use doSNOW to launch parallel backend library(doSNOW) cl <- snow::makeCluster(4) # Use 4 cores registerDoSNOW(cl) # If you know a host file, you can also launch on remote server nodefile <- Sys.getenv("PBS_NODEFILE") nodes <- readLines(nodefile) cl <- makeCluster(nodes, type = "SOCK") registerDoSNOW(cl) eitrans_results <- EITrans( ens = ens$analogs, ens_times = ens$test_times, ens_flts = ens$flts, ens_times_train = ens$test_times[1:(test_start - 366)], ens_times_test = ens$test_times[test_start:test_end], obs = ens$obs_aligned, deltas = seq(-0.02, 0.044, by = 0.002), infinity_estimators = seq(0.1, 0.5, by = 0.1), multipliers = seq(0.1, 1.1, by = 0.1)) # If you are using doSNOW stopCluster(cl) }