Skip to main content

Detection of favorable moments

Project description

CAERUS

PyPI Version License

Detection of local minima with the corresponding local maxima within the given time-frame.

Caerus is a python package that detects points in time that are most probable local minima and local maxima. As an example is shown the last 300 days of BTC. Green are the local minima and red are the local maxima.

This package determines the local-minima with the corresponding local-maxima across time series data without the need of normalization procedures. The method is designed with a forward rolling window where thousands of variable and sliding windows are iteratively evaluated by means of percentage difference (start-to-stop position). The resulting matrix contains N=windows X M=length_dataframe. The windows of interest have a score (percentage) larger then a predefined minimum. The final matrix is then aggregated (sum) per time-point and normalized for the window length (at the end of the time series data, the windows are forced to become smaller). At each time point the score ranges between [0,1], where [0] depicts that no single window contained a desired minimum percentage, and [1] depicts that all windows showed the minimum desired window. The local minima regions of interest are subsequently detected by thresholding. The stop-locations are determined based on the distance and percentage of te start-locations. As an example, if you want to have best regions, use threshold=1, minperc=high and nlargest=1 (small).

About the name

In Greek mythology, Caerus (same as kairos) was the personification of opportunity, luck and favorable moments. He was shown with only one lock of hair. His Roman equivalent was Occasio or Tempus. Caerus was the youngest child of Zeus.

Contents

Installation

  • Install caerus from PyPI (recommended). caerus is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows. It is distributed under the Apache 2.0 license.
pip install caerus
  • Alternatively, install caerus from the GitHub source:
git clone https://github.com/erdoganta/caerus.git
cd caerus
python setup.py install

Quick Start

  • Import caerus method
import caerus as cs
  • Simple example with constant window, minimum percentage and threshold
df=pd.read_csv('https://github.com/erdoganta/caerus/blob/master/caerus/data/fb.csv')['close']
out = cs.fit(df)
fig = cs.makefig(out)

The input is a pandas dataframe or series and looks like this:

The output looks as below:

df=pd.read_csv('https://github.com/erdoganta/caerus/blob/master/caerus/data/btc.csv')['Close']
out = cs.fit(df)
fig = cs.makefig(out)

The output looks as below:

  • Gridsearch walks over the windows and over the percentages to determine optimal window, minimum percentage and the threshold.
df = pd.read_csv('https://github.com/erdoganta/caerus/blob/master/caerus/data/btc.csv')['close']
out = cs.gridsearch(df)

The output looks as below:

Citation

Please cite caerus in your publications if this is useful for your research. Here is an example BibTeX entry:

@misc{erdoganta2019caerus,
  title={caerus},
  author={Erdogan Taskesen},
  year={2019},
  howpublished={\url{https://github.com/erdoganta/caerus}},
}

Maintainers

© Copyright

See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

caerus-0.1.0.tar.gz (90.7 kB view details)

Uploaded Source

Built Distribution

caerus-0.1.0-py3-none-any.whl (79.3 kB view details)

Uploaded Python 3

File details

Details for the file caerus-0.1.0.tar.gz.

File metadata

  • Download URL: caerus-0.1.0.tar.gz
  • Upload date:
  • Size: 90.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9

File hashes

Hashes for caerus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12eb33709199d6fe3948552dc2bdb254520f74abbb7055dc72a98f8dd54821c7
MD5 4479196f791f2c9194be831d351071b9
BLAKE2b-256 682a8e933fa1101b593d9035ab4630cf5b2c207e3a25e5277fcb46d9b9f98374

See more details on using hashes here.

File details

Details for the file caerus-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: caerus-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 79.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9

File hashes

Hashes for caerus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa9a95484a7d8494121df442c99c46c645dda03707590a25be261763d6f5585f
MD5 8628b4a5583ec737035dae27a4df2f11
BLAKE2b-256 8060877006abedc13eaa68fa988eecd0eb8d2f10e2e4fc2cf1ef8220674d2501

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page