Skip to content

Commit 73fd952

Browse files
committed
Fix (?) periods for shocks.
1 parent 3a8cac4 commit 73fd952

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/skillmodels/params_index.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def get_params_index(
3535
ind_tups += get_shock_sds_index_tuples(
3636
periods=labels["periods"],
3737
factors=labels["latent_factors"],
38+
has_investments=investments_info["has_investments"],
3839
)
3940
ind_tups += initial_mean_index_tuples(
4041
n_mixtures=dimensions["n_mixtures"],
@@ -113,7 +114,7 @@ def get_meas_sds_index_tuples(update_info):
113114
return ind_tups
114115

115116

116-
def get_shock_sds_index_tuples(periods, factors):
117+
def get_shock_sds_index_tuples(periods, factors, has_investments):
117118
"""Index tuples for shock_sd.
118119
119120
Args:
@@ -124,8 +125,9 @@ def get_shock_sds_index_tuples(periods, factors):
124125
ind_tups (list)
125126
126127
"""
128+
end = -2 if has_investments else -1
127129
ind_tups = []
128-
for period in periods[:-1]:
130+
for period in periods[:end]:
129131
for factor in factors:
130132
ind_tups.append(("shock_sds", period, factor, "-"))
131133
return ind_tups

0 commit comments

Comments
 (0)