Skip to content

Commit

Permalink
correct bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ADucellierIHME committed Oct 15, 2024
1 parent 1ef4ec8 commit 6dd9c0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/raking/compute_covariance.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ def compute_covariance_margins_3D(
df1.sort_values(by=[var_names[2], var_names[1], draws], inplace=True)
df2 = df_margins_2[[var_names[0], var_names[2], 'value_agg_over_' + var_names[1], draws]]
df2 = df2.loc[df2[var_names[2]].isin(var3[0:-1])]
df2.sort_values(by=[var_names[0], var_names[2], draws, inplace=True)
df2.sort_values(by=[var_names[0], var_names[2], draws], inplace=True)
df3 = df_margins_3[[var_names[0], var_names[1], 'value_agg_over_' + var_names[2], draws]]
df3 = df3.loc[df3[var_names[0]].isin(var1[0:-1])]
df3.sort_values(by=[var_names[1], var_names[0], draws, inplace=True)
df3.sort_values(by=[var_names[1], var_names[0], draws], inplace=True)
value1 = df1['value_agg_over_' + var_names[0]].to_numpy()
value2 = df2['value_agg_over_' + var_names[1]].to_numpy()
value3 = df3['value_agg_over_' + var_names[2]].to_numpy()
Expand Down Expand Up @@ -316,10 +316,10 @@ def compute_covariance_obs_margins_3D(
df_margins_1.sort_values(by=[var_names[2], var_names[1], draws], inplace=True)
df_margins_2 = df_margins_2[[var_names[0], var_names[2], 'value_agg_over_' + var_names[1], draws]]
df_margins_2 = df_margins_2.loc[df_margins_2[var_names[2]].isin(var3[0:-1])]
df_margins_2.sort_values(by=[var_names[0], var_names[2], draws, inplace=True)
df_margins_2.sort_values(by=[var_names[0], var_names[2], draws], inplace=True)
df_margins_3 = df_margins_3[[var_names[0], var_names[1], 'value_agg_over_' + var_names[2], draws]]
df_margins_3 = df_margins_3.loc[df_margins_3[var_names[0]].isin(var1[0:-1])]
df_margins_3.sort_values(by=[var_names[1], var_names[0], draws, inplace=True)
df_margins_3.sort_values(by=[var_names[1], var_names[0], draws], inplace=True)
value_obs = df_obs['value'].to_numpy()
value_margins_1 = df_margins_1['value_agg_over_' + var_names[0]].to_numpy()
value_margins_2 = df_margins_2['value_agg_over_' + var_names[1]].to_numpy()
Expand Down

0 comments on commit 6dd9c0d

Please sign in to comment.