Time series aggregation module (tsam). Determines typical operation periods or dereases the temporal resolution. Accelerates model or experiment runs.

Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|

Tsai | 4,054 | 2 | 23 days ago | 47 | November 13, 2023 | 57 | apache-2.0 | Jupyter Notebook | ||

Time series Timeseries Deep Learning Machine Learning Pytorch fastai | State-of-the-art Deep Learning library for Time Series and Sequences in Pytorch / fastai | ||||||||||

Tslearn | 2,659 | 11 | 38 | a day ago | 99 | August 21, 2023 | 126 | bsd-2-clause | Python | |

A machine learning toolkit dedicated to time-series data | ||||||||||

Awesome Ts Anomaly Detection | 2,320 | a year ago | 1 | |||||||

List of tools & datasets for anomaly detection on time-series data. | ||||||||||

Dxy Covid 19 Data | 2,196 | 3 days ago | 7 | mit | Python | |||||

2019新型冠状病毒疫情时间序列数据仓库 | COVID-19/2019-nCoV Infection Time Series Data Warehouse | ||||||||||

Awesome_time_series_in_python | 1,811 | 10 months ago | 4 | |||||||

This curated list contains python packages for time series analysis | ||||||||||

Deep Learning Time Series | 1,811 | a year ago | 8 | apache-2.0 | Jupyter Notebook | |||||

List of papers, code and experiments using deep learning for time series forecasting | ||||||||||

Kairosdb | 1,709 | 2 months ago | 132 | apache-2.0 | Java | |||||

Fast scalable time series database | ||||||||||

Pyts | 1,563 | 2 | 17 | 3 months ago | 19 | October 31, 2021 | 42 | bsd-3-clause | Python | |

A Python package for time series classification | ||||||||||

Causalimpact | 1,484 | 2 | 2 | a year ago | 9 | November 09, 2022 | 22 | apache-2.0 | R | |

An R package for causal inference in time series | ||||||||||

Filodb | 1,407 | 5 days ago | 37 | apache-2.0 | Scala | |||||

Distributed Prometheus time series database |

Alternatives To TsamSelect To Compare

Alternative Project Comparisons

Readme

tsam is a python package which uses different machine learning algorithms for the aggregation of time series. The data aggregation can be performed in two freely combinable dimensions: By representing the time series by a user-defined number of typical periods or by decreasing the temporal resolution. tsam was originally designed for reducing the computational load for large-scale energy system optimization models by aggregating their input data, but is applicable for all types of time series, e.g., weather data, load data, both simultaneously or other arbitrary groups of time series.

The documentation of the tsam code can be found **here**.

- flexible handling of multidimensional time-series via the pandas module
- different aggregation methods implemented (averaging, k-means, exact k-medoids, hierarchical, k-maxoids, k-medoids with contiguity), which are based on scikit-learn, or self-programmed with pyomo
- hypertuning of aggregation parameters to find the optimal combination of the number of segments inside a period and the number of typical periods
- novel representation methods, keeping statistical attributes, such as the distribution
- flexible integration of extreme periods as own cluster centers
- weighting for the case of multidimensional time-series to represent their relevance

Directly install via pip as follows:

```
pip install tsam
```

Alternatively, clone a local copy of the repository to your computer

```
git clone https://github.com/FZJ-IEK3-VSA/tsam.git
```

Then install tsam via pip as follow

```
cd tsam
pip install .
```

Or install directly via python as

```
python setup.py install
```

In order to use the k-medoids clustering, make sure that you have installed a MILP solver. As default HiGHS is used. Nevertheless, in case you have access to a license we recommend commercial solvers (e.g. Gurobi or CPLEX) since they have a better performance.

A small example how tsam can be used is decribed as follows

```
import pandas as pd
import tsam.timeseriesaggregation as tsam
```

Read in the time series data set with pandas

```
raw = pd.read_csv('testdata.csv', index_col = 0)
```

Initialize an aggregation object and define the length of a single period, the number of typical periods, the number of segments in each period, the aggregation method and the representation method - here duration/distribution representation which contains the minimum and maximum value of the original time series

```
aggregation = tsam.TimeSeriesAggregation(raw,
noTypicalPeriods = 8,
hoursPerPeriod = 24,
segmentation = True,
noSegments = 8,
representationMethod = "distributionAndMinMaxRepresentation",
distributionPeriodWise = False
clusterMethod = 'hierarchical'
)
```

Run the aggregation to typical periods

```
typPeriods = aggregation.createTypicalPeriods()
```

Store the results as .csv file

```
typPeriods.to_csv('typperiods.csv')
```

A **first example** shows the capabilites of tsam as jupyter notebook.

A **second example** shows in more detail how to access the relevant aggregation results required for paramtrizing e.g. an optimization.

The example time series are based on a department publication and the test reference years of the DWD.

MIT License

Copyright (C) 2016-2022 Leander Kotzur (FZJ IEK-3), Maximilian Hoffmann (FZJ IEK-3), Peter Markewitz (FZJ IEK-3), Martin Robinius (FZJ IEK-3), Detlef Stolten (FZJ IEK-3)

You should have received a copy of the MIT License along with this program. If not, see https://opensource.org/licenses/MIT

The core developer team sits in the Institute of Energy and Climate Research - Techno-Economic Energy Systems Analysis (IEK-3) belonging to the Forschungszentrum Jülich.

If you want to use tsam in a published work, **please kindly cite** our latest journal articles:

- Hoffmann et al. (2022):

**The Pareto-Optimal Temporal Aggregation of Energy System Models**

If you are further interested in the impact of time series aggregation on the cost-optimal results on different energy system use cases, you can find a publication which validates the methods and describes their cababilites via the following **link**. A second publication introduces a method how to model state variables (e.g. the state of charge of energy storage components) between the aggregated typical periods which can be found **here**. Finally yet importantly the potential of time series aggregation to simplify mixed integer linear problems is investigated **here**.

The publications about time series aggregation for energy system optimization models published alongside the development of tsam are listed below:

- Hoffmann et al. (2021):

**The Pareto-Optimal Temporal Aggregation of Energy System Models**

(open access manuscript to be found**here**) - Hoffmann et al. (2021):

**Typical periods or typical time steps? A multi-model analysis to determine the optimal temporal aggregation for energy system models** - Hoffmann et al. (2020):

**A Review on Time Series Aggregation Methods for Energy System Models** - Kannengießer et al. (2019):

**Reducing Computational Load for Mixed Integer Linear Programming: An Example for a District and an Island Energy System** - Kotzur et al. (2018):

**Time series aggregation for energy system design: Modeling seasonal storage**

(open access manuscript to be found**here**) - Kotzur et al. (2018):

**Impact of different time series aggregation methods on optimal energy system design**

(open access manuscript to be found**here**)

This work is supported by the Helmholtz Association under the Joint Initiative "Energy System 2050 A Contribution of the Research Field Energy" and the program "Energy System Design" and within the BMWi/BMWk funded project **METIS**.

Popular Series Projects

Popular Time Projects

Popular Control Flow Categories

Related Searches

Get A Weekly Email With Trending Projects For These Categories

No Spam. Unsubscribe easily at any time.

Python

Time

Series

Optimization

Time Series