]> code.communitydata.science - ml_measurement_error_public.git/blob - simulations/Makefile
Make summarize estimator group correctly for robustness checks.
[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.3], "prediction_accuracy":[0.73]}' --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 robustness_1_jobs: 02_indep_differential.R simulation_base.R grid_sweep.py
90         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
91
92
93
94 START=0
95 STEP=1000
96 ONE=1
97
98 robustness_1.feather: robustness_1_jobs
99         $(eval END_1!=cat robustness_1_jobs | wc -l)
100         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
101         rm -f robustness_1.feather
102         sbatch --wait --verbose --array=1-1000  run_simulation.sbatch 0 robustness_1_jobs
103         sbatch --wait --verbose --array=1001-2000  run_simulation.sbatch 0 robustness_1_jobs
104         sbatch --wait --verbose --array=2001-3000  run_simulation.sbatch 0 robustness_1_jobs
105         sbatch --wait --verbose --array=3001-4000  run_simulation.sbatch 0 robustness_1_jobs
106         sbatch --wait --verbose --array=4001-$(shell cat robustness_1_jobs | wc -l)  run_simulation.sbatch 0 robustness_1_jobs
107
108         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_1_jobs;)
109
110 robustness_1.RDS: robustness_1.feather
111         rm -f robustness_1.RDS
112         ${srun} Rscript plot_example.R --infile $< --name "robustness_1" --remember-file $@
113
114 robustness_1_dv_jobs: simulation_base.R 04_depvar_differential.R grid_sweep.py
115         ${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
116
117 robustness_1_dv.feather: robustness_1_dv_jobs
118         rm -f robustness_1_dv.feather
119         $(eval END_1!=cat robustness_1_dv_jobs | wc -l)
120         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
121         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_1_dv_jobs;)
122
123
124 robustness_1_dv.RDS: robustness_1_dv.feather
125         rm -f $@
126         ${srun} Rscript plot_dv_example.R --infile $< --name "robustness_1_dv" --remember-file $@
127
128
129 robustness_2_jobs_p1: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
130         rm -f $@
131         ${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 $@
132
133 robustness_2_jobs_p2: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
134         rm -f $@
135         ${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 $@
136
137 robustness_2_jobs_p3: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
138         rm -f $@
139         ${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 $@
140
141 robustness_2_jobs_p4: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
142         rm -f $@
143         ${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 $@
144
145 robustness_2.feather: robustness_2_jobs_p1 robustness_2_jobs_p2 robustness_2_jobs_p3 robustness_2_jobs_p4
146         $(eval END_1!=cat robustness_2_jobs_p1 | wc -l)
147         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
148         $(eval END_2!=cat robustness_2_jobs_p2 | wc -l)
149         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
150         $(eval END_3!=cat robustness_2_jobs_p3 | wc -l)
151         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
152         $(eval END_4!=cat robustness_2_jobs_p4 | wc -l)
153         $(eval ITEMS_4!=seq $(START) $(STEP) $(END_4))
154
155         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p1;)
156         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p2;)
157         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p3;)
158         $(foreach item,$(ITEMS_4),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p4;)
159
160 robustness_2.RDS: plot_example.R robustness_2.feather 
161         rm -f $@
162         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_2" --remember-file $@
163
164 robustness_2_dv_jobs_p1: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
165         rm -f $@
166         ${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 $@
167
168 robustness_2_dv_jobs_p2: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
169         rm -f $@
170         ${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 $@
171
172 robustness_2_dv_jobs_p3: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
173         rm -f $@
174         ${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 $@
175
176 robustness_2_dv_jobs_p4: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
177         rm -f $@
178         ${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.90,0.95]}' --outfile $@
179
180 robustness_2_dv.feather: robustness_2_dv_jobs_p1 robustness_2_dv_jobs_p2 robustness_2_dv_jobs_p3 robustness_2_dv_jobs_p4
181         $(eval END_1!=cat robustness_2_dv_jobs_p1 | wc -l)
182         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
183         $(eval END_2!=cat robustness_2_dv_jobs_p2 | wc -l)
184         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
185         $(eval END_3!=cat robustness_2_dv_jobs_p3 | wc -l)
186         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
187         $(eval END_4!=cat robustness_2_dv_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_dv_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_dv_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_dv_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_dv_jobs_p4;)
194
195 robustness_2_dv.RDS: plot_example.R robustness_2_dv.feather 
196         rm -f $@
197         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_2_dv" --remember-file $@
198
199
200 robustness_3_jobs_p1: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
201         rm -f $@
202         ${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 $@
203
204 robustness_3_jobs_p2: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
205         rm -f $@
206         ${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 $@
207
208 robustness_3_jobs_p3: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
209         rm -f $@
210         ${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 $@
211
212 robustness_3.feather: robustness_3_jobs_p1 robustness_3_jobs_p2 robustness_3_jobs_p3
213         $(eval END_1!=cat robustness_3_jobs_p1 | wc -l)
214         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
215         $(eval END_2!=cat robustness_3_jobs_p2 | wc -l)
216         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
217         $(eval END_3!=cat robustness_3_jobs_p3 | wc -l)
218         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
219
220         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p1;)
221         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p2;)
222         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p3;)
223
224 robustness_3.RDS: plot_example.R robustness_3.feather 
225         rm -f $@
226         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_3" --remember-file $@
227
228 robustness_3_dv_jobs_p1: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
229         rm -f $@
230         ${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 $@
231
232
233
234 robustness_3_dv_jobs_p2: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
235         rm -f $@
236         ${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 $@
237
238
239 robustness_3_dv_jobs_p3: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
240         rm -f $@
241         ${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 $@
242
243 robustness_3_dv.feather: robustness_3_dv_jobs_p1 robustness_3_dv_jobs_p2 robustness_3_dv_jobs_p3
244         $(eval END_1!=cat robustness_3_dv_jobs_p1 | wc -l)
245         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
246         $(eval END_2!=cat robustness_3_dv_jobs_p2 | wc -l)
247         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
248         $(eval END_3!=cat robustness_3_dv_jobs_p3 | wc -l)
249         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
250
251         $(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;)
252         $(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;)
253          $(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;)
254
255
256 robustness_3_dv.RDS: plot_dv_example.R robustness_3_dv.feather 
257         rm -f $@
258         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_3_dv" --remember-file $@
259
260
261 robustness_4_jobs_p1: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
262         rm -f $@
263         ${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 $@
264
265 robustness_4_jobs_p2: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
266         rm -f $@
267         ${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 $@
268
269 robustness_4_jobs_p3: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
270         rm -f $@
271         ${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 $@
272
273 robustness_4_jobs_p4: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
274         rm -f $@
275         ${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 $@
276
277 robustness_4.feather: robustness_4_jobs_p1 robustness_4_jobs_p2 robustness_4_jobs_p3
278         $(eval END_1!=cat robustness_4_jobs_p1 | wc -l)
279         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
280         $(eval END_2!=cat robustness_4_jobs_p2 | wc -l)
281         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
282         $(eval END_3!=cat robustness_4_jobs_p3 | wc -l)
283         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
284
285         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p1;)
286         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p2;)
287         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p3;)
288
289 robustness_4.RDS: plot_example.R robustness_4.feather 
290         rm -f $@
291         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_4" --remember-file $@
292
293
294 # '{"N":${Ns},"Bxy":[0.7],"Bzy":[-0.7],"m":${ms}, "seed":${seeds}, "outfile":["example_4.feather"], "z_bias":[0.5]}' --outfile example_4_jobs
295
296 robustness_4_dv_jobs_p1: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
297         rm -f $@
298         ${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 $@
299
300 robustness_4_dv_jobs_p2: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
301         rm -f $@
302         ${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 $@
303
304 robustness_4_dv_jobs_p3: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
305         rm -f $@
306         ${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 $@
307
308 robustness_4_dv_jobs_p4: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
309         rm -f $@
310         ${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 $@
311
312 robustness_4_dv.feather: robustness_4_dv_jobs_p1 robustness_4_dv_jobs_p2 robustness_4_dv_jobs_p3
313         $(eval END_1!=cat robustness_4_dv_jobs_p1 | wc -l)
314         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
315         $(eval END_2!=cat robustness_4_dv_p2 | wc -l)
316         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
317         $(eval END_3!=cat robustness_4_dv_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_dv_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_dv_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_dv_jobs_p3;)
323
324
325 robustness_4_dv.RDS: plot_dv_example.R robustness_4_dv.feather 
326         rm -f $@
327         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_4" --remember-file $@
328
329
330
331 clean_main:
332         rm -f remembr.RDS
333         rm -f example_1_jobs
334         rm -f example_2_jobs
335         rm -f example_3_jobs
336         rm -f example_4_jobs
337         rm -f example_1.feather
338         rm -f example_2.feather
339         rm -f example_3.feather
340         rm -f example_4.feather
341
342
343 #       
344 clean_all:
345         rm *.feather
346         rm -f remembr.RDS
347         rm -f remembr*.RDS
348         rm -f robustness*.RDS
349         rm -f example_*_jobs
350         rm -f robustness_*_jobs_*
351 #       sbatch --wait --verbose --array=3001-6001 run_simulation.sbatch 0 example_2_B_jobs
352
353 # example_2_B_mecor_jobs:
354 #       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
355
356 # example_2_B_mecor.feather:example_2_B_mecor.R example_2_B_mecor_jobs
357 #       rm -f example_2_B_mecor.feather
358 #       sbatch --wait --verbose --array=1-3000 run_simulation.sbatch 0 example_2_B_mecor_jobs
359 #       sbatch --wait --verbose --array=3001-6001 run_simulation.sbatch 0 example_2_B_mecor_jobs
360
361
362
363 .PHONY: supplement

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