Skip to content

Commit

Permalink
add comments from MESMER-group#109
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause committed Sep 21, 2023
1 parent f5c9d1e commit e1fa096
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mesmer/calibrate_mesmer/train_lt.py
Expand Up @@ -96,6 +96,7 @@ def train_lt(preds, targs, esm, cfg, save_params=True):

# specify necessary variables from config file
wgt_scen_tr_eq = cfg.wgt_scen_tr_eq
# This code will ever only work with a single target variable
method_lt = cfg.methods[targ_name]["lt"]
method_lv = cfg.methods[targ_name]["lv"]
method_lt_each_gp_sep = cfg.method_lt_each_gp_sep
Expand Down Expand Up @@ -182,6 +183,8 @@ def train_lt(preds, targs, esm, cfg, save_params=True):

for pred in params_lv["preds"]:
params_lv[f"coef_{pred}"][targ] = reg_xr[pred].values
else:
raise NotImplementedError()

# save the local trend paramters if requested
if save_params:
Expand Down
6 changes: 6 additions & 0 deletions mesmer/calibrate_mesmer/train_lv.py
Expand Up @@ -249,6 +249,12 @@ def train_lv_AR1_sci(params_lv, targs, y, wgt_scen_eq, aux, cfg):
params_lv["AR1_std_innovs"][targ_name] = params_scen.standard_deviation.values

# determine localization radius, empirical cov matrix, and localized ecov matrix

# y.dims = (sample, gridpoint)
# wgt_scen_eq.dims = (sample,)
# aux["phi_gc"].dims = (gridpoint, gripoint)
# where sample = is a stacked "time, scenario, ensmember"

res = train_lv_find_localized_ecov(y[targ_name], wgt_scen_eq, aux, cfg)
params_lv["L"][targ_name] = res.localization_radius.values
params_lv["ecov"][targ_name] = res.covariance.values
Expand Down
1 change: 1 addition & 0 deletions mesmer/create_emulations/create_emus_gv.py
Expand Up @@ -151,6 +151,7 @@ def create_emus_gv_AR(params_gv, nr_emus_v, nr_ts_emus_v, seed):
np.random.seed(seed)

# buffer so that initial start at 0 does not influence overall result
# Should this buffer be based on the length of ar_lags instead of hard-coded?
buffer = 50

# re-name params for easier reading of code below
Expand Down

0 comments on commit e1fa096

Please sign in to comment.