diff --git a/.gitignore b/.gitignore index dde3895..5938a89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store *.pyc +.Rproj.user diff --git a/code/R/experiments/Experiment.Rmd b/code/R/experiments/Experiment.Rmd index 69ef7c2..c44c61b 100644 --- a/code/R/experiments/Experiment.Rmd +++ b/code/R/experiments/Experiment.Rmd @@ -498,7 +498,7 @@ df.exp5_summary = df.exp5 %>% normal_intervention_percentage = mean(normal_intervention == "normal") * 100, nopreference_intervention_percentage = mean(nopreference_intervention == "no preference") * 100 ) %>% - mutate(Outcome = "negative") %>% + mutate(Outcome = "positive") %>% mutate(Experiment = "fixedint") write_csv(df.exp5_summary, "../../../data/aggregate/fixedint_pos.csv") diff --git a/code/R/optimal_intervention_model/optimal_intervention_model.Rmd b/code/R/optimal_intervention_model/optimal_intervention_model.Rmd index c708a03..4f5f7f6 100644 --- a/code/R/optimal_intervention_model/optimal_intervention_model.Rmd +++ b/code/R/optimal_intervention_model/optimal_intervention_model.Rmd @@ -86,7 +86,6 @@ colnames(df.data) ### Model structure ```{r} - fun.success = function(p_abnormal, p_normal, causal_structure, outcome){ if (causal_structure == "conjunctive"){ p = p_abnormal * p_normal @@ -192,10 +191,10 @@ fun.fit_temperature = function(df_data, df_prediction, temperature){ pull(loss) } -fit.temperature = optim(par = 10, +fit.temperature = optim(par = 10, fn = fun.fit_temperature, method = "L-BFGS-B", - lower = 0, + lower = 0, upper = 100, df_data = df.intervention, df_prediction = df.choice) diff --git a/data/aggregate/fixedint_pos.csv b/data/aggregate/fixedint_pos.csv index 827a1dc..d473690 100644 --- a/data/aggregate/fixedint_pos.csv +++ b/data/aggregate/fixedint_pos.csv @@ -1,3 +1,3 @@ CausalStructure,abnormal_explanation_percentage,normal_explanation_percentage,nopreference_explanation_percentage,abnormal_intervention_percentage,normal_intervention_percentage,nopreference_intervention_percentage,Outcome,Experiment -Conjunctive,53.535353535353536,9.090909090909092,37.37373737373738,80.8080808080808,11.11111111111111,8.080808080808081,negative,fixedint -Disjunctive,27.27272727272727,18.181818181818183,54.54545454545454,65.65656565656566,12.121212121212121,22.22222222222222,negative,fixedint +Conjunctive,53.535353535353536,9.090909090909092,37.37373737373738,80.8080808080808,11.11111111111111,8.080808080808081,positive,fixedint +Disjunctive,27.27272727272727,18.181818181818183,54.54545454545454,65.65656565656566,12.121212121212121,22.22222222222222,positive,fixedint diff --git a/figures/plots/bars.pdf b/figures/plots/bars.pdf index e03091e..c0c248a 100644 Binary files a/figures/plots/bars.pdf and b/figures/plots/bars.pdf differ diff --git a/figures/plots/scatter.pdf b/figures/plots/scatter.pdf index 157b58d..7abca1c 100644 Binary files a/figures/plots/scatter.pdf and b/figures/plots/scatter.pdf differ