mesmer.calibrate_mesmer.train_lv#
- mesmer.calibrate_mesmer.train_lv(preds, targs, esm, cfg, save_params=True, aux={}, params_lv={})#
Derive local variability (i.e., natural variabiliy) parameters.
- Parameters:
preds (dict) – empty dictionary if none, else nested dictionary of predictors with keys
[pred][scen] (1d/ 2d arrays (time)/(run, time) of predictor for specific scenario)
targs (dict) – nested dictionary of targets with keys
[targ][scen] (3d array (run, time, gp) of target for specific scenario)
esm (str) – associated Earth System Model (e.g., “CanESM2” or “CanESM5”)
cfg (module) – config file containing metadata
save_params (bool, optional) – determines if parameters are saved or not, default = True
aux (dict, optional) – provides auxiliary variables needed for lv method at hand
[var] (Xd arrays of auxiliary variable)
params_lv (dict, optional) – pass the params_lv dict, if it already exists so that builds upon that one
- Returns:
params_lv (dict) – dictionary of local variability paramters
[“targs”] (emulated variables, str)
[“esm”] (Earth System Model, str)
[“method”] (applied method, str)
[“preds”] (predictors, list of strs)
[“scenarios”] (emission scenarios used for training, list of strs)
[“part_model_in_lt”] (states if part of the model is saved in params_lt, bool)
[“method_lt_each_gp_sep”] (states if local trends method is applied to each grid point separately, bool)
[xx] (additional params depend on employed lv method)
Notes
- Assumptions:
all targets use same approach and same predictors
each predictor and each target has the same scenarios as keys
all available scenarios are used for training
identified parameters are valid for all training scenarios
if historical data is used for training, it has its own scenario
need to pass the params_lv dict if it already exists so that can continue to build on it
- Disclaimer:
currently no method with preds implemented; but already have in there for consistency
- TODO:
add ability to weight samples differently than equal weight for each scenario in AR process