generate-corr-sequence
The simulation of stationary time-series (discrete-time random process) with a specific autocorrelation function (ACF) and continuous probability distribution.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (4.2%) to scientific vocabulary
Keywords
Repository
The simulation of stationary time-series (discrete-time random process) with a specific autocorrelation function (ACF) and continuous probability distribution.
Basic Info
Statistics
- Stars: 21
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
readme.md
Generate stationary correlated time-series
Summary
This Python function creates a time-series (discrete-time random process) with a specific autocorrelation function (ACF) and continuous probability distribution, e.g with predefined probability density function (PDF).
Usage:
python
from generate_corr_sequence import gen_corr_sequence
gen_corr_sequence(dist_obj=uniform,
target_acf=1 - np.minimum(np.arange(0, 100), 100) / 100,
L: int = 2 ** 20,
seed=None,
debug: bool = False,
plot_figures_name: str = None)
Arguments
dist_obj- A continuous distribution object from scipy.stats, default isuniformtarget_acf- A required ACF function, default is a linear functionL- Number of required samplesseed- Seed of the random number generatordebug- Plots PDF and ACF graphsplot_figures_name- Filename of the debug figure to be saved, only whendebugisTrue. In no extension is provided, the default ispng.
Returns:
- A random sequence with pre-defined ACF and distribution with type
numpy.ndarray.
Examples
Default settings with uniform distribution and linear ACF
The example below shows the default settings of the function from the examples/default_settings_example.ipynb file.
```python
Example usage of the function with default settings
sequence = gencorrsequence(debug=True) ```

Nakagami distribution with Bessel function ACF
The example below is from the examples/nakagami_example.ipynb file.
```python
Example usage of the function with Nakagami distribution and an autocorrelation function
from generatecorrsequence import gencorrsequence import numpy as np from scipy.stats import nakagami from scipy.special import j0
%%
m = np.arange(0, 100) signal = gencorrsequence( distobj=nakagami(nu=1), targetacf=np.array(j0(0.1 * np.pi * abs(m))), debug=True) ```

Notes
- There is no responsibility for the correctness of the results. It may work and it may not - use debug option to check the results.
- Examples for different distributions (uniform, exponential, Laplace, Rayleigh, triangle,
gamma, lognormal, Nakagami) and four different ACFs are provided in the
examples/evaluation/folder. Theevaluate_PDFs.ipynbfile used for generation of all the ACF figures in the directory. - It takes about 2-3 seconds to generate a single default-length sequence.
- The example of code repeatability is provided in the
examples/nakagami_example.ipynbnotebook as extension of Nakagami distribution example. The sequence is generated 20 times with ACFs as follows.

Installation
Use:
pip install generate_corr_sequence
References
The algorithm is mainly based on the following papers:
- Filho, José Cândido Silveira Santos, and Michael Daoud Yacoub. "Coloring Non-Gaussian Sequences." IEEE Transactions on Signal Processing, vol. 56, no. 12, 2008, p. 6.
- Liu, Bede, et al. "Generation of a Random Sequence Having a Jointly Specified Marginal Distribution and Autocovariance." IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. ASSP-30, no. 6, 1982, p. 11.
Contributors
Dima Bykhovsky, Netanel Tochilovsky, Alexander Rudyak
License
This project is licensed under the MIT license.
Todo
- custom (non-scipy) distributions support
- higher-speed algorithm for Gaussian distributions
- fix lognormal distribution problem for oscillatory ACFs
Owner
- Name: Dima Bykhovsky
- Login: bykhov
- Kind: user
- Website: https://en.sce.ac.il/faculty/bykhovsky
- Repositories: 1
- Profile: https://github.com/bykhov
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: Generate stationary correlated time-series
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Dima
family-names: Bykhovsky
orcid: 'https://orcid.org/0000-0003-4468-7791'
- given-names: Netanel
family-names: Tochilovsky
- given-names: Alexander
family-names: Rudyak
orcid: 'https://orcid.org/0009-0005-0985-3434'
repository-code: 'https://github.com/bykhov/generate_corr_sequence'
abstract: >-
This Python function creates a time-series (discrete-time
random process) with a specific autocorrelation function
(ACF) and continuous probability distribution, e.g with
predefined probability density function (PDF).
keywords:
- Python
- time-series
- simulation
- wss
- autocorrelation
- random-process
- autocovariance
license: MIT
preferred-citation:
type: conference-paper
authors:
- family-names: "Bykhovsky"
given-names: "Dima"
- family-names: "Tochilovsky"
given-names: "Netanel"
- family-names: "Rudyak"
given-names: "Alexander"
doi: "10.1109/ICECET58911.2023.10389427"
journal: "2023 International Conference on Electrical, Computer and Energy Technologies (ICECET)"
month: 11
start: 1 # First page number
end: 6 # Last page number
title: "Python-Based Simulation of Non-Gaussian Stationary Random Process with Arbitrary Auto-Correlation Function"
year: 2023
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 13 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 3
pypi.org: generate-corr-sequence
Generate correlated random samples
- Homepage: https://github.com/bykhov/generate_corr_sequence
- Documentation: https://generate-corr-sequence.readthedocs.io/
- License: Copyright (c) 2023 The Python Packaging Authority Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 0.1.1
published almost 3 years ago
Rankings
Maintainers (3)
Dependencies
- matplotlib *
- numpy *
- scipy *
- statsmodels *