-
Notifications
You must be signed in to change notification settings - Fork 3
/
config_logistic.py_example
42 lines (41 loc) · 1.49 KB
/
config_logistic.py_example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import numpy as np
import logistic_te
from mcpy import metrics
from mcpy import plotting
CONFIG = {
"dgps": {
"dgp1": logistic_te.gen_data
},
"dgp_opts": {
'n_samples': 5000, # samples used for estimation
'dim_x': 2000, # dimension of controls x
'dim_z': 2000, # dimension of variables used for heterogeneity (subset of x)
'kappa_theta': 2, # support size of target parameter
'kappa_x': 5, # support of nuisance parameter
'sigma_eta': 3, # variance of error in secondary moment equation
'sigma_x': .5 # variance parameter for co-variate distribution
},
"methods": {
"Direct": logistic_te.direct_fit,
"Ortho": logistic_te.dml_crossfit
},
"method_opts": {
'lambda_coef': .5, # coeficient in front of the asymptotic rate for regularization lambda
'n_folds': 2 # number of folds used in cross-fitting
},
"metrics": {
"$\\ell_2$ error": metrics.l2_error,
"$\\ell_1$ error": metrics.l1_error
},
"plots": {
"metrics": plotting.plot_metrics,
"metric_comparisons": plotting.plot_metric_comparisons
},
"mc_opts": {
'n_experiments': 100, # number of monte carlo experiments
"seed": 123
},
"proposed_method": "Ortho",
"target_dir": "results_logistic",
"reload_results": False
}