Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comments from #109 #302

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mesmer/calibrate_mesmer/train_lt.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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