bayesloop 1.3__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. bayesloop-2.0.0/LICENSE +21 -0
  2. bayesloop-2.0.0/PKG-INFO +159 -0
  3. bayesloop-2.0.0/README.md +117 -0
  4. bayesloop-2.0.0/pyproject.toml +76 -0
  5. bayesloop-2.0.0/setup.cfg +4 -0
  6. bayesloop-2.0.0/src/bayesloop/__init__.py +32 -0
  7. {bayesloop-1.3 → bayesloop-2.0.0/src}/bayesloop/core.py +3007 -3000
  8. {bayesloop-1.3 → bayesloop-2.0.0/src}/bayesloop/exceptions.py +17 -17
  9. bayesloop-1.3/bayesloop/fileIO.py → bayesloop-2.0.0/src/bayesloop/file_io.py +37 -37
  10. {bayesloop-1.3 → bayesloop-2.0.0/src}/bayesloop/helper.py +142 -142
  11. {bayesloop-1.3 → bayesloop-2.0.0/src}/bayesloop/jeffreys.py +108 -108
  12. bayesloop-1.3/bayesloop/observationModels.py → bayesloop-2.0.0/src/bayesloop/observation_models.py +1003 -847
  13. {bayesloop-1.3 → bayesloop-2.0.0/src}/bayesloop/preprocessing.py +26 -26
  14. bayesloop-1.3/bayesloop/transitionModels.py → bayesloop-2.0.0/src/bayesloop/transition_models.py +954 -832
  15. bayesloop-2.0.0/src/bayesloop/v1compat.py +290 -0
  16. bayesloop-2.0.0/src/bayesloop.egg-info/PKG-INFO +159 -0
  17. bayesloop-2.0.0/src/bayesloop.egg-info/SOURCES.txt +27 -0
  18. bayesloop-2.0.0/src/bayesloop.egg-info/requires.txt +22 -0
  19. bayesloop-2.0.0/tests/test_changepointstudy.py +100 -0
  20. bayesloop-2.0.0/tests/test_fileio.py +18 -0
  21. bayesloop-2.0.0/tests/test_hyperstudy.py +262 -0
  22. bayesloop-2.0.0/tests/test_observationmodels.py +277 -0
  23. bayesloop-2.0.0/tests/test_onlinestudy.py +96 -0
  24. bayesloop-2.0.0/tests/test_plot.py +96 -0
  25. bayesloop-2.0.0/tests/test_study.py +410 -0
  26. bayesloop-2.0.0/tests/test_transitionmodels.py +200 -0
  27. bayesloop-2.0.0/tests/test_v1compat.py +211 -0
  28. bayesloop-1.3/PKG-INFO +0 -12
  29. bayesloop-1.3/bayesloop/__init__.py +0 -18
  30. bayesloop-1.3/bayesloop/parser.py +0 -435
  31. bayesloop-1.3/bayesloop.egg-info/PKG-INFO +0 -12
  32. bayesloop-1.3/bayesloop.egg-info/SOURCES.txt +0 -17
  33. bayesloop-1.3/bayesloop.egg-info/requires.txt +0 -6
  34. bayesloop-1.3/setup.cfg +0 -8
  35. bayesloop-1.3/setup.py +0 -18
  36. {bayesloop-1.3 → bayesloop-2.0.0/src}/bayesloop.egg-info/dependency_links.txt +0 -0
  37. {bayesloop-1.3 → bayesloop-2.0.0/src}/bayesloop.egg-info/top_level.txt +0 -0
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Christoph Mark
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,159 @@
1
+ Metadata-Version: 2.4
2
+ Name: bayesloop
3
+ Version: 2.0.0
4
+ Summary: Grid-based Bayesian modeling for time series with time-varying parameters.
5
+ Author-email: Christoph Mark <christoph.mark@fau.de>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, http://bayesloop.com
8
+ Project-URL: Repository, https://github.com/christophmark/bayesloop
9
+ Project-URL: Documentation, http://docs.bayesloop.com
10
+ Keywords: bayes,inference,model selection,time series,time-varying,marginal likelihood
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: cloudpickle>=2.2
23
+ Requires-Dist: joblib>=1.4
24
+ Requires-Dist: matplotlib>=3.7
25
+ Requires-Dist: numpy>=1.24
26
+ Requires-Dist: scipy>=1.10
27
+ Requires-Dist: sympy>=1.11
28
+ Requires-Dist: tqdm>=4.64
29
+ Provides-Extra: docs
30
+ Requires-Dist: ipykernel; extra == "docs"
31
+ Requires-Dist: ipywidgets; extra == "docs"
32
+ Requires-Dist: nbsphinx; extra == "docs"
33
+ Requires-Dist: pypandoc-binary; extra == "docs"
34
+ Requires-Dist: sphinx; extra == "docs"
35
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
36
+ Provides-Extra: speed
37
+ Requires-Dist: numba>=0.65; extra == "speed"
38
+ Provides-Extra: test
39
+ Requires-Dist: pytest>=8; extra == "test"
40
+ Requires-Dist: pytest-cov>=5; extra == "test"
41
+ Dynamic: license-file
42
+
43
+ [![bayesloop](https://raw.githubusercontent.com/christophmark/bayesloop/master/docs/images/logo_400x100px.png)](http://bayesloop.com)
44
+
45
+ [![Build status](https://github.com/christophmark/bayesloop/workflows/Tests/badge.svg?branch=master)](https://github.com/christophmark/bayesloop/actions/workflows/test.yml)
46
+ [![Documentation status](https://readthedocs.org/projects/bayesloop/badge/?version=latest)](http://docs.bayesloop.com)
47
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
48
+ [![DOI](https://zenodo.org/badge/41474112.svg)](https://zenodo.org/badge/latestdoi/41474112)
49
+
50
+ Time series analysis today is an important cornerstone of quantitative science in many disciplines, including natural and life sciences as well as economics and social sciences. Regarding diverse phenomena like tumor cell migration, brain activity and stock trading, a similarity of these complex systems becomes apparent: the observable data we measure – cell migration paths, neuron spike rates and stock prices – are the result of a multitude of underlying processes that act over a broad range of spatial and temporal scales. It is thus to expect that the statistical properties of these systems are not constant, but themselves show stochastic or deterministic dynamics of their own. Time series models used to understand the dynamics of complex systems therefore have to account for temporal changes of the models' parameters.
51
+
52
+ *bayesloop* is a python module that focuses on fitting time series models with time-varying parameters and model selection based on [Bayesian inference](https://cocosci.berkeley.edu/tom/papers/tutorial.pdf). Instead of relying on [MCMC methods](http://www.cs.ubc.ca/~arnaud/andrieu_defreitas_doucet_jordan_intromontecarlomachinelearning.pdf), *bayesloop* uses a grid-based approach to evaluate probability distributions, allowing for an efficient approximation of the [marginal likelihood (evidence)](http://alumni.media.mit.edu/~tpminka/statlearn/demo/). The marginal likelihood represents a powerful tool to objectively compare different models and/or optimize the hyper-parameters of hierarchical models. To avoid the [curse of dimensionality](https://en.wikipedia.org/wiki/Curse_of_dimensionality) when analyzing time series models with time-varying parameters, *bayesloop* employs a sequential inference algorithm that is based on the [forward-backward-algorithm](https://en.wikipedia.org/wiki/Forward%E2%80%93backward_algorithm) used in [Hidden Markov models](http://www.cs.sjsu.edu/~stamp/RUA/HMM.pdf). Here, the relevant parameter spaces are kept low-dimensional by processing time series data step by step. The module covers a large class of time series models and is easily extensible.
53
+
54
+ *bayesloop* has been successfully employed in cancer research (studying the migration paths of invasive tumor cells), financial risk assessment, climate research and accident analysis. For a detailed description of these applications, see the following articles:
55
+
56
+ **Bayesian model selection for complex dynamic systems**<br>
57
+ Mark C., Metzner C., Lautscham L., Strissel P.L., Strick R. and Fabry B.<br>
58
+ [*Nature Communications 9:1803 (2018)*](https://www.nature.com/articles/s41467-018-04241-5)
59
+
60
+ **Superstatistical analysis and modelling of heterogeneous random walks**<br>
61
+ Metzner C., Mark C., Steinwachs J., Lautscham L., Stadler F. and Fabry B.<br>
62
+ [*Nature Communications 6:7516 (2015)*](https://www.nature.com/articles/ncomms8516)
63
+
64
+ ## Features
65
+ * infer time-varying parameters from time series data
66
+ * compare hypotheses about parameter dynamics (model evidence)
67
+ * create custom models based on SymPy and SciPy
68
+ * straight-forward handling of missing data points
69
+ * predict future parameter values
70
+ * detect change-points and structural breaks in time series data
71
+ * employ model selection to online data streams
72
+
73
+ ## Getting started
74
+ For a comprehensive introduction and overview of the main features that *bayesloop* provides, see the [documentation](http://docs.bayesloop.com).
75
+
76
+ The following code provides a minimal example of an analysis carried out using *bayesloop*. The data here consists of the number of coal mining disasters in the UK per year from 1851 to 1962 (see this [article](http://www.dima.unige.it/~riccomag/Teaching/ProcessiStocastici/coal-mining-disaster-original%20paper.pdf) for further information).
77
+ ```python
78
+ import bayesloop as bl
79
+ import matplotlib.pyplot as plt
80
+ import seaborn as sns
81
+
82
+ S = bl.HyperStudy() # start new data study
83
+ S.load_example_data() # load data array
84
+
85
+ # observed number of disasters is modeled by Poisson distribution
86
+ L = bl.om.Poisson('rate')
87
+
88
+ # disaster rate itself may change gradually over time
89
+ T = bl.tm.GaussianRandomWalk('sigma', bl.cint(0, 1.0, 20), target='rate')
90
+
91
+ S.set(L, T)
92
+ S.fit() # inference
93
+
94
+ # plot data together with inferred parameter evolution
95
+ plt.figure(figsize=(8, 3))
96
+
97
+ plt.subplot2grid((1, 3), (0, 0), colspan=2)
98
+ plt.xlim([1852, 1961])
99
+ plt.bar(S.raw_timestamps, S.raw_data, align='center', facecolor='r', alpha=.5)
100
+ S.plot('rate')
101
+ plt.xlabel('year')
102
+
103
+ # plot hyper-parameter distribution
104
+ plt.subplot2grid((1, 3), (0, 2))
105
+ plt.xlim([0, 1])
106
+ S.plot('sigma', facecolor='g', alpha=0.7, lw=1, edgecolor='k')
107
+ plt.tight_layout()
108
+ plt.show()
109
+ ```
110
+
111
+ ![Analysis plot](https://raw.githubusercontent.com/christophmark/bayesloop/master/docs/images/example.png)
112
+
113
+ This analysis indicates a significant improvement of safety conditions between 1880 and 1900. Check out the [documentation](http://docs.bayesloop.com) for further insights!
114
+
115
+ ## Backwards compatibility with bayesloop 1.x
116
+
117
+ *bayesloop* 2.0 renames the entire API from camelCase to snake_case (e.g. `S.loadData(...)` becomes `S.load_data(...)`). Existing 1.x scripts can still be run without modification by importing the opt-in compatibility layer once, right after importing *bayesloop*:
118
+
119
+ ```python
120
+ import bayesloop as bl
121
+ import bayesloop.v1compat # activates the 1.x API
122
+
123
+ S = bl.HyperStudy()
124
+ S.loadExampleData() # 1.x method names work again
125
+ ```
126
+
127
+ The compatibility layer restores:
128
+ - all camelCase method, attribute and property names (`loadData`, `getParameterDistribution`, `logEvidence`, ...), including the 1.x shorthand aliases (`setOM`, `setTM`, `getPD`, ...)
129
+ - camelCase keyword arguments (`forwardOnly`, `nJobs`, `storeHistory`, ...)
130
+ - the 1.x module names `bayesloop.observationModels`, `bayesloop.transitionModels` and `bayesloop.fileIO`
131
+ - custom observation/transition models that implement 1.x hooks (`computeForwardPrior`, `estimateParameterValues`, ...)
132
+ - loading study files saved with *bayesloop* 1.x via `bl.load(...)` (attribute names are migrated on load)
133
+
134
+ Every use of a 1.x name emits a `DeprecationWarning` that points to its snake_case replacement, so the layer doubles as a migration guide. Two things are **not** covered: the probability `Parser` and `Study.eval()` were removed in 2.0, and the default parameter names of some transition models changed (`'tChange'` → `'t_change'`, `'tBreak'` → `'t_break'`, `'log10pMin'` → `'log10p_min'`) — scripts that rely on these default names should pass the names explicitly.
135
+
136
+ ## Installation
137
+ The easiest way to install the latest release version of *bayesloop* is via `pip`:
138
+ ```
139
+ pip install bayesloop
140
+ ```
141
+ Alternatively, a zipped version can be downloaded [here](https://github.com/christophmark/bayesloop/releases). The module is installed by calling `python -m pip install .` from the project root.
142
+
143
+ ### Development version
144
+ The latest development version of *bayesloop* can be installed from the `v2` branch using pip (requires git):
145
+ ```
146
+ pip install git+https://github.com/christophmark/bayesloop@v2
147
+ ```
148
+ Alternatively, clone the repository and install it in editable mode:
149
+ ```
150
+ python -m pip install -e ".[test]"
151
+ ```
152
+
153
+ ## Dependencies
154
+ *bayesloop* v2 supports Python 3.10 and newer. It depends on NumPy, SciPy, SymPy, matplotlib, tqdm, cloudpickle and joblib. Parallel computation for expensive `HyperStudy` and `ChangepointStudy` analyses is available with a normal install via `fit(n_jobs=...)`.
155
+
156
+ ## License
157
+ [The MIT License (MIT)](https://github.com/christophmark/bayesloop/blob/master/LICENSE)
158
+
159
+ If you have any further questions, suggestions or comments, do not hesitate to contact me: &#098;&#097;&#121;&#101;&#115;&#108;&#111;&#111;&#112;&#064;&#103;&#109;&#097;&#105;&#108;&#046;&#099;&#111;&#109;
@@ -0,0 +1,117 @@
1
+ [![bayesloop](https://raw.githubusercontent.com/christophmark/bayesloop/master/docs/images/logo_400x100px.png)](http://bayesloop.com)
2
+
3
+ [![Build status](https://github.com/christophmark/bayesloop/workflows/Tests/badge.svg?branch=master)](https://github.com/christophmark/bayesloop/actions/workflows/test.yml)
4
+ [![Documentation status](https://readthedocs.org/projects/bayesloop/badge/?version=latest)](http://docs.bayesloop.com)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+ [![DOI](https://zenodo.org/badge/41474112.svg)](https://zenodo.org/badge/latestdoi/41474112)
7
+
8
+ Time series analysis today is an important cornerstone of quantitative science in many disciplines, including natural and life sciences as well as economics and social sciences. Regarding diverse phenomena like tumor cell migration, brain activity and stock trading, a similarity of these complex systems becomes apparent: the observable data we measure – cell migration paths, neuron spike rates and stock prices – are the result of a multitude of underlying processes that act over a broad range of spatial and temporal scales. It is thus to expect that the statistical properties of these systems are not constant, but themselves show stochastic or deterministic dynamics of their own. Time series models used to understand the dynamics of complex systems therefore have to account for temporal changes of the models' parameters.
9
+
10
+ *bayesloop* is a python module that focuses on fitting time series models with time-varying parameters and model selection based on [Bayesian inference](https://cocosci.berkeley.edu/tom/papers/tutorial.pdf). Instead of relying on [MCMC methods](http://www.cs.ubc.ca/~arnaud/andrieu_defreitas_doucet_jordan_intromontecarlomachinelearning.pdf), *bayesloop* uses a grid-based approach to evaluate probability distributions, allowing for an efficient approximation of the [marginal likelihood (evidence)](http://alumni.media.mit.edu/~tpminka/statlearn/demo/). The marginal likelihood represents a powerful tool to objectively compare different models and/or optimize the hyper-parameters of hierarchical models. To avoid the [curse of dimensionality](https://en.wikipedia.org/wiki/Curse_of_dimensionality) when analyzing time series models with time-varying parameters, *bayesloop* employs a sequential inference algorithm that is based on the [forward-backward-algorithm](https://en.wikipedia.org/wiki/Forward%E2%80%93backward_algorithm) used in [Hidden Markov models](http://www.cs.sjsu.edu/~stamp/RUA/HMM.pdf). Here, the relevant parameter spaces are kept low-dimensional by processing time series data step by step. The module covers a large class of time series models and is easily extensible.
11
+
12
+ *bayesloop* has been successfully employed in cancer research (studying the migration paths of invasive tumor cells), financial risk assessment, climate research and accident analysis. For a detailed description of these applications, see the following articles:
13
+
14
+ **Bayesian model selection for complex dynamic systems**<br>
15
+ Mark C., Metzner C., Lautscham L., Strissel P.L., Strick R. and Fabry B.<br>
16
+ [*Nature Communications 9:1803 (2018)*](https://www.nature.com/articles/s41467-018-04241-5)
17
+
18
+ **Superstatistical analysis and modelling of heterogeneous random walks**<br>
19
+ Metzner C., Mark C., Steinwachs J., Lautscham L., Stadler F. and Fabry B.<br>
20
+ [*Nature Communications 6:7516 (2015)*](https://www.nature.com/articles/ncomms8516)
21
+
22
+ ## Features
23
+ * infer time-varying parameters from time series data
24
+ * compare hypotheses about parameter dynamics (model evidence)
25
+ * create custom models based on SymPy and SciPy
26
+ * straight-forward handling of missing data points
27
+ * predict future parameter values
28
+ * detect change-points and structural breaks in time series data
29
+ * employ model selection to online data streams
30
+
31
+ ## Getting started
32
+ For a comprehensive introduction and overview of the main features that *bayesloop* provides, see the [documentation](http://docs.bayesloop.com).
33
+
34
+ The following code provides a minimal example of an analysis carried out using *bayesloop*. The data here consists of the number of coal mining disasters in the UK per year from 1851 to 1962 (see this [article](http://www.dima.unige.it/~riccomag/Teaching/ProcessiStocastici/coal-mining-disaster-original%20paper.pdf) for further information).
35
+ ```python
36
+ import bayesloop as bl
37
+ import matplotlib.pyplot as plt
38
+ import seaborn as sns
39
+
40
+ S = bl.HyperStudy() # start new data study
41
+ S.load_example_data() # load data array
42
+
43
+ # observed number of disasters is modeled by Poisson distribution
44
+ L = bl.om.Poisson('rate')
45
+
46
+ # disaster rate itself may change gradually over time
47
+ T = bl.tm.GaussianRandomWalk('sigma', bl.cint(0, 1.0, 20), target='rate')
48
+
49
+ S.set(L, T)
50
+ S.fit() # inference
51
+
52
+ # plot data together with inferred parameter evolution
53
+ plt.figure(figsize=(8, 3))
54
+
55
+ plt.subplot2grid((1, 3), (0, 0), colspan=2)
56
+ plt.xlim([1852, 1961])
57
+ plt.bar(S.raw_timestamps, S.raw_data, align='center', facecolor='r', alpha=.5)
58
+ S.plot('rate')
59
+ plt.xlabel('year')
60
+
61
+ # plot hyper-parameter distribution
62
+ plt.subplot2grid((1, 3), (0, 2))
63
+ plt.xlim([0, 1])
64
+ S.plot('sigma', facecolor='g', alpha=0.7, lw=1, edgecolor='k')
65
+ plt.tight_layout()
66
+ plt.show()
67
+ ```
68
+
69
+ ![Analysis plot](https://raw.githubusercontent.com/christophmark/bayesloop/master/docs/images/example.png)
70
+
71
+ This analysis indicates a significant improvement of safety conditions between 1880 and 1900. Check out the [documentation](http://docs.bayesloop.com) for further insights!
72
+
73
+ ## Backwards compatibility with bayesloop 1.x
74
+
75
+ *bayesloop* 2.0 renames the entire API from camelCase to snake_case (e.g. `S.loadData(...)` becomes `S.load_data(...)`). Existing 1.x scripts can still be run without modification by importing the opt-in compatibility layer once, right after importing *bayesloop*:
76
+
77
+ ```python
78
+ import bayesloop as bl
79
+ import bayesloop.v1compat # activates the 1.x API
80
+
81
+ S = bl.HyperStudy()
82
+ S.loadExampleData() # 1.x method names work again
83
+ ```
84
+
85
+ The compatibility layer restores:
86
+ - all camelCase method, attribute and property names (`loadData`, `getParameterDistribution`, `logEvidence`, ...), including the 1.x shorthand aliases (`setOM`, `setTM`, `getPD`, ...)
87
+ - camelCase keyword arguments (`forwardOnly`, `nJobs`, `storeHistory`, ...)
88
+ - the 1.x module names `bayesloop.observationModels`, `bayesloop.transitionModels` and `bayesloop.fileIO`
89
+ - custom observation/transition models that implement 1.x hooks (`computeForwardPrior`, `estimateParameterValues`, ...)
90
+ - loading study files saved with *bayesloop* 1.x via `bl.load(...)` (attribute names are migrated on load)
91
+
92
+ Every use of a 1.x name emits a `DeprecationWarning` that points to its snake_case replacement, so the layer doubles as a migration guide. Two things are **not** covered: the probability `Parser` and `Study.eval()` were removed in 2.0, and the default parameter names of some transition models changed (`'tChange'` → `'t_change'`, `'tBreak'` → `'t_break'`, `'log10pMin'` → `'log10p_min'`) — scripts that rely on these default names should pass the names explicitly.
93
+
94
+ ## Installation
95
+ The easiest way to install the latest release version of *bayesloop* is via `pip`:
96
+ ```
97
+ pip install bayesloop
98
+ ```
99
+ Alternatively, a zipped version can be downloaded [here](https://github.com/christophmark/bayesloop/releases). The module is installed by calling `python -m pip install .` from the project root.
100
+
101
+ ### Development version
102
+ The latest development version of *bayesloop* can be installed from the `v2` branch using pip (requires git):
103
+ ```
104
+ pip install git+https://github.com/christophmark/bayesloop@v2
105
+ ```
106
+ Alternatively, clone the repository and install it in editable mode:
107
+ ```
108
+ python -m pip install -e ".[test]"
109
+ ```
110
+
111
+ ## Dependencies
112
+ *bayesloop* v2 supports Python 3.10 and newer. It depends on NumPy, SciPy, SymPy, matplotlib, tqdm, cloudpickle and joblib. Parallel computation for expensive `HyperStudy` and `ChangepointStudy` analyses is available with a normal install via `fit(n_jobs=...)`.
113
+
114
+ ## License
115
+ [The MIT License (MIT)](https://github.com/christophmark/bayesloop/blob/master/LICENSE)
116
+
117
+ If you have any further questions, suggestions or comments, do not hesitate to contact me: &#098;&#097;&#121;&#101;&#115;&#108;&#111;&#111;&#112;&#064;&#103;&#109;&#097;&#105;&#108;&#046;&#099;&#111;&#109;
@@ -0,0 +1,76 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "bayesloop"
7
+ version = "2.0.0"
8
+ description = "Grid-based Bayesian modeling for time series with time-varying parameters."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "Christoph Mark", email = "christoph.mark@fau.de" },
14
+ ]
15
+ keywords = [
16
+ "bayes",
17
+ "inference",
18
+ "model selection",
19
+ "time series",
20
+ "time-varying",
21
+ "marginal likelihood",
22
+ ]
23
+ classifiers = [
24
+ "Development Status :: 5 - Production/Stable",
25
+ "Intended Audience :: Science/Research",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Topic :: Scientific/Engineering",
32
+ ]
33
+ dependencies = [
34
+ "cloudpickle>=2.2",
35
+ "joblib>=1.4",
36
+ "matplotlib>=3.7",
37
+ "numpy>=1.24",
38
+ "scipy>=1.10",
39
+ "sympy>=1.11",
40
+ "tqdm>=4.64",
41
+ ]
42
+
43
+ [project.optional-dependencies]
44
+ docs = [
45
+ "ipykernel",
46
+ "ipywidgets",
47
+ "nbsphinx",
48
+ "pypandoc-binary",
49
+ "sphinx",
50
+ "sphinx-rtd-theme",
51
+ ]
52
+ speed = [
53
+ "numba>=0.65",
54
+ ]
55
+ test = [
56
+ "pytest>=8",
57
+ "pytest-cov>=5",
58
+ ]
59
+
60
+ [project.urls]
61
+ Homepage = "http://bayesloop.com"
62
+ Repository = "https://github.com/christophmark/bayesloop"
63
+ Documentation = "http://docs.bayesloop.com"
64
+
65
+ [tool.setuptools]
66
+ package-dir = { "" = "src" }
67
+
68
+ [tool.setuptools.packages.find]
69
+ where = ["src"]
70
+
71
+ [tool.pytest.ini_options]
72
+ testpaths = ["tests"]
73
+ addopts = "-ra"
74
+
75
+ [tool.coverage.run]
76
+ source = ["bayesloop"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env python
2
+
3
+ # import study types
4
+ from .core import Study, HyperStudy, ChangepointStudy, OnlineStudy
5
+
6
+ # observation models and transition models need to be distinguishable
7
+ from . import observation_models
8
+ from . import observation_models as om # short form
9
+ from . import transition_models
10
+ from . import transition_models as tm # short form
11
+
12
+ # misc
13
+ from .helper import cint, oint
14
+ from .jeffreys import get_jeffreys_prior, compute_jeffreys_prior_ar1
15
+ from .file_io import save, load
16
+
17
+ __all__ = [
18
+ "Study",
19
+ "HyperStudy",
20
+ "ChangepointStudy",
21
+ "OnlineStudy",
22
+ "observation_models",
23
+ "transition_models",
24
+ "om",
25
+ "tm",
26
+ "cint",
27
+ "oint",
28
+ "get_jeffreys_prior",
29
+ "compute_jeffreys_prior_ar1",
30
+ "save",
31
+ "load",
32
+ ]