]> code.communitydata.science - ml_measurement_error_public.git/blob - simulations/Makefile
check in some old simulation updates and a dv examples with real data
[ml_measurement_error_public.git] / simulations / Makefile
1 .ONESHELL:
2 SHELL=bash
3
4 Ns=[1000, 5000, 10000]
5 ms=[100, 200, 400]
6 seeds=[$(shell seq -s, 1 500)]
7 explained_variances=[0.1]
8
9 all:main supplement
10 main:remembr.RDS 
11 supplement:robustness_1.RDS robustness_1_dv.RDS robustness_2.RDS robustness_2_dv.RDS robustness_3.RDS robustness_3_dv.RDS robustness_4.RDS robustness_4_dv.RDS 
12
13 srun=sbatch --wait --verbose run_job.sbatch
14
15
16 joblists:example_1_jobs example_2_jobs example_3_jobs
17
18 # test_true_z_jobs: test_true_z.R simulation_base.R
19 #       sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript test_true_z.R" --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["test_true_z.feather"], "y_explained_variancevari":${explained_variances}, "Bzx":${Bzx}}' --outfile test_true_z_jobsb
20
21 # test_true_z.feather: test_true_z_jobs 
22 #       rm -f test_true_z.feather
23 #       sbatch --wait --verbose --array=1-3000 run_simulation.sbatch 0 test_true_z_jobs
24 #       sbatch --wait --verbose --array=3001-6001 run_simulation.sbatch 0 test_true_z_jobs
25
26
27 example_1_jobs: 01_two_covariates.R simulation_base.R grid_sweep.py pl_methods.R
28         ${srun} grid_sweep.py --command "Rscript 01_two_covariates.R" --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["example_1.feather"], "y_explained_variance":${explained_variances}, "Bzx":[1]}' --outfile example_1_jobs
29
30 example_1.feather: example_1_jobs 
31         rm -f example_1.feather
32         sbatch --wait --verbose --array=1-1000  run_simulation.sbatch 0 example_1_jobs
33         sbatch --wait --verbose --array=1001-2000  run_simulation.sbatch 0 example_1_jobs
34         sbatch --wait --verbose --array=2001-3000  run_simulation.sbatch 0 example_1_jobs
35         sbatch --wait --verbose --array=3001-4000  run_simulation.sbatch 0 example_1_jobs
36         sbatch --wait --verbose --array=4001-$(shell cat example_1_jobs | wc -l)  run_simulation.sbatch 0 example_1_jobs
37
38 example_2_jobs: 02_indep_differential.R simulation_base.R grid_sweep.py pl_methods.R
39         sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript 02_indep_differential.R" --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["example_2.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y*z*x"]}' --outfile example_2_jobs
40
41 example_2.feather: example_2_jobs 
42         rm -f example_2.feather
43         sbatch --wait --verbose --array=1-1000  run_simulation.sbatch 0 example_2_jobs
44         sbatch --wait --verbose --array=1001-2000  run_simulation.sbatch 0 example_2_jobs
45         sbatch --wait --verbose --array=2001-3000  run_simulation.sbatch 0 example_2_jobs
46         sbatch --wait --verbose --array=3001-4000  run_simulation.sbatch 0 example_2_jobs
47         sbatch --wait --verbose --array=4001-$(shell cat example_2_jobs | wc -l)  run_simulation.sbatch 0 example_2_jobs
48
49
50 # example_2_B_jobs: example_2_B.R
51 #       sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript example_2_B.R" --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["example_2_B.feather"]}' --outfile example_2_B_jobs
52
53 # example_2_B.feather: example_2_B_jobs
54 #       rm -f example_2_B.feather
55 #       sbatch --wait --verbose --array=1-3000 run_simulation.sbatch 0 example_2_B_jobs
56
57 example_3_jobs: 03_depvar.R simulation_base.R grid_sweep.py pl_methods.R
58         sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript 03_depvar.R" --arg_dict '{"N":${Ns},"m":${ms}, "Bxy":[0.7],"Bzy":[-0.7],"seed":${seeds}, "outfile":["example_3.feather"], "y_explained_variance":${explained_variances}}' --outfile example_3_jobs
59
60 example_3.feather: example_3_jobs
61         rm -f example_3.feather 
62         sbatch --wait --verbose --array=1-1000  run_simulation.sbatch 0 example_3_jobs
63         sbatch --wait --verbose --array=1001-2000  run_simulation.sbatch 0 example_3_jobs
64         sbatch --wait --verbose --array=2001-3000  run_simulation.sbatch 0 example_3_jobs
65         sbatch --wait --verbose --array=3001-4000  run_simulation.sbatch 0 example_3_jobs
66         sbatch --wait --verbose --array=4001-$(shell cat example_3_jobs | wc -l)  run_simulation.sbatch 0 example_3_jobs
67
68 example_4_jobs: 04_depvar_differential.R simulation_base.R grid_sweep.py pl_methods.R
69         sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript 04_depvar_differential.R" --arg_dict '{"N":${Ns},"Bxy":[0.7],"Bzy":[-0.7],"m":${ms}, "seed":${seeds}, "outfile":["example_4.feather"], "z_bias":[0.5]}' --outfile example_4_jobs
70
71 example_4.feather: example_4_jobs
72         rm -f example_4.feather 
73         sbatch --wait --verbose --array=1-1000  run_simulation.sbatch 0 example_4_jobs
74         sbatch --wait --verbose --array=1001-2000  run_simulation.sbatch 0 example_4_jobs
75         sbatch --wait --verbose --array=2001-3000  run_simulation.sbatch 0 example_4_jobs
76         sbatch --wait --verbose --array=3001-4000  run_simulation.sbatch 0 example_4_jobs
77         sbatch --wait --verbose --array=4001-$(shell cat example_4_jobs | wc -l)  run_simulation.sbatch 0 example_4_jobs
78
79
80
81 remembr.RDS:example_1.feather example_2.feather example_3.feather example_4.feather plot_example.R plot_dv_example.R summarize_estimator.R
82         rm -f remembr.RDS
83         ${srun} Rscript plot_example.R --infile example_1.feather --name "plot.df.example.1"
84         ${srun} Rscript plot_example.R --infile example_2.feather --name "plot.df.example.2"
85         ${srun} Rscript plot_dv_example.R --infile example_3.feather --name "plot.df.example.3"
86         ${srun} Rscript plot_dv_example.R --infile example_4.feather --name "plot.df.example.4"
87
88
89 irr_Ns = [1000]
90 irr_ms = [150,300,600]
91 irr_seeds=${seeds}
92 irr_explained_variances=${explained_variances}
93 irr_coder_accuracy=[0.80]
94
95 example_5_jobs: 05_irr_indep.R irr_simulation_base.R grid_sweep.py pl_methods.R measerr_methods.R
96         sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript 05_irr_indep.R" --arg_dict '{"N":${irr_Ns},"m":${irr_ms}, "seed":${irr_seeds}, "outfile":["example_5.feather"], "y_explained_variance":${irr_explained_variances}, "coder_accuracy":${irr_coder_accuracy}}' --outfile example_5_jobs
97
98 example_5.feather:example_5_jobs
99         rm -f example_5.feather
100         sbatch --wait --verbose --array=1-1000  run_simulation.sbatch 0 example_5_jobs
101         sbatch --wait --verbose --array=1001-$(shell cat example_5_jobs | wc -l)  run_simulation.sbatch 1000 example_5_jobs
102         # sbatch --wait --verbose --array=2001-3000  run_simulation.sbatch 2000 example_5_jobs
103         # sbatch --wait --verbose --array=3001-4000  run_simulation.sbatch 3000 example_5_jobs
104         # sbatch --wait --verbose --array=2001-$(shell cat example_5_jobs | wc -l)  run_simulation.sbatch 4000 example_5_jobs
105
106
107
108 # example_6_jobs: 06_irr_dv.R irr_dv_simulation_base.R grid_sweep.py pl_methods.R
109 #       sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript 06_irr_dv.R" --arg_dict '{"N":${irr_Ns},"m":${irr_ms}, "seed":${irr_seeds}, "outfile":["example_6.feather"], "y_explained_variance":${irr_explained_variances},"coder_accuracy":${irr_coder_accuracy}}' --outfile example_6_jobs
110
111 # example_6.feather:example_6_jobs
112 #       rm -f example_6.feather
113 #       sbatch --wait --verbose --array=1-1000  run_simulation.sbatch 0 example_6_jobs
114 #       sbatch --wait --verbose --array=1001-2000  run_simulation.sbatch 1000 example_6_jobs
115 #       sbatch --wait --verbose --array=2001-$(shell cat example_6_jobs | wc -l)  run_simulation.sbatch 2000 example_6_jobs
116
117
118 remember_irr.RDS: example_5.feather plot_irr_example.R plot_irr_dv_example.R summarize_estimator.R
119         rm -f remember_irr.RDS
120         sbatch --wait --verbose run_job.sbatch Rscript plot_irr_example.R --infile example_5.feather --name "plot.df.example.5"
121 #       sbatch --wait --verbose run_job.sbatch Rscript plot_irr_dv_example.R --infile example_6.feather --name "plot.df.example.6"
122
123
124 robustness_1_jobs: 02_indep_differential.R simulation_base.R grid_sweep.py
125         sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript 02_indep_differential.R" --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_1.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~1"]}' --outfile robustness_1_jobs
126
127
128
129 START=0
130 STEP=1000
131 ONE=1
132
133 robustness_1.feather: robustness_1_jobs
134         $(eval END_1!=cat robustness_1_jobs | wc -l)
135         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
136         rm -f robustness_1.feather
137         sbatch --wait --verbose --array=1-1000  run_simulation.sbatch 0 robustness_1_jobs
138         sbatch --wait --verbose --array=1001-2000  run_simulation.sbatch 0 robustness_1_jobs
139         sbatch --wait --verbose --array=2001-3000  run_simulation.sbatch 0 robustness_1_jobs
140         sbatch --wait --verbose --array=3001-4000  run_simulation.sbatch 0 robustness_1_jobs
141         sbatch --wait --verbose --array=4001-$(shell cat robustness_1_jobs | wc -l)  run_simulation.sbatch 0 robustness_1_jobs
142
143         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_1_jobs;)
144
145 robustness_1.RDS: robustness_1.feather
146         rm -f robustness_1.RDS
147         ${srun} Rscript plot_example.R --infile $< --name "robustness_1" --remember-file $@
148
149 robustness_1_dv_jobs: simulation_base.R 04_depvar_differential.R grid_sweep.py
150         ${srun} grid_sweep.py --command 'Rscript 04_depvar_differential.R' --arg_dict '{"N":${Ns},"Bxy":[0.7],"Bzy":[-0.7],"m":${ms}, "seed":${seeds}, "outfile":["robustness_1_dv.feather"], "proxy_formula":["w_pred~y"],"z_bias":[0.5]}' --outfile robustness_1_dv_jobs
151
152 robustness_1_dv.feather: robustness_1_dv_jobs
153         rm -f robustness_1_dv.feather
154         $(eval END_1!=cat robustness_1_dv_jobs | wc -l)
155         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
156         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_1_dv_jobs;)
157
158
159 robustness_1_dv.RDS: robustness_1_dv.feather
160         rm -f $@
161         ${srun} Rscript plot_dv_example.R --infile $< --name "robustness_1_dv" --remember-file $@
162
163
164 robustness_2_jobs_p1: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
165         rm -f $@
166         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_2.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.60,0.65]}' --outfile $@
167
168 robustness_2_jobs_p2: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
169         rm -f $@
170         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_2.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.70,0.75]}' --outfile $@
171
172 robustness_2_jobs_p3: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
173         rm -f $@
174         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_2.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.80,0.85]}' --outfile $@
175
176 robustness_2_jobs_p4: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
177         rm -f $@
178         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_2.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.90,0.95]}' --outfile $@
179
180 robustness_2.feather: robustness_2_jobs_p1 robustness_2_jobs_p2 robustness_2_jobs_p3 robustness_2_jobs_p4
181         $(eval END_1!=cat robustness_2_jobs_p1 | wc -l)
182         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
183         $(eval END_2!=cat robustness_2_jobs_p2 | wc -l)
184         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
185         $(eval END_3!=cat robustness_2_jobs_p3 | wc -l)
186         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
187         $(eval END_4!=cat robustness_2_jobs_p4 | wc -l)
188         $(eval ITEMS_4!=seq $(START) $(STEP) $(END_4))
189
190         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p1;)
191         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p2;)
192         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p3;)
193         $(foreach item,$(ITEMS_4),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p4;)
194
195 robustness_2.RDS: plot_example.R robustness_2.feather 
196         rm -f $@
197         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_2" --remember-file $@
198
199 robustness_2_dv_jobs_p1: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
200         rm -f $@
201         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_2_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.60,0.65]}' --outfile $@
202
203 robustness_2_dv_jobs_p2: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
204         rm -f $@
205         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_2_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.70,0.75]}' --outfile $@
206
207 robustness_2_dv_jobs_p3: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
208         rm -f $@
209         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_2_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.80,0.85]}' --outfile $@
210
211 robustness_2_dv_jobs_p4: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
212         rm -f $@
213         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_2_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.90,0.95]}' --outfile $@
214
215 robustness_2_dv.feather: robustness_2_dv_jobs_p1 robustness_2_dv_jobs_p2 robustness_2_dv_jobs_p3 robustness_2_dv_jobs_p4
216         $(eval END_1!=cat robustness_2_dv_jobs_p1 | wc -l)
217         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
218         $(eval END_2!=cat robustness_2_dv_jobs_p2 | wc -l)
219         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
220         $(eval END_3!=cat robustness_2_dv_jobs_p3 | wc -l)
221         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
222         $(eval END_4!=cat robustness_2_dv_jobs_p4 | wc -l)
223         $(eval ITEMS_4!=seq $(START) $(STEP) $(END_4))
224
225         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_dv_jobs_p1;)
226         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_dv_jobs_p2;)
227         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_dv_jobs_p3;)
228         $(foreach item,$(ITEMS_4),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_dv_jobs_p4;)
229
230 robustness_2_dv.RDS: plot_example.R robustness_2_dv.feather 
231         rm -f $@
232         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_2_dv" --remember-file $@
233
234
235 robustness_3_jobs_p1: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
236         rm -f $@
237         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_3.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3],"Px":[0.5,0.6], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85]}' --outfile $@
238
239 robustness_3_jobs_p2: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
240         rm -f $@
241         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_3.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3],"Px":[0.7,0.8], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85]}' --outfile $@
242
243 robustness_3_jobs_p3: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
244         rm -f $@
245         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_3.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3],"Px":[0.9,0.95], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85]}' --outfile $@
246
247 robustness_3.feather: robustness_3_jobs_p1 robustness_3_jobs_p2 robustness_3_jobs_p3
248         $(eval END_1!=cat robustness_3_jobs_p1 | wc -l)
249         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
250         $(eval END_2!=cat robustness_3_jobs_p2 | wc -l)
251         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
252         $(eval END_3!=cat robustness_3_jobs_p3 | wc -l)
253         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
254
255         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p1;)
256         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p2;)
257         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p3;)
258
259 robustness_3.RDS: plot_example.R robustness_3.feather 
260         rm -f $@
261         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_3" --remember-file $@
262
263 robustness_3_dv_jobs_p1: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
264         rm -f $@
265         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_3_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3],"B0":[0.5,0.6], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85]}' --outfile $@
266
267
268
269 robustness_3_dv_jobs_p2: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
270         rm -f $@
271         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_3_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3],"B0":[0.7,0.8], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85]}' --outfile $@
272
273
274 robustness_3_dv_jobs_p3: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
275         rm -f $@
276         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_3_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "B0":[0.9,0.95], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85]}' --outfile $@
277
278 robustness_3_dv.feather: robustness_3_dv_jobs_p1 robustness_3_dv_jobs_p2 robustness_3_dv_jobs_p3
279         $(eval END_1!=cat robustness_3_dv_jobs_p1 | wc -l)
280         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
281         $(eval END_2!=cat robustness_3_dv_jobs_p2 | wc -l)
282         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
283         $(eval END_3!=cat robustness_3_dv_jobs_p3 | wc -l)
284         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
285
286         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_dv_jobs_p1;)
287         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_dv_jobs_p2;)
288          $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_dv_jobs_p3;)
289
290
291 robustness_3_dv.RDS: plot_dv_example.R robustness_3_dv.feather 
292         rm -f $@
293         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_3_dv" --remember-file $@
294
295
296 robustness_4_jobs_p1: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
297         rm -f $@
298         ${srun} $< --command 'Rscript 02_indep_differential.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_4.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85],"y_bias":[-1,-0.85]}' --outfile $@
299
300 robustness_4_jobs_p2: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
301         rm -f $@
302         ${srun} $< --command 'Rscript 02_indep_differential.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_4.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85], "y_bias":[-0.70,-0.55]}' --outfile $@
303
304 robustness_4_jobs_p3: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
305         rm -f $@
306         ${srun} $< --command 'Rscript 02_indep_differential.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_4.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85],"y_bias":[-0.4,-0.25]}' --outfile $@
307
308 robustness_4_jobs_p4: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
309         rm -f $@
310         ${srun} $< --command 'Rscript 02_indep_differential.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_4.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[0.3], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85],"y_bias":[-0.1,0]}' --outfile $@
311
312 robustness_4.feather: robustness_4_jobs_p1 robustness_4_jobs_p2 robustness_4_jobs_p3
313         $(eval END_1!=cat robustness_4_jobs_p1 | wc -l)
314         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
315         $(eval END_2!=cat robustness_4_jobs_p2 | wc -l)
316         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
317         $(eval END_3!=cat robustness_4_jobs_p3 | wc -l)
318         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
319
320         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p1;)
321         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p2;)
322         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p3;)
323
324 robustness_4.RDS: plot_example.R robustness_4.feather 
325         rm -f $@
326         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_4" --remember-file $@
327
328
329 # '{"N":${Ns},"Bxy":[0.7],"Bzy":[-0.7],"m":${ms}, "seed":${seeds}, "outfile":["example_4.feather"], "z_bias":[0.5]}' --outfile example_4_jobs
330
331 robustness_4_dv_jobs_p1: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
332         rm -f $@
333         ${srun} $< --command 'Rscript 04_depvar_differential.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_4_dv.feather"], "Bzy":[-0.7],"Bxy":[0.7], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"z_bias":[0,0.1]}' --outfile $@
334
335 robustness_4_dv_jobs_p2: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
336         rm -f $@
337         ${srun} $< --command 'Rscript 04_depvar_differential.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_4_dv.feather"], "Bzy":[-0.7],"Bxy":[0.7], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"z_bias":[0.25,0.4]}' --outfile $@
338
339 robustness_4_dv_jobs_p3: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
340         rm -f $@
341         ${srun} $< --command 'Rscript 04_depvar_differential.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_4_dv.feather"], "Bzy":[-0.7],"Bxy":[0.7],"outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"z_bias":[0.55,0.7]}' --outfile $@
342
343 robustness_4_dv_jobs_p4: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
344         rm -f $@
345         ${srun} $< --command 'Rscript 04_depvar_differential.R'  --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["robustness_4_dv.feather"],"Bzy":[-0.7],"Bxy":[0.7], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"z_bias":[0.85,1]}' --outfile $@
346
347 robustness_4_dv.feather: robustness_4_dv_jobs_p1 robustness_4_dv_jobs_p2 robustness_4_dv_jobs_p3
348         $(eval END_1!=cat robustness_4_dv_jobs_p1 | wc -l)
349         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
350         $(eval END_2!=cat robustness_4_dv_p2 | wc -l)
351         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
352         $(eval END_3!=cat robustness_4_dv_p3 | wc -l)
353         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
354
355         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_dv_jobs_p1;)
356         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_dv_jobs_p2;)
357         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_dv_jobs_p3;)
358
359
360 robustness_4_dv.RDS: plot_dv_example.R robustness_4_dv.feather 
361         rm -f $@
362         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_4" --remember-file $@
363
364 #       
365 clean:
366         rm *.feather
367         rm -f remembr.RDS
368         rm -f remembr*.RDS
369         rm -f robustness*.RDS
370         rm -f example_*_jobs
371         rm -f robustness_*_jobs_*
372 #       sbatch --wait --verbose --array=3001-6001 run_simulation.sbatch 0 example_2_B_jobs
373
374 # example_2_B_mecor_jobs:
375 #       sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript example_2_B_mecor.R" --arg_dict '{"N":${Ns},"m":${ms}, "seed":${seeds}, "outfile":["example_2_B_mecor.feather"]}' --outfile example_2_B_mecor_jobs
376
377 # example_2_B_mecor.feather:example_2_B_mecor.R example_2_B_mecor_jobs
378 #       rm -f example_2_B_mecor.feather
379 #       sbatch --wait --verbose --array=1-3000 run_simulation.sbatch 0 example_2_B_mecor_jobs
380 #       sbatch --wait --verbose --array=3001-6001 run_simulation.sbatch 0 example_2_B_mecor_jobs
381
382
383
384 .PHONY: supplement

Community Data Science Collective || Want to submit a patch?