API Reference

Calibration API

Calibration API

UQPyL.calibration

calibration 模块通过比较仿真和观测来估计模型参数。所有校准方法都使用 ModelProblem

导入

python
from UQPyL.calibration import GLUE, SUFI2, ES, IES, CalReader

公共对象

对象作用
GLUEGeneralized Likelihood Uncertainty Estimation。
SUFI2Sequential Uncertainty Fitting。
ESEnsemble Smoother。
IESIterative Ensemble Smoother。
CalResult校准结果对象。
CalHistory校准历史。
CalReader读取保存的校准 sqlite。

通用调用

text
result = method.run(modelProblem, X=None, seed=123)
参数含义
modelProblemModelProblem
X候选参数矩阵;部分方法可内部生成。
seed随机种子。

运行控制参数:

参数含义
verboseFlag打印运行摘要。
logFlag写日志。
saveFlag保存 sqlite 结果。

方法

方法关键参数主要输出
GLUEmetric, thresholdbehavioralDecs, behavioralSims
SUFI2eliteSize, nSamples, maxIterseliteDecs, updatedLb, updatedUb, pfactor, rfactor
ESensemble 参数矩阵 XposteriorDecs, posteriorSims
IESmaxIters, lamposteriorDecs, posteriorSims, history

CalResult

字段含义
method校准方法名。
bestDecs最优参数行。
bestSim最优参数对应的仿真。
behavioralDecs, behavioralSimsGLUE 接受的样本。
eliteDecs, eliteSimsSUFI2 elite samples。
posteriorDecs, posteriorSimsES/IES posterior ensemble。
diagnostics分数、mask、边界、pfactor/rfactor 等方法特定信息。
history迭代历史。
summary()摘要字典。

指标方向

指标更好方向
mse, mae, rmse, pbias越小越好
nse, r2, pearson_r, kge越大越好

GLUE 的阈值判断会依据指标方向执行。

CalReader

方法含义
list_runs(result_dir)列出校准结果。
get_run_summary()读取摘要。
get_run_params()读取参数。
load_problem()读取保存的 ModelProblem
load_result()重建 CalResult

下一步

目标阅读
用户指南Calibration
仿真问题Problem API
候选参数采样DOE API