You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+84-68Lines changed: 84 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,68 +11,83 @@ It defines problems once and reuses them across UQ workflows.
11
11
12
12
## What UQPyL solves
13
13
14
-
UQPyL targets uncertainty problems in computational modeling: how uncertain parameters affect outputs, which inputs matter most, how to calibrate models against observations, and how to search for robust or optimal decisions.
14
+
UQPyL provides a shared problem interface for common uncertainty quantification workflows.
15
15
16
-
These workflows are common across model-based domains, especially in hydrology, water resources, and water engineering.
16
+
Define the model or decision problem once, then reuse it for:
17
17
18
-
| Task | Examples | What UQPyL provides |
19
-
|---|---|---|
20
-
| Explore parameter spaces | Generate candidate hydrological parameter sets. | Design of experiment methods for reproducible sampling. |
21
-
| Understand input influence | Identify which parameters dominate flow, load, or other model outputs. | Sensitivity and uncertainty analysis methods. |
22
-
| Search for good parameters | Calibrate parameters or optimize engineering decisions. | Single-objective, multi-objective, and expensive-model optimization algorithms. |
`Problem` is the main entry point of UQPyL. It turns a model, benchmark function, or decision task into a reusable object that other modules can use.
28
34
29
-
UQPyL does not own your model logic. Instead, you wrap your model or decision problem as a shared `problem` definition with:
35
+
To build a `Problem`, define:
30
36
31
-
| Part |Meaning|
37
+
| Part |Role|
32
38
|---|---|
33
-
| Input space | Variables, bounds, labels, and variable types. |
34
-
| Evaluation rule | How a batch of inputs becomes objectives, constraints, or extract required simulation data. |
35
-
| Optimization direction | Whether each objective is minimized or maximized. |
36
-
| Runtime identity | A name and metadata used by saved runs and summaries. |
39
+
| Input space | Number of variables, bounds, labels, and variable types. |
40
+
| Evaluation rule | How input samples become objectives and optional constraints. |
41
+
| Additional information | Optimization direction, problem name, and metadata for algorithms, outputs, logs, and saved results. |
37
42
38
-
Once defined, the same object can be reused by DOE, analysis, optimization, inference, surrogate workflows, and calibration. Some workflows also need explicit model-aware information such as simulations and observations.
43
+
For example:
39
44
40
-
## Problem abstraction
45
+
```python
46
+
import numpy as np
47
+
48
+
from UQPyL.problem import Problem
41
49
42
-
The `problem` module is the conceptual entry point of UQPyL.
43
50
44
-
| Abstraction Python Class | Role |
45
-
|---|---|
46
-
|`Problem`| For methods that only need final objective or constraint values. |
47
-
|`ModelProblem`| For methods that need explicit model-process semantics such as `sim` or `obs`. |
51
+
defobjFunc(X):
52
+
X = np.atleast_2d(X)
53
+
return np.sum(X**2, axis=1, keepdims=True)
48
54
49
-
Both abstractions share the same foundation:
50
55
51
-
| Building block | Role |
52
-
|---|---|
53
-
|`Space`| Defines variables, bounds, labels, and variable types. |
54
-
|`Eval`| Standard return object for evaluated results. |
56
+
problem = Problem(
57
+
# Input space
58
+
nInput=2, lb=-1.0, ub=1.0,
59
+
60
+
# Evaluation rule
61
+
nObj=1, objFunc=objFunc,
62
+
63
+
# Additional information
64
+
optType="min", name="Sphere2D",
65
+
)
66
+
```
67
+
68
+
This is enough for workflows that only need evaluated objectives or constraints, including DOE, analysis, optimization, inference, and surrogate modeling.
55
69
56
-
The module also includes benchmark problems such as `Sphere`, `Ackley`and so on for single-objective optimization; `ZDT`, and `DTLZ` for multi-objective optimization.
70
+
For many hydrological simulation problems, the workflow needs more than final objective values. Calibration and uncertainty analysis may need the simulated and observed time series, and the valid observation mask to remain available throughout the method.
57
71
58
-
Use `Problem` when methods only need final objectives or constraints from candidate inputs. `Problem` can still be used for model-based problems when those final values are enough. Use `ModelProblem` only when methods need explicit simulations, observations or simulated-versus-observed comparison. In the current design, this mainly applies to calibration module (`IES`, `ES`, `GLUE`, `SUFI2`).
72
+
`ModelProblem` extends `Problem` for this case. It adds:
73
+
74
+
| Extra part | Role |
75
+
|---|---|
76
+
|`simFunc`| Runs the model and returns simulated series or fields. |
77
+
|`obs` / `mask`| Stores observed data and marks valid entries for simulation-observation comparison. |
78
+
79
+
Use `Problem` by default. Use `ModelProblem` when a method needs simulation-process semantics, such as calibration methods that compare `sim` with `obs`. See the [documentation](https://uqpyl.readthedocs.io) for detailed usage.
59
80
60
81
<palign="center">
61
82
<imgsrc="./docs_v2/assets/Problem.webp"alt="Problem and ModelProblem comparison"width="1000"/>
62
83
</p>
63
84
64
-
For hydrological models, the hard part is often model connection rather than the algorithm itself. For that layer, we recommend [hydroPilot](https://github.com/smasky/hydroPilot).
85
+
For hydrological applications, the hard part is often not the UQ algorithm itself, but connecting an external model, preparing inputs, running simulations, and collecting outputs. [hydroPilot](https://github.com/smasky/hydroPilot) is designed for that model-operation layer. It can be used with UQPyL when you want hydroPilot to manage hydrological model runs and UQPyL to handle sampling, analysis, calibration, optimization, inference, or surrogate modeling.
65
86
66
87
## Architecture overview
67
88
68
89
UQPyL is organized around one shared `problem` abstraction and a set of functional modules built around it.
The figure summarizes the main idea: represent a modeling task as a shared `problem` definition, then reuse that definition across DOE, analysis, optimization, inference, calibration, and surrogate workflows, with unified outputs and optional runtime storage. You can freely organize your workflows.
75
-
76
91
| Type | Module | Purpose |
77
92
|---|---|---|
78
93
| Core |`problem`| Define parameter spaces, evaluation rules, objectives, constraints, simulations, and related metadata. |
@@ -82,21 +97,9 @@ The figure summarizes the main idea: represent a modeling task as a shared `prob
82
97
| Function |`inference`| Run MCMC-style parameter inference. |
83
98
| Function |`calibration`| Calibrate simulation models against observations. |
84
99
| Function |`surrogate`| Train and evaluate surrogate models for expensive evaluations. |
100
+
| Support |`runtime`, `viz`| Save structured run results, logs, intermediate states, and provide visualization utilities. |
85
101
86
-
Visualization, runtime storage, logs, and readers are exposed through the functional modules rather than treated as primary entry points.
87
-
88
-
## Typical workflows
89
-
90
-
Common workflows patterns all lead to structured outputs and optional runtime storage.
91
-
92
-
```text
93
-
Problem -> DOE -> Analysis -> outputs
94
-
Problem -> DOE -> Analysis -> Inference -> outputs
95
-
ModelProblem -> Calibration -> outputs
96
-
Problem -> DOE -> Surrogate -> Optimization
97
-
```
98
-
99
-
## Quick start examples
102
+
## Quick start
100
103
101
104
### Optimization with `Problem`
102
105
@@ -160,17 +163,9 @@ X = np.linspace(0.5, 1.5, 32).reshape(-1, 1)
160
163
result = GLUE(metric="rmse").run(problem, X, threshold=0.2)
161
164
```
162
165
163
-
Methods return structured result objects such as `OptResult`, `AnaResult`, `InfResult`, or `CalResult`.
164
-
165
166
## Modules at a glance
166
167
167
-
| Goal | Start with |
168
-
|---|---|
169
-
| Sample a parameter space |`doe`|
170
-
| Identify influential inputs |`analysis`|
171
-
| Search for good parameters |`optimization` with `SCE_UA`|
172
-
| Fit model parameters to observations |`calibration` with `ModelProblem`|
173
-
| Build a fast approximation of an expensive model |`surrogate`|
168
+
The table lists representative methods, not the full API. See the [documentation](https://uqpyl.readthedocs.io) for complete module-specific usage and API details.
174
169
175
170
| Module | Representative methods |
176
171
|---|---|
@@ -181,8 +176,6 @@ Methods return structured result objects such as `OptResult`, `AnaResult`, `InfR
Citation information for **UQPyL 2** will be updated.
275
+
For UQPyL 2.0, please cite the preprint:
276
+
277
+
Wu, M., Sun, R., Xu, P., Yang, X., Hu, P., & Duan, Q. UQPyL 2.0: An Open-Source Python Package for Uncertainty Quantification and Optimization. Available at SSRN: https://ssrn.com/abstract=5393295 or http://dx.doi.org/10.2139/ssrn.5393295
278
+
279
+
```bibtex
280
+
@misc{wu2025uqpyl2,
281
+
title = {UQPyL 2.0: An Open-Source Python Package for Uncertainty Quantification and Optimization},
282
+
author = {Wu, Mengtian and Sun, Ruochen and Xu, Pengcheng and Yang, Xu and Hu, Pengjie and Duan, Qingyun},
283
+
year = {2025},
284
+
note = {SSRN preprint},
285
+
doi = {10.2139/ssrn.5393295},
286
+
url = {https://ssrn.com/abstract=5393295}
287
+
}
288
+
```
289
+
290
+
For UQPyL 1.0, please cite:
285
291
286
-
For UQPyL 1.0, see:
292
+
Wang, C., Duan, Q., Tong, C. H., Di, Z., & Gong, W. (2016). A GUI platform for uncertainty quantification of complex dynamical models. *Environmental Modelling & Software*, 76, 1-12. https://doi.org/10.1016/j.envsoft.2015.11.004
0 commit comments