Description
This is a tutorial project for finding optimum lag using the Modified Dynamic time warping along with the links.
Requirements
Use the package manager pip to install all the requirements. Just follow the commands below:
Install dtaidistance:
pip install dtaidistance
Cost matrix based on dtaidistance (https://pypi.org/project/dtaidistance/)
Install pandas:
pip install pandas
Data requirements:
Both timeseries should be in pandas series format with same datetime index
Usage
from ModifiedDTW.ModifedDTW import MDTWlag
series1 = Droughtindex1 # Cause
series2 = Droughtindex2 # Effect
Results = MDTWlag(series1, series2, Maximumwindowsize, LagRange)
Distanceatdifferentlags = Results[0]
OptimumLag = Results[1]
OptimumLinks = Results[2]
MaximumWindowSize defines the window within which the DTW path operates (default = 12).
LagRange specifies the maximum lag up to which the optimum lag will be searched (depends on the system under study; Default use MaximumWindowSize = LagRange).
Distanceatdifferentlags outputs a dataframe with total path distance at different lag.
OptimumLag is the propagation lag based on minimum path distance.
OptimumLinks is the datetime of links between the two indices at optimum lag.
Note: This package uses forward only band (Bilal-Gupta Band) preferred for analysis of links/lag between meteorological to agricultural/hydrological indices.
Cite
Bilal, S. B., & Gupta, V. (2026). A novel multi-link approach to drought propagation analysis using modified dynamic time warping. Journal of Hydrology, 135604. (https://doi.org/10.1016/j.jhydrol.2026.135604)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Metadata
Release files for ModifiedDTW 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| modifieddtw-1.1.1.tar.gz | 3.2 kB | Without provenance | Details for modifieddtw-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| modifieddtw-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for modifieddtw-1.1.1-py3-none-any.whl |
Total release size: 6.2 kB
Release files / modifieddtw-1.1.1.tar.gz
| Download URL | modifieddtw-1.1.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e5e6e46ac2243b20544b2ea3edd47e6c17106f6b10045229266988eac5b184b4
|
|
BLAKE2b-256 checksum How to use checksums |
6142f351230f211ae0720efc963b5e60a112f510b75ac697f1d54730ad2a8b33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / modifieddtw-1.1.1-py3-none-any.whl
| Download URL | modifieddtw-1.1.1-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f04900b4660e99eee3eea48e17d02711a51aaa19646c62e3411879dc4d1d1fd
|
|
BLAKE2b-256 checksum How to use checksums |
11df6a56defd621887865a36f7f6df83ba82e6596b9e85505ff1910a8eb28be3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for ModifiedDTW 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.