OBF-file: Difference between revisions

From BlueM
Jump to navigation Jump to search
(update objective functions for 1.9)
Line 2: Line 2:
<div class="info_versionen">
<div class="info_versionen">
'''Versions:'''
'''Versions:'''
* '''current''' v1.8 (starting from r1804)
* '''current''' v1.9 (starting from r1847)
* [{{SERVER}}/index.php?title=OBF-file&oldid=7469 v1.8] (up to r1843)
* [{{SERVER}}/index.php?title=ZIE-file&oldid=7401 v1.7] (as of r1785)
* [{{SERVER}}/index.php?title=ZIE-file&oldid=7401 v1.7] (as of r1785)
* [{{SERVER}}/index.php?title=ZIE-file&oldid=7274 v1.6] (as of r1762)
* [{{SERVER}}/index.php?title=ZIE-file&oldid=7274 v1.6] (as of r1762)
Line 89: Line 90:
:{| cellpadding="5" cellspacing="0" border="0" class="standard stripes"
:{| cellpadding="5" cellspacing="0" border="0" class="standard stripes"
|-  
|-  
! width="150" | Parameter !! width="500" | Description
! width="150" | Parameter !! width="600" | Description
|-
|-
| '''Opt''' || Specifies, whether the objective function is a '''primary objective function''' (<code>P</code>) or a '''secondary objective function''' (<code>S</code>).<br/>Primary objective functions are used to calculate the fitness of invidual solutions.<br/>Secondary objective functions are evaluated, but are not used to determine the fitness of individuals. Secondary objective functions are useful for specifiying objective functions that are part of an aggregated objective function or for specifying values of interest that should be evaluated, but not optimized towards.
| '''Opt''' || Specifies, whether the objective function is a '''primary objective function''' (<code>P</code>) or a '''secondary objective function''' (<code>S</code>).<br/>Primary objective functions are used to calculate the fitness of invidual solutions.<br/>Secondary objective functions are evaluated, but are not used to determine the fitness of individuals. Secondary objective functions are useful for specifiying objective functions that are part of an aggregated objective function or for specifying values of interest that should be evaluated, but not optimized towards.
Line 119: Line 120:
| '''SimResult''' || The identifier of the simulation result from which the objective function should be calculated.
| '''SimResult''' || The identifier of the simulation result from which the objective function should be calculated.
|-
|-
| '''ObjFunc''' || Specified which objective function to use. Supported values:
| '''ObjFunc''' || Specifies which objective function to use. Supported values:
* <code>AbQuad</code>: Sum of squared errors
* <code>SSE</code>: Sum of squared errors
* <code>NashSutt</code>: Nash-Sutcliffe Coefficient{{:Literatur:Nash-Sutcliffe_1970|}}
* <code>SAE</code>: Sum of absolute errors
:modified formula with <code>0 < E < &infin;</code> :
* <code>NSE</code>: Nash-Sutcliffe efficiency{{:Literatur:Nash-Sutcliffe_1970|}}
:<math>E=\frac{\sum_{t=1}^T\left(Q_{obs}^t-Q_{sim}^t\right)^2}{\sum_{t=1}^T\left(Q_{obs}^t-\overline{Q_{obs}}\right)^2}</math>
:<code>-&infin; &le; NSE &le; 1</code>. Larger is better.
* <code>LnNashSutt</code>: Logarithmic Nash-Sutcliffe Coefficient{{:Literatur:Nash-Sutcliffe_1970|}}
:<math>NSE=1-\frac{\sum_{t=1}^T\left(Q_{obs}^t-Q_{sim}^t\right)^2}{\sum_{t=1}^T\left(Q_{obs}^t-\overline{Q_{obs}}\right)^2}</math>
:modified formula with <code>0 < E < &infin;</code> :
* <code>lnNSE</code>: Logarithmic Nash-Sutcliffe efficiency{{:Literatur:Nash-Sutcliffe_1970|}}
:<math>E=\frac{\sum_{t=1}^T\left(ln(Q_{obs}^t)-ln(Q_{sim}^t)\right)^2}{\sum_{t=1}^T\left(ln(Q_{obs}^t)-ln(\overline{Q_{obs}})\right)^2}</math>
:<code>-&infin; &le; lnNSE &le; 1</code>. Larger is better.
:<math>lnNSE=1-\frac{\sum_{t=1}^T\left(ln(Q_{obs}^t)-ln(Q_{sim}^t)\right)^2}{\sum_{t=1}^T\left(ln(Q_{obs}^t)-ln(\overline{Q_{obs}})\right)^2}</math>
:;NOTE: In order to avoid not being able to calculate <code>ln(0)</code>, all observed and simulated timeseries values are set to a minimum of <math>\overline{Q_{obs}} / 100.0</math>
:;NOTE: In order to avoid not being able to calculate <code>ln(0)</code>, all observed and simulated timeseries values are set to a minimum of <math>\overline{Q_{obs}} / 100.0</math>
* <code>Diff</code>: Absolute difference
* <code>KGE</code>: Kling-Gupta efficiency{{:Literatur:Gupta_2009|}}
* <code>nÜber</code>: Relative number of timesteps in which the simulation result is larger than (exceeds) the value of the reference time series [%]
:<code>-&infin; &le; KGE &le; 1</code>. Larger is better.
* <code>sÜber</code>: Sum of the simulation values that are larger than the values of the reference time series
:<math>\text{KGE} = 1 - \sqrt{ (r - 1)^2 + (\beta - 1)^2 + (\gamma - 1)^2 }</math>
* <code>nUnter</code>: Relative number of timesteps in which the simulation result is smaller than the value of the reference time series [%]
:with
* <code>sUnter</code>: Sum of the simulation values that are smaller than the values of the reference time series
::<code>r</code>: correlation coefficient
* <code>Korr</code>: [https://en.wikipedia.org/wiki/Coefficient_of_determination Coefficient of determination] (simple linear regression) <code>0 &le; R² &le; 1</code>:
::<code>&beta;</code>: bias ratio
::<code>&gamma;</code>: variability ratio
* <code>NGT</code>: Relative number of timesteps in which the simulation result is larger than (exceeds) the value of the reference time series [%]
* <code>SGT</code>: Sum of the simulation values that are larger than the values of the reference time series
* <code>NLT</code>: Relative number of timesteps in which the simulation result is smaller than the value of the reference time series [%]
* <code>SLT</code>: Sum of the simulation values that are smaller than the values of the reference time series
* <code>DET</code>: [https://en.wikipedia.org/wiki/Coefficient_of_determination Coefficient of determination] (simple linear regression) <code>0 &le; R² &le; 1</code>:
:<math>R^2 = \frac{s^2_{xy}}{s^2_x \cdot s^2_y}</math>
:<math>R^2 = \frac{s^2_{xy}}{s^2_x \cdot s^2_y}</math>
* <code>Volf</code>: Absolute volume error [%]
* <code>BIAS</code>: Absolute volume error [%]
The following options are '''obsolete''' and only kept for backwards compatibility:
* <code>AbQuad</code>: alias for <code>SSE</code>
* <code>Diff</code>: alias for <code>SAE</code>
* <code>nÜber</code>: alias for <code>NGT</code>
* <code>sÜber</code>: alias for <code>SGT</code>
* <code>nUnter</code>: alias for </code>NLT</code>
* <code>sUnter</code>: alias for <code>SLT</code>
* <code>Korr</code>: alias for <code>DET</code>
* <code>Volf</code>: alias for <code>BIAS</code>
* <code>NashSutt</code>: Modified Nash-Sutcliffe efficiency
:modified formula with <code>0 &le; NSE<sub>mod</sub> &le; &infin;</code>. Smaller is better.
:<math>NSE_{mod}=1-NSE</math>
* <code>LnNashSutt</code>: Modified logarithmic Nash-Sutcliffe efficiency
:modified formula with <code>0 &le; lnNSE<sub>mod</sub> &le; &infin;</code>. Smaller is better.
:<math>lnNSE_{mod}=1-lnNSE</math>
|-
|-
| '''CurValue'''<br/>(optional) || An optional value that is displayed in diagrams to serve as an indication of improvement.
| '''CurValue'''<br/>(optional) || An optional value that is displayed in diagrams to serve as an indication of improvement.
|}
|}


==="Series"===
==="Series"===

Revision as of 09:41, 11 December 2021

EVO.png BlueM.Opt | Download | Usage | Development

BlueM.Opt input files: MOD · OPT · OBF · CON


Versions:

This file defines the objective functions for the optimization.

The file must have the same filename as the rest of the dataset's files but have the file extension .OBF, and be located in the same directory as the rest of the dataset. (In version prior to v1.8, this file had the file extension .ZIE.)


The file is divided into several blocks, each of which is optional. Each block is identified by its heading:

  • Series: This block defines objective functions that are based on a comparison of simulation time series with a reference time series.
  • Values: This block defines objective functions that are based on a comparison of simulation result values with a reference value (currently only functional for SWMM applications, see #414).
  • ValueFromSeries: This block defines objective functions that are based on a comparison of values that are computed from simulated time series with reference values.
  • SKos: Damages and Costs
  • Aggregate: Aggregate objective functions

File format

*Objective functions
*===================
*
*Series
*------
*
*|-----|---------------|---------|---|-------|-------|------------|---------|------------------|------------------|-----------------------------|----------|
*| Opt | Name          | Group   | D | OpFac | File  | SimResult  | ObjFunc |           Evaluation period         |       Reference series      | CurValue |
*|     |               |         |   |       |       |            |         |       Start      |     End          | RefName   | RefFile         |          |
*|-----|---------------|---------|---|-------|-------|------------|---------|------------------|------------------|-----------|-----------------|----------|
 |  P  | NashSutcliffe |         | - |       |  WEL  | B401       | NashSutt| 30.05.1984 00:00 | 18.06.1984 23:30 |           | seriesfile.zre  |          |
*|-----|---------------|---------|---|-------|-------|------------|---------|------------------|------------------|-----------|-----------------|----------|
*
*Values
*------
*
*|-----|---------------|---------|---|-------|-------|-----------|---------|---------------|-------------|----------|----------|
*| Opt | Name          | Group   | D | OpFac | File  | SimResult | ObjFunc | TargetElement | TargetValue |          | CurValue |
*|     |               |         |   |       |       |           |         | (Block)       | (Column)    | RefValue |          |
*|-----|---------------|---------|---|-------|-------|-----------|---------|---------------|-------------|----------|----------|
 |  P  | OutfallLoad   |         | - |       |  RPT  |           |  Diff   | OutfallNode   | AvgFlow     |     0    |          |
 |  S  | Storage401    | Storage | - |   +   |  BLZ  | B401      |         | Speicher      | maxVolume   |          |          |
 |  S  | Storage701    | Storage | - |   +   |  BLZ  | B701      |         | Speicher      | maxVolume   |          |          |
*|-----|---------------|---------|---|-------|-------|-----------|---------|-------------- |-------------|----------|----------|
*
*ValueFromSeries
*---------------
*
*|-----|---------------|---------|---|-------|-------|------------|---------|---------|---------|----------------------|----------|
*| Opt | Name          | Group   | D | OpFac | File  | SimResult  | ObjFunc | Evaluation period | Reference value      | CurValue |
*|     |               |         |   |       |       |            |         | Start   | Ende    | ValueType | RefValue |          |
*|-----|---------------|---------|---|-------|-------|------------|---------|---------|---------|-----------|----------|----------|
 |  P  | OutfallLoad   |         | - |       |  WEL  | B401_2AB   |  Diff   |         |         |           |          |          |
*|-----|---------------|---------|---|-------|-------|------------|---------|---------|---------|-----------|----------|----------|
*
*SKos
*----
*
*|-----|-------------|---------|---|-------|
*| Opt | Name        | Group   | D | OpFac |
*|     |             |         |   |       |
*|-----|-------------|---------|---|-------|
 |  P  | ConstrCosts |         |   |       |
*|-----|-------------|---------|---|-------|
*
*Aggregate
*---------
*
*|-----|--------------|---------|---|----------|
*| Opt | Name         | Group   | D | CurValue |
*|-----|--------------|---------|---|----------|
 |  P  | TotalStorage | Storage |   |          |
*|-----|--------------|---------|---|----------|

The width of the columns can be adjusted if necessary, but the column separators (|) must be preserved!

An asterisk (*) at the beginning of the line causes the line to be ignored.

Description

Common parameters

The blocks "Series", "Values" and "ValuesFromSeries" share a set of parameters.

Parameter Description
Opt Specifies, whether the objective function is a primary objective function (P) or a secondary objective function (S).
Primary objective functions are used to calculate the fitness of invidual solutions.
Secondary objective functions are evaluated, but are not used to determine the fitness of individuals. Secondary objective functions are useful for specifiying objective functions that are part of an aggregated objective function or for specifying values of interest that should be evaluated, but not optimized towards.
Name Arbitrary name of the objective function
Group
(optional)
Optional group name, only used for calculating aggregated objective functions. Objective functions with the same group name are aggregated to form one aggregated objective function.
Direction
(optional)

Direction of desired optimization:

  • -: The objective function should be minimized (default)
  • +: The objective function should be maximized. This causes the objective function values to be multiplied by -1 (#303).
Operator or Factor
(optional)

Optional, only used for aggregated objective functions

  • +: The objective function value is added to the group
  • -: The objective function value is subtracted from the group
  • number: The objective function value is multiplied by the given number and then added to the group
File The simulation result file containing the simulation result from which the objective function should be calculated. Supported values:
SimResult The identifier of the simulation result from which the objective function should be calculated.
ObjFunc Specifies which objective function to use. Supported values:
  • SSE: Sum of squared errors
  • SAE: Sum of absolute errors
  • NSE: Nash-Sutcliffe efficiency[1]
-∞ ≤ NSE ≤ 1. Larger is better.
[math]\displaystyle{ NSE=1-\frac{\sum_{t=1}^T\left(Q_{obs}^t-Q_{sim}^t\right)^2}{\sum_{t=1}^T\left(Q_{obs}^t-\overline{Q_{obs}}\right)^2} }[/math]
  • lnNSE: Logarithmic Nash-Sutcliffe efficiency[1]
-∞ ≤ lnNSE ≤ 1. Larger is better.
[math]\displaystyle{ lnNSE=1-\frac{\sum_{t=1}^T\left(ln(Q_{obs}^t)-ln(Q_{sim}^t)\right)^2}{\sum_{t=1}^T\left(ln(Q_{obs}^t)-ln(\overline{Q_{obs}})\right)^2} }[/math]
NOTE
In order to avoid not being able to calculate ln(0), all observed and simulated timeseries values are set to a minimum of [math]\displaystyle{ \overline{Q_{obs}} / 100.0 }[/math]
  • KGE: Kling-Gupta efficiency[2]
-∞ ≤ KGE ≤ 1. Larger is better.
[math]\displaystyle{ \text{KGE} = 1 - \sqrt{ (r - 1)^2 + (\beta - 1)^2 + (\gamma - 1)^2 } }[/math]
with
r: correlation coefficient
β: bias ratio
γ: variability ratio
  • NGT: Relative number of timesteps in which the simulation result is larger than (exceeds) the value of the reference time series [%]
  • SGT: Sum of the simulation values that are larger than the values of the reference time series
  • NLT: Relative number of timesteps in which the simulation result is smaller than the value of the reference time series [%]
  • SLT: Sum of the simulation values that are smaller than the values of the reference time series
  • DET: Coefficient of determination (simple linear regression) 0 ≤ R² ≤ 1:
[math]\displaystyle{ R^2 = \frac{s^2_{xy}}{s^2_x \cdot s^2_y} }[/math]
  • BIAS: Absolute volume error [%]

The following options are obsolete and only kept for backwards compatibility:

  • AbQuad: alias for SSE
  • Diff: alias for SAE
  • nÜber: alias for NGT
  • sÜber: alias for SGT
  • nUnter: alias for NLT
  • sUnter: alias for SLT
  • Korr: alias for DET
  • Volf: alias for BIAS
  • NashSutt: Modified Nash-Sutcliffe efficiency
modified formula with 0 ≤ NSEmod ≤ ∞. Smaller is better.
[math]\displaystyle{ NSE_{mod}=1-NSE }[/math]
  • LnNashSutt: Modified logarithmic Nash-Sutcliffe efficiency
modified formula with 0 ≤ lnNSEmod ≤ ∞. Smaller is better.
[math]\displaystyle{ lnNSE_{mod}=1-lnNSE }[/math]
CurValue
(optional)
An optional value that is displayed in diagrams to serve as an indication of improvement.


"Series"

Parameter Description
Evaluation period
(optional)
Specifies the simulation time period for which the objective function should be evaluated.

Format: dd.mm.yyyy hh:mm
If Start and/or End are left empty, the start and/or end of the entire simulation time period is used.

RefName
(nur bei Referenzreihen und .WEL als Referenzdatei)
Specifies the identifier of the time series with which the simulation result should be compared. Only necessary if the time series file specified under RefFile is in WEL-format.
RefFile The filename of the reference time series (.zre or .wel)
Warning: The time step size of the reference series must be identical to that of the simulation result! (see #218)


"Values"

Parameter Description
TargetElement (Block) Specifies in which section (block) the target variable is located.
TargetValue (Column) Specifies the target variable within the block.
RefValue The reference value with which the simulation result should be compared.

The parameter TargetElement is dependent on the parameter TargetValue and the simulation tool used, only the following combinations are possible:

Application TargetElement (Block) TargetValue (Column)
SWMM NodeFlooding HoursFlooded
SWMM NodeFlooding FloodVolume
SWMM StorageVolume AvgVolume
SWMM StorageVolume AvgPctFull
SWMM StorageVolume MaxVolume
SWMM StorageVolume MaxPctFull
SWMM StorageVolume MaxOutflow
SWMM OutfallLoad MaxFlow
SWMM OutfallLoad FlowVolume
SWMM OutfallLoad Pollutant_[no]
SWMM Pumping OnlineTime
SWMM Pumping TotalEnergy
Smusi EntlVolumen SumVol
Smusi MaxAbfluss Qmax
Smusi EntlFracht CSBspez

The TargetValue Pollutant_[no] allows for the evaluation of up to five substances, [no] can take values of 01, 02, 03, 04 or 05, so e.g. specify Pollutant_02 for the second substance.

"ValueFromSeries"

Parameter Description
Evaluation period
(optional)
Specifies the simulation time period for which the objective function should be evaluated.

Format: dd.mm.yyyy hh:mm
If Start and/or End are left empty, the start and/or end of the entire simulation time period is used.

ValueType Specifies how to calculate the value from the simulation result series. Supported values:
  • MaxWert: Maximum value of the simulation result
  • MinWert: Minimum value of the simulation result
  • Average: Average value of the simulation result
  • AnfWert: The first value of the simulation result
  • EndWert: The last value of the simulation result
  • Summe: Sum of the simulation result
RefValue The reference value with which the computed simulation result should be compared.


Literature

  1. 1.0 1.1 Nash, J. E. and Sutcliffe, J. V. (1970): River flow forecasting through conceptual models part I — A discussion of principles, Journal of Hydrology, 10 (3), 282–290, DOI:10.1016/0022-1694(70)90255-6.
  2. Gupta, H. V., Kling, H., Yilmaz, K. K., & Martinez, G. F. (2009): Decomposition of the mean squared error and NSE performance criteria: Implications for improving hydrological modelling. Journal of hydrology, 377(1-2), 80-91. doi:10.1016/j.jhydrol.2009.08.003. ISSN 0022-1694