Skip to content

Commit 336eaa1

Browse files
authored
Merge pull request #60 from NREL/cal_tut_cal_sigma
Calibration of likelihood uncertainty
2 parents 4a11840 + 94bc746 commit 336eaa1

27 files changed

Lines changed: 137 additions & 42 deletions

papers/tutorial/calibration/README.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,44 +37,64 @@ The following plots should be generated. The first one shows the training and te
3737
</p>
3838

3939

40-
## Calibration
40+
## Calibration with optimized likelihood uncertainty
4141

4242
For the calibration, we can use the true function or the surrogate model. The objective PDF is assumed to be noiseless. Even though the observation is noiseless, an uncertainty is computed to account for the missing physics.
43+
The likelihood uncertainty that represents the missing physics is optimized to ensure an uncertainty band overlap
4344

44-
Calibrate without a surrogate for `alpha=5, beta=5`: `python tut_calibration_all.py --alpha 5 --beta 5`
45+
Calibrate without a surrogate for `alpha=5, beta=5`: `python tut_calibration.py --alpha 5 --beta 5` (Left two plots)
46+
47+
Calibrate with a surrogate for `alpha=5, beta=5`: `python tut_calibration.py -useNN --alpha 5 --beta 5` (Right two plots)
4548

4649
<p align="center">
47-
<img src="/papers/tutorial/calibration/assets/True_a_5_b_5_prop.png" width="225" height="187.5"/>
48-
<img src="/papers/tutorial/calibration/assets/True_a_5_b_5_corner.png" width="225" height="187.5"/>
50+
<img src="/papers/tutorial/calibration/assets/True_opt_5.0_5.0_prop.png" width="225" height="187.5"/>
51+
<img src="/papers/tutorial/calibration/assets/True_opt_5.0_5.0_corner.png" width="225" height="187.5"/>
52+
<img src="/papers/tutorial/calibration/assets/Surr_opt_5.0_5.0_prop.png" width="225" height="187.5"/>
53+
<img src="/papers/tutorial/calibration/assets/Surr_opt_5.0_5.0_corner.png" width="225" height="187.5"/>
4954
</p>
5055

5156

52-
Calibrate without a surrogate for `alpha=2, beta=5`: `python tut_calibration_all.py --alpha 2 --beta 5`
57+
Calibrate without a surrogate for `alpha=2, beta=5`: `python tut_calibration.py --alpha 2 --beta 5` (Left two plots)
58+
59+
Calibrate with a surrogate for `alpha=2, beta=5`: `python tut_calibration.py -useNN --alpha 2 --beta 5` (Right two plots)
5360

5461

5562
<p align="center">
56-
<img src="/papers/tutorial/calibration/assets/True_a_2_b_5_prop.png" width="225" height="187.5"/>
57-
<img src="/papers/tutorial/calibration/assets/True_a_2_b_5_corner.png" width="225" height="187.5"/>
63+
<img src="/papers/tutorial/calibration/assets/True_opt_2.0_5.0_prop.png" width="225" height="187.5"/>
64+
<img src="/papers/tutorial/calibration/assets/True_opt_2.0_5.0_corner.png" width="225" height="187.5"/>
65+
<img src="/papers/tutorial/calibration/assets/Surr_opt_2.0_5.0_prop.png" width="225" height="187.5"/>
66+
<img src="/papers/tutorial/calibration/assets/Surr_opt_2.0_5.0_corner.png" width="225" height="187.5"/>
5867
</p>
5968

6069
Clearly, the amount of missing physics vary depending on the observations.
6170

62-
Then the same exercise can be done when using a neural net surrogate. Note that this step will not run if the `Building the surrogate` step was not done first
71+
Using surrogate gives similar predictions as when not using a surrogate. But the surrogate was constructed with 200 forward simulations.
72+
73+
## Calibration with calibrated likelihood uncertainty
6374

64-
Calibrate with a surrogate for `alpha=5, beta=5`: `python tut_calibration_all.py --useNN --alpha 5 --beta 5`
75+
The same suite can be done by calibrating the likelihood uncertainty in lieu of optimizing it (with a bissection search). This has the advantage of rapid calibration since only one calibration is needed. Here the uncertainty minimizes the negative log likelihood.
76+
77+
Calibrate without a surrogate for `alpha=5, beta=5`: `python tut_calibration.py -cal_err --alpha 5 --beta 5` (Left two plots)
78+
79+
Calibrate with a surrogate for `alpha=5, beta=5`: `python tut_calibration.py -useNN -cal_err --alpha 5 --beta 5` (Right two plots)
6580

6681
<p align="center">
67-
<img src="/papers/tutorial/calibration/assets/Surr_a_5_b_5_prop.png" width="225" height="187.5"/>
68-
<img src="/papers/tutorial/calibration/assets/Surr_a_5_b_5_corner.png" width="225" height="187.5"/>
82+
<img src="/papers/tutorial/calibration/assets/True_cal_5.0_5.0_prop.png" width="225" height="187.5"/>
83+
<img src="/papers/tutorial/calibration/assets/True_cal_5.0_5.0_corner.png" width="225" height="187.5"/>
84+
<img src="/papers/tutorial/calibration/assets/Surr_cal_5.0_5.0_prop.png" width="225" height="187.5"/>
85+
<img src="/papers/tutorial/calibration/assets/Surr_cal_5.0_5.0_corner.png" width="225" height="187.5"/>
6986
</p>
7087

7188

72-
Calibrate with a surrogate for `alpha=2, beta=5`: `python tut_calibration_all.py --useNN --alpha 2 --beta 5`
89+
Calibrate without a surrogate for `alpha=2, beta=5`: `python tut_calibration.py -cal_err --alpha 2 --beta 5` (Left two plots)
90+
91+
Calibrate with a surrogate for `alpha=2, beta=5`: `python tut_calibration.py -useNN -cal_err --alpha 2 --beta 5` (Right two plots)
7392

7493

7594
<p align="center">
76-
<img src="/papers/tutorial/calibration/assets/Surr_a_2_b_5_prop.png" width="225" height="187.5"/>
77-
<img src="/papers/tutorial/calibration/assets/Surr_a_2_b_5_corner.png" width="225" height="187.5"/>
95+
<img src="/papers/tutorial/calibration/assets/True_cal_2.0_5.0_prop.png" width="225" height="187.5"/>
96+
<img src="/papers/tutorial/calibration/assets/True_cal_2.0_5.0_corner.png" width="225" height="187.5"/>
97+
<img src="/papers/tutorial/calibration/assets/Surr_cal_2.0_5.0_prop.png" width="225" height="187.5"/>
98+
<img src="/papers/tutorial/calibration/assets/Surr_cal_2.0_5.0_corner.png" width="225" height="187.5"/>
7899
</p>
79100

80-
Using surrogate gives similar predictions as when not using a surrogate. But the surrogate was constructed with 200 forward simulations.
-16.6 KB
Binary file not shown.
-52.7 KB
Binary file not shown.
-15.9 KB
Binary file not shown.
-49.1 KB
Binary file not shown.
19.5 KB
Loading
52.8 KB
Loading
18.2 KB
Loading
48 KB
Loading
10.6 KB
Loading

0 commit comments

Comments
 (0)