|
10 | 10 | alt="Codecov Badge" |
11 | 11 | /> |
12 | 12 |
|
13 | | -As PyMC continues to mature and expand its functionality to accommodate more domains of application, we increasingly see cutting-edge methodologies, highly specialized statistical distributions, and complex models appear. |
14 | | -While this adds to the functionality and relevance of the project, it can also introduce instability and impose a burden on testing and quality control. |
15 | | -To reduce the burden on the main `pymc` repository, this `pymc-extras` repository can become the aggregator and testing ground for new additions to PyMC. |
16 | | -This may include unusual probability distributions, advanced model fitting algorithms, innovative yet not fully tested methods, or niche functionality that might not fit in the main PyMC repository, but still may be of interest to users. |
| 13 | +PyMC Extras extends [PyMC](https://www.pymc.io) with additional distributions, inference methods, and model transformations. |
| 14 | +It is maintained by the PyMC team and hosts functionality that is too specialized for the core library, but useful enough that you shouldn't have to write it yourself. |
17 | 15 |
|
18 | | -The `pymc-extras` repository can be understood as the first step in the PyMC development pipeline, where all novel code is introduced until it is obvious that it belongs in the main repository. |
19 | | -We hope that this organization improves the stability and streamlines the testing overhead of the `pymc` repository, while allowing users and developers to test and evaluate cutting-edge methods and not yet fully mature features. |
| 16 | +Highlights include: |
20 | 17 |
|
21 | | -`pymc-extras` would be designed to mirror the namespaces in `pymc` to make usage and migration as easy as possible. |
22 | | -For example, a `ParabolicFractal` distribution could be used analogously to those in `pymc`: |
| 18 | +- Automatic marginalization: exact for finite discrete and conjugate variables, approximate via the Laplace approximation |
| 19 | +- Alternative inference methods: Pathfinder, DADVI, INLA, Laplace approximation, and better MAP estimation |
| 20 | +- Statespace models: SARIMAX, VARMAX, ETS, and structural time series with Kalman filtering |
| 21 | +- Additional distributions such as `DiscreteMarkovChain`, `GeneralizedPoisson`, and `GenExtreme` |
| 22 | + |
| 23 | +`pymc-extras` mirrors the namespaces in `pymc` to make usage and migration as easy as possible. |
| 24 | +For example, distributions are used exactly like those in `pymc`: |
23 | 25 |
|
24 | 26 | ```python |
25 | 27 | import pymc as pm |
26 | 28 | import pymc_extras as pmx |
27 | 29 |
|
28 | 30 | with pm.Model(): |
29 | | - alpha = pmx.ParabolicFractal('alpha', b=1, c=1) |
| 31 | + xi = pm.HalfNormal("xi", 0.2) |
| 32 | + pmx.GenExtreme("llik", mu=1, sigma=0.5, xi=xi, observed=data) |
| 33 | +``` |
| 34 | + |
| 35 | +See the [documentation](https://pymc-extras.readthedocs.io/) for the full API reference. |
| 36 | + |
| 37 | +## Installation |
| 38 | + |
| 39 | +```bash |
| 40 | +pip install pymc-extras |
| 41 | +``` |
30 | 42 |
|
31 | | - ... |
| 43 | +or for the development version: |
32 | 44 |
|
| 45 | +```bash |
| 46 | +pip install git+https://github.com/pymc-devs/pymc-extras.git |
33 | 47 | ``` |
34 | 48 |
|
35 | 49 | ## Questions |
36 | 50 |
|
37 | 51 | ### What belongs in `pymc-extras`? |
38 | 52 |
|
39 | | -- newly-implemented statistical methods, for example step methods or model construction helpers |
| 53 | +- statistical methods, for example step methods or model construction helpers |
40 | 54 | - distributions that are tricky to sample from or test |
41 | | -- infrequently-used fitting methods or distributions |
| 55 | +- specialized fitting methods or distributions |
42 | 56 | - any code that requires additional optimization before it can be used in practice |
43 | 57 |
|
| 58 | +Functionality that proves widely useful may graduate to the main `pymc` repository. |
44 | 59 |
|
45 | 60 | ### What does not belong in `pymc-extras`? |
46 | 61 | - Case studies |
47 | 62 | - Implementations that cannot be applied generically, for example because they are tied to variables from a toy example |
48 | 63 |
|
| 64 | +## Contributing |
49 | 65 |
|
50 | | -### Should there be more than one add-on repository? |
51 | | - |
52 | | -Since there is a lot of code that we may not want in the main repository, does it make sense to have more than one additional repository? |
53 | | -For example, `pymc-extras` may just include methods that are not fully developed, tested and trusted, while code that is known to work well and has adequate test coverage, but is still too specialized to become part of `pymc` could reside in a `pymc-extras` (or similar) repository. |
54 | | - |
55 | | - |
56 | | -### Unanswered questions & ToDos |
57 | | -This project is still young and many things have not been answered or implemented. |
58 | | -Please get involved! |
59 | | - |
60 | | -* What are guidelines for organizing submodules? |
61 | | - * Proposal: No default imports of WIP/unstable submodules. By importing manually we can avoid breaking the package if a submodule breaks, for example because of an updated dependency. |
| 66 | +We welcome contributions! Check out the [contributing guidelines](https://github.com/pymc-devs/pymc-extras/blob/main/CONTRIBUTING.md) to get started. |
0 commit comments