- All functions and modules are in this repository, and the required packages are in
requirements.txt. Use the following command to install them:pip3 install -r requirements.txt
- The scripts for reproducing the experiments are in the
scriptsfolder. There are five scripts:sig_berkson.pyandsig_classical.pyrun the synthetic experiments for Berkson and classical ME, respectively.sig_berkson.pyandsig_classical.pyrun the synthetic experiments for Berkson and classical ME, respectively (Fig. 3).CAS.pyruns the Californian school data experiment (Fig. 4 and Table 3). TheCASschools.csvfile is constructed from the California Test Score Data in theAERR packageEngel_reliability.pyruns the Engel curve analysis for a range of rho values (Fig. 5), andEngel_variance.pyinvestigates the variance of each method through subsampling (Tables 4-5).- To run the scripts, use the following command format:
python3 scripts/sig_berkson.py
- The results will be saved in the
data_from_scriptsfolder.
- A few notebooks are included:
Synthetic_data_demo.ipynbproduces demonstrations for synthetic data for Berkson and classical ME under the sigmoid model (Fig. 2).HMC_diagnostics_Berkson.ipynbandHMC_diagnostics_classical.ipynbproduce HMC diagnostics for Berkson and classical ME, respectively (Fig. 6, Fig. 7 and Table 6).sensitivity_analysis.ipynbruns the sensitivity analysis (Tables 7-8).
- I added a testing section to check that all NPL methods run correctly in 1 iteration. Add
-tor--testafter the running command to test. For example:python3 scripts/sig_berkson.py -t
These arguments are all optional.
- Enable testing mode:
-tor--test. It is a store_true argument. - Experiment name:
-eor--experiment_name. Default =''. E.g.-e reproduce_experiment - Below are arguments Only for
sig_berkson.pyandsig_classical.py:- Main comparison goal:
-mor--main_comparison_goal. Default ='method'. E.g.-m prior_coef - Splitting parameters:
-sor--splitting_params. Default =['None', 'None', 'None']. E.g.-s ME cr cl - Include NLS in the plot:
-nor--include_nls. It is a store_true argument.
- Main comparison goal:
Below is a list of commands to run all scripts. You need to define experiment_name (string) and testing_flag (-t or --test if testing, nothing otherwise).
python3 scripts/sig_berkson.py -e "$experiment_name" -m method -n -s None None None $testing_flag
python3 scripts/sig_classical.py -e "$experiment_name" -m method -n -s None None None $testing_flag
python3 scripts/CAS.py -e "$experiment_name" $testing_flag
python3 scripts/Engel_reliability.py -e "$experiment_name" $testing_flag
python3 scripts/Engel_variance.py -e "$experiment_name" $testing_flag