bluemodel / BlueM.Wave

Wave is a tool for displaying, analyzing and importing and exporting time series.
https://wiki.bluemodel.org/index.php/BlueM.Wave
GNU Lesser General Public License v3.0
4 stars 2 forks source link

Respect unit and interpretation when calculating average and other statistics #86

Open jamaa opened 1 year ago

jamaa commented 1 year ago

Currently, the Timeseries.Average property returns the simple arithmetic mean of all values. For non-equidistant timeseries, this value can be misleading. Simlarly, analysis function such as MonthlyStatistics and AnnualStatistics output statistical values that do not respect the unit and interpretation of time series either, potentially causing wrong or at least misleading results.

The unit and interpretation needs to be respected everywhere.

For this, Wave needs to be able to understand units and then calculate proper, volume-based averages.

For statistics based on a time period such as month or year, the time series is probably best first converted to monthly/annual values using the ChangeTimestep method. This method also needs to be able to understand units.

For unknown units, Wave should probably just not output statistics at all and/or ouput an error message.

jamaa commented 1 year ago

Some libraries that may prove useful for unit handling:

jamaa commented 1 year ago

some more unit handling libraries for further inspiration:

jamaa commented 11 months ago

Since #112 was fixed, volume calculation accurately considers interpretation and gaps. We could use similar logic for calculating more accurate averages.