Skip to content

Commit 1db4469

Browse files
committed
addressing reviews: applying suggestion about variable name change and mentioning in docs that the history matching done here is a single run but not performed in waves
1 parent 3bfcaf8 commit 1db4469

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

autoemulate/history_matching.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
import numpy as np
22

33

4-
def history_matching(obs, expectations, threshold=3.0, discrepancy=0.0, rank=1):
4+
def history_matching(obs, predictions, threshold=3.0, discrepancy=0.0, rank=1):
55
"""
66
Perform history matching to compute implausibility and identify NROY and RO points.
7-
7+
This implementation performs history matching as a single run, completing the process
8+
in one execution without iterative refinement or staged waves.
9+
10+
The implausibility is calculated as the absolute difference between the observed and
11+
predicted values, normalized by the square root of the sum of the variances of the
12+
observed and predicted values. The implausibility is then compared to a threshold to
13+
classify the points as NROY or RO. The discrepancy value(s) can be provided as a
14+
scalar or an array to account for model discrepancy.
15+
The rank parameter is used to select the number of observations to consider for implausibility calculation.
16+
The default value is 1, which corresponds to the most recent observation.
817
Parameters:
918
obs (tuple): Observations as (mean, variance).
10-
expectations (tuple): Predicted (mean, variance).
19+
predictions (tuple): Predicted (mean, variance).
1120
threshold (float): Implausibility threshold for NROY classification.
1221
discrepancy (float or ndarray): Discrepancy value(s).
1322
rank (int): Rank for implausibility calculation.
@@ -16,7 +25,7 @@ def history_matching(obs, expectations, threshold=3.0, discrepancy=0.0, rank=1):
1625
dict: Contains implausibility (I), NROY indices, and RO indices.
1726
"""
1827
obs_mean, obs_var = np.atleast_1d(obs[0]), np.atleast_1d(obs[1])
19-
pred_mean, pred_var = np.atleast_1d(expectations[0]), np.atleast_1d(expectations[1])
28+
pred_mean, pred_var = np.atleast_1d(predictions[0]), np.atleast_1d(predictions[1])
2029

2130
discrepancy = np.atleast_1d(discrepancy)
2231
n_obs = len(obs_mean)

0 commit comments

Comments
 (0)