Skip to content

Commit

Permalink
Minor updates to scripts README and outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaMorin committed Aug 18, 2023
1 parent 249e1cd commit 777bf89
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python3 run_bakk_simulation.py -s 500 -c
# Complete simulation
python3 run_bakk_simulation_complete.py -s 500
```
All three commands should output the simulation tables from the paper. You can ignore the UserWarnings.
All three commands should output the simulation tables from the paper. You can ignore ConvergenceWarnings and UserWarnings.


Real-Data Example
Expand All @@ -39,4 +39,4 @@ First [download the dataset](https://drive.google.com/file/d/1vdSzzBe7tPxfQ_X-hU
python3 run_real_example.py --n_repetitions 100 --max_iter 10000
```

Running the above may take a while. You can the lower the number of bootstrap repetitions for faster results.
Running the above may take a while (15 minutes on a Macbook Pro M2 Pro). You can lower the number of bootstrap repetitions for faster results.
1 change: 1 addition & 0 deletions scripts/run_bakk_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def main(n_simulations=10, latex=False, covariate=False):
n_init=1,
max_iter=250, # Latent Gold default : 250 EM iterations + 50 NR iterations
abs_tol=1e-8, # Latent Gold default : 1e-8
progress_bar=0,
)

# Model-specific arguments
Expand Down
1 change: 1 addition & 0 deletions scripts/run_bakk_simulation_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def main(n_simulations=10, latex=False, covariate=False):
n_init=1,
max_iter=500,
abs_tol=1e-8,
progress_bar=0,
)

# Model specific arguments
Expand Down
4 changes: 2 additions & 2 deletions scripts/run_real_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ def fit_and_bootstrap(n_steps, correction, permutation, method_str):
stats["Z"] = stats["mean"] / stats["std"]

# P-value
stats["P(<|t|)"] = 2 * norm.cdf(-np.abs(stats["Z"]))
stats["P(>|z|)"] = 2 * norm.cdf(-np.abs(stats["Z"]))

stats[["mean", "std", "Z"]] = stats[["mean", "std", "Z"]].round(2)
stats["P(<|t|)"] = stats["P(<|t|)"].round(3)
stats["P(>|z|)"] = stats["P(>|z|)"].round(3)
print("\nTable 10 : Family’s income differences between classes for each method.")
print(stats)

Expand Down

0 comments on commit 777bf89

Please sign in to comment.