]> code.communitydata.science - ml_measurement_error_public.git/blob - simulations/Makefile
update simulation base from hyak
[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_3_proflik.RDS robustness_3_dv_proflik.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)
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],"Bzx":[1],"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],"Bzx":[1], "m":${ms}, "seed":${seeds}, "outfile":["example_4.feather"], "z_bias":[-0.5], "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-3001 run_simulation.sbatch 0 example_4_jobs
76         sbatch --wait --verbose --array=2001-3000  run_simulation.sbatch 0 example_4_jobs
77         sbatch --wait --verbose --array=3001-4000  run_simulation.sbatch 0 example_4_jobs
78         sbatch --wait --verbose --array=4001-$(shell cat example_4_jobs | wc -l)  run_simulation.sbatch 0 example_4_jobs
79
80
81
82 remembr.RDS:example_1.feather example_2.feather example_3.feather example_4.feather plot_example.R plot_dv_example.R summarize_estimator.R
83         rm -f remembr.RDS
84         ${srun} Rscript plot_example.R --infile example_1.feather --name "plot.df.example.1"
85         ${srun} Rscript plot_example.R --infile example_2.feather --name "plot.df.example.2"
86         ${srun} Rscript plot_dv_example.R --infile example_3.feather --name "plot.df.example.3"
87         ${srun} Rscript plot_dv_example.R --infile example_4.feather --name "plot.df.example.4"
88
89
90 START=0
91 STEP=1000
92 ONE=1
93
94 robustness_Ns=[1000,5000]
95 robustness_robustness_ms=[100,200]
96
97 #in robustness 1 / example 2 misclassification is correlated with Y.
98 robustness_1_jobs_p1: 02_indep_differential.R simulation_base.R grid_sweep.py
99         sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript 02_indep_differential.R" --arg_dict '{"N":[1000],"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_1.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3,0],"Bxy":[0.3],"Bzx":[1,0], "outcome_formula":["y~x+z"], "z_bias":[0, 0.5], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~1"]}' --outfile robustness_1_jobs_p1
100
101 robustness_1_jobs_p2: 02_indep_differential.R simulation_base.R grid_sweep.py
102         sbatch --wait --verbose run_job.sbatch grid_sweep.py --command "Rscript 02_indep_differential.R" --arg_dict '{"N":[5000],"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_1.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3,0],"Bxy":[0.3],"Bzx":[1,0], "outcome_formula":["y~x+z"], "z_bias":[0, 0.5], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~1"]}' --outfile robustness_1_jobs_p2
103
104 robustness_1.feather: robustness_1_jobs_p1 robustness_1_jobs_p2
105         rm -f $@
106         $(eval END_1!=cat robustness_1_jobs_p1 | wc -l)
107         $(eval ITEROBUSTNESS_MS_1!=seq $(START) $(STEP) $(END_1))
108         $(eval END_2!=cat robustness_1_jobs_p2 | wc -l)
109         $(eval ITEROBUSTNESS_MS_2!=seq $(START) $(STEP) $(END_2))
110
111         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_1_jobs_p1;)
112         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_1_jobs_p2;)
113
114 robustness_1.RDS: robustness_1.feather summarize_estimator.R
115         rm -f robustness_1.RDS
116         ${srun} Rscript plot_example.R --infile $< --name "robustness_1" --remember-file $@
117
118 # when Bzy is 0 and zbias is not zero, we have the case where P(W|Y,X,Z) has an omitted variable that is conditionanlly independent from Y.  Note that X and Z are independent in this scenario.
119 robustness_1_dv_jobs_p1: simulation_base.R 04_depvar_differential.R grid_sweep.py
120         ${srun} grid_sweep.py --command 'Rscript 04_depvar_differential.R' --arg_dict '{"N":[1000],"Bzx":[1], "Bxy":[0.7,0],"Bzy":[-0.7,0],"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_1_dv.feather"], "proxy_formula":["w_pred~y"],"z_bias":[-0.5]}' --outfile robustness_1_dv_jobs_p1
121
122 robustness_1_dv_jobs_p2: simulation_base.R 04_depvar_differential.R grid_sweep.py
123         ${srun} grid_sweep.py --command 'Rscript 04_depvar_differential.R' --arg_dict '{"N":[5000],"Bzx":[1], "Bxy":[0.7,0],"Bzy":[-0.7,0],"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_1_dv.feather"], "proxy_formula":["w_pred~y"],"z_bias":[-0.5]}' --outfile robustness_1_dv_jobs_p2
124
125 robustness_1_dv.feather: robustness_1_dv_jobs_p1 robustness_1_dv_jobs_p2
126         rm -f $@
127         $(eval END_1!=cat robustness_1_dv_jobs_p1 | wc -l)
128         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
129         $(eval END_2!=cat robustness_1_dv_jobs_p2 | wc -l)
130         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_1))
131         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_1_dv_jobs_p1;)
132         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_1_dv_jobs_p2;)
133
134 robustness_1_dv.RDS: robustness_1_dv.feather summarize_estimator.R
135         rm -f $@
136         ${srun} Rscript plot_dv_example.R --infile $< --name "robustness_1_dv" --remember-file $@
137
138
139 robustness_2_jobs_p1: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
140         rm -f $@
141         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_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+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.60,0.65]}' --outfile $@
142
143 robustness_2_jobs_p2: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
144         rm -f $@
145         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_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+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.70,0.75]}' --outfile $@
146
147 robustness_2_jobs_p3: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
148         rm -f $@
149         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_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+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.80,0.85]}' --outfile $@
150
151 robustness_2_jobs_p4: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
152         rm -f $@
153         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_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+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.90,0.95]}' --outfile $@
154
155 robustness_2.feather: robustness_2_jobs_p1 robustness_2_jobs_p2 robustness_2_jobs_p3 robustness_2_jobs_p4
156         rm $@
157         $(eval END_1!=cat robustness_2_jobs_p1 | wc -l)
158         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
159         $(eval END_2!=cat robustness_2_jobs_p2 | wc -l)
160         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
161         $(eval END_3!=cat robustness_2_jobs_p3 | wc -l)
162         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
163         $(eval END_4!=cat robustness_2_jobs_p4 | wc -l)
164         $(eval ITEMS_4!=seq $(START) $(STEP) $(END_4))
165
166         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p1;)
167         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p2;)
168         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p3;)
169         $(foreach item,$(ITEMS_4),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_2_jobs_p4;)
170
171 robustness_2.RDS: plot_example.R robustness_2.feather summarize_estimator.R
172         rm -f $@
173         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_2" --remember-file $@
174
175 robustness_2_dv_jobs_p1: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
176         rm -f $@
177         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_2_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.60,0.65]}' --outfile $@
178
179 robustness_2_dv_jobs_p2: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
180         rm -f $@
181         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_2_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.70,0.75]}' --outfile $@
182
183 robustness_2_dv_jobs_p3: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
184         rm -f $@
185         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_2_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.80,0.85]}' --outfile $@
186
187 robustness_2_dv_jobs_p4: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
188         rm -f $@
189         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_2_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.90,0.95]}' --outfile $@
190
191 robustness_2_dv.feather: robustness_2_dv_jobs_p1 robustness_2_dv_jobs_p2 robustness_2_dv_jobs_p3 robustness_2_dv_jobs_p4
192         rm -f $@
193         $(eval END_1!=cat robustness_2_dv_jobs_p1 | wc -l)
194         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
195         $(eval END_2!=cat robustness_2_dv_jobs_p2 | wc -l)
196         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
197         $(eval END_3!=cat robustness_2_dv_jobs_p3 | wc -l)
198         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
199         $(eval END_4!=cat robustness_2_dv_jobs_p4 | wc -l)
200         $(eval ITEMS_4!=seq $(START) $(STEP) $(END_4))
201
202         $(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;)
203         $(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;)
204         $(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;)
205         $(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;)
206
207 robustness_2_dv.RDS: plot_dv_example.R robustness_2_dv.feather summarize_estimator.R
208         rm -f $@
209         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_2_dv" --remember-file $@
210
211
212 robustness_3_proflik_jobs: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
213         rm -f $@
214         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":[1000],"m":[100], "seed":${seeds}, "outfile":["robustness_3_proflik.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1],"Px":[0.5,0.6,0.7,0.8,0.9,0.95], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85], "confint_method":['spline']}' --outfile $@
215
216 robustness_3_proflik.feather: robustness_3_proflik_jobs
217         rm -f $@
218         $(eval END_1!=cat robustness_3_proflik_jobs | wc -l)
219         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
220         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_proflik_jobs;)
221
222 robustness_3_proflik.RDS: plot_example.R robustness_3_proflik.feather summarize_estimator.R
223         rm -f $@
224         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_3_proflik" --remember-file $@
225
226
227 robustness_3_jobs_p1: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
228         rm -f $@
229         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_3.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1],"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 $@
230
231 robustness_3_jobs_p2: grid_sweep.py 01_two_covariates.R simulation_base.R grid_sweep.py
232         rm -f $@
233         ${srun} $< --command 'Rscript 01_two_covariates.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_3.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1],"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 $@
234
235 robustness_3_jobs_p3: 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":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_3.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1],"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 $@
238
239 robustness_3.feather: robustness_3_jobs_p1 robustness_3_jobs_p2 robustness_3_jobs_p3
240         rm -f $@
241         $(eval END_1!=cat robustness_3_jobs_p1 | wc -l)
242         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
243         $(eval END_2!=cat robustness_3_jobs_p2 | wc -l)
244         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
245         $(eval END_3!=cat robustness_3_jobs_p3 | wc -l)
246         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
247
248         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p1;)
249         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p2;)
250         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_jobs_p3;)
251
252 robustness_3.RDS: plot_example.R robustness_3.feather summarize_estimator.R
253         rm -f $@
254         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_3" --remember-file $@
255
256 robustness_3_dv_proflik_jobs: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
257         rm -f $@
258         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":[1000],"m":[100], "seed":${seeds}, "outfile":["robustness_3_dv_proflik.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1],"B0":[0,0.405,0.846,1.386,2.197,2.944], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"confint_method":['spline']}' --outfile $@
259
260 robustness_3_dv_proflik.feather: robustness_3_dv_proflik_jobs
261         rm -f $@
262         $(eval END_1!=cat robustness_3_dv_proflik_jobs | wc -l)
263         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
264         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_3_dv_proflik_jobs;)
265
266 robustness_3_dv_proflik.RDS: plot_dv_example.R robustness_3_dv_proflik.feather summarize_estimator.R
267         rm -f $@
268         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_3_dv_proflik" --remember-file $@
269
270
271  robustness_3_dv_jobs_p1: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
272         rm -f $@
273         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_3_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1],"B0":[0,0.405], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85]}' --outfile $@
274
275
276
277 robustness_3_dv_jobs_p2: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
278         rm -f $@
279         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_3_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1],"B0":[0.847,1.386], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85]}' --outfile $@
280
281
282 robustness_3_dv_jobs_p3: grid_sweep.py 03_depvar.R simulation_base.R grid_sweep.py
283         rm -f $@
284         ${srun} $< --command 'Rscript 03_depvar.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_3_dv.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "B0":[2.197,2.944], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85]}' --outfile $@
285
286 robustness_3_dv.feather: robustness_3_dv_jobs_p1 robustness_3_dv_jobs_p2 robustness_3_dv_jobs_p3
287         rm -f $@
288         $(eval END_1!=cat robustness_3_dv_jobs_p1 | wc -l)
289         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
290         $(eval END_2!=cat robustness_3_dv_jobs_p2 | wc -l)
291         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
292         $(eval END_3!=cat robustness_3_dv_jobs_p3 | wc -l)
293         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
294
295         $(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;)
296         $(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;)
297          $(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;)
298
299
300 robustness_3_dv.RDS: plot_dv_example.R robustness_3_dv.feather summarize_estimator.R
301         rm -f $@
302         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_3_dv" --remember-file $@
303
304
305
306 robustness_4_jobs_p1: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
307         rm -f $@
308         ${srun} $< --command 'Rscript 02_indep_differential.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_4.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85],"y_bias":[-2.944,-2.197]}' --outfile $@
309
310 robustness_4_jobs_p2: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
311         rm -f $@
312         ${srun} $< --command 'Rscript 02_indep_differential.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_4.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85], "y_bias":[-1.386,-0.846]}' --outfile $@
313
314 robustness_4_jobs_p3: grid_sweep.py 02_indep_differential.R simulation_base.R grid_sweep.py
315         rm -f $@
316         ${srun} $< --command 'Rscript 02_indep_differential.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_4.feather"],"y_explained_variance":${explained_variances},  "Bzy":[-0.3],"Bxy":[0.3],"Bzx":[1], "outcome_formula":["y~x+z"], "proxy_formula":["w_pred~y+x"], "truth_formula":["x~z"], "prediction_accuracy":[0.85],"y_bias":[-0.405,-0.25]}' --outfile $@
317
318 robustness_4.feather: robustness_4_jobs_p1 robustness_4_jobs_p2 robustness_4_jobs_p3
319         rm -f $@
320         $(eval END_1!=cat robustness_4_jobs_p1 | wc -l)
321         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
322         $(eval END_2!=cat robustness_4_jobs_p2 | wc -l)
323         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
324         $(eval END_3!=cat robustness_4_jobs_p3 | wc -l)
325         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
326
327         $(foreach item,$(ITEMS_1),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p1;)
328         $(foreach item,$(ITEMS_2),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p2;)
329         $(foreach item,$(ITEMS_3),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_jobs_p3;)
330
331 robustness_4.RDS: plot_example.R robustness_4.feather summarize_estimator.R
332         rm -f $@
333         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_4" --remember-file $@
334
335
336 # '{"N":${robustness_Ns},"Bxy":[0.7],"Bzy":[-0.7],"m":${ms}, "seed":${seeds}, "outfile":["example_4.feather"], "z_bias":[0.5]}' --example_4_jobs
337
338 robustness_4_dv_jobs_p1: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
339         rm -f $@
340         ${srun} $< --command 'Rscript 04_depvar_differential.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_4_dv.feather"], "Bzy":[-0.7],"Bxy":[0.7],"Bzx":[1], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"z_bias":[0,0.1]}' --outfile $@
341
342 robustness_4_dv_jobs_p2: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
343         rm -f $@
344         ${srun} $< --command 'Rscript 04_depvar_differential.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_4_dv.feather"], "Bzy":[-0.7],"Bxy":[0.7],"Bzx":[1], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"z_bias":[0.25,0.405]}' --outfile $@
345
346 robustness_4_dv_jobs_p3: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
347         rm -f $@
348         ${srun} $< --command 'Rscript 04_depvar_differential.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_4_dv.feather"], "Bzy":[-0.7],"Bxy":[0.7],"Bzx":[1],"outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"z_bias":[0.846,1.386]}' --outfile $@
349
350 robustness_4_dv_jobs_p4: grid_sweep.py 04_depvar_differential.R simulation_base.R grid_sweep.py
351         rm -f $@
352         ${srun} $< --command 'Rscript 04_depvar_differential.R'  --arg_dict '{"N":${robustness_Ns},"m":${robustness_ms}, "seed":${seeds}, "outfile":["robustness_4_dv.feather"],"Bzy":[-0.7],"Bxy":[0.7],"Bzx":[1], "outcome_formula":["y~x+z"], "prediction_accuracy":[0.85],"z_bias":[2.197,2.944]}' --outfile $@
353
354 robustness_4_dv.feather: robustness_4_dv_jobs_p1 robustness_4_dv_jobs_p2 robustness_4_dv_jobs_p3 robustness_4_dv_jobs_p4
355         rm -f $@
356         $(eval END_1!=cat robustness_4_dv_jobs_p1 | wc -l)
357         $(eval ITEMS_1!=seq $(START) $(STEP) $(END_1))
358         $(eval END_2!=cat robustness_4_dv_p2 | wc -l)
359         $(eval ITEMS_2!=seq $(START) $(STEP) $(END_2))
360         $(eval END_3!=cat robustness_4_dv_p3 | wc -l)
361         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
362         $(eval END_3!=cat robustness_4_dv_p4 | wc -l)
363         $(eval ITEMS_3!=seq $(START) $(STEP) $(END_3))
364
365
366         $(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;)
367         $(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;)
368         $(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;)
369         $(foreach item,$(ITEMS_4),sbatch --wait --verbose --array=$(shell expr $(item) + $(ONE))-$(shell expr $(item) + $(STEP)) run_simulation.sbatch 0 robustness_4_dv_jobs_p4;)
370
371
372 robustness_4_dv.RDS: plot_dv_example.R robustness_4_dv.feather summarize_estimator.R
373         rm -f $@
374         ${srun} Rscript $< --infile $(word 2, $^) --name "robustness_4" --remember-file $@
375
376
377 clean_main:
378         rm -f remembr.RDS
379         rm -f example_1_jobs
380         rm -f example_2_jobs
381         rm -f example_3_jobs
382         rm -f example_4_jobs
383         rm -f example_1.feather
384         rm -f example_2.feather
385         rm -f example_3.feather
386         rm -f example_4.feather
387
388
389 #       
390 clean_all:
391         rm *.feather
392         rm -f remembr.RDS
393         rm -f remembr*.RDS
394         rm -f robustness*.RDS
395         rm -f example_*_jobs
396         rm -f robustness_*_jobs_*
397 #       sbatch --wait --verbose --array=3001-6001 run_simulation.sbatch 0 example_2_B_jobs
398
399 # example_2_B_mecor_jobs:
400 #       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
401
402 # example_2_B_mecor.feather:example_2_B_mecor.R example_2_B_mecor_jobs
403 #       rm -f example_2_B_mecor.feather
404 #       sbatch --wait --verbose --array=1-3000 run_simulation.sbatch 0 example_2_B_mecor_jobs
405 #       sbatch --wait --verbose --array=3001-6001 run_simulation.sbatch 0 example_2_B_mecor_jobs
406
407
408 .PHONY: supplement

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