pymc-extras 0.2.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 (113) hide show
  1. pymc_extras-0.2.0/CODE_OF_CONDUCT.md +78 -0
  2. pymc_extras-0.2.0/CONTRIBUTING.md +3 -0
  3. pymc_extras-0.2.0/LICENSE +212 -0
  4. pymc_extras-0.2.0/MANIFEST.in +5 -0
  5. pymc_extras-0.2.0/PKG-INFO +99 -0
  6. pymc_extras-0.2.0/README.md +62 -0
  7. pymc_extras-0.2.0/pymc_extras/__init__.py +29 -0
  8. pymc_extras-0.2.0/pymc_extras/distributions/__init__.py +40 -0
  9. pymc_extras-0.2.0/pymc_extras/distributions/continuous.py +351 -0
  10. pymc_extras-0.2.0/pymc_extras/distributions/discrete.py +399 -0
  11. pymc_extras-0.2.0/pymc_extras/distributions/histogram_utils.py +163 -0
  12. pymc_extras-0.2.0/pymc_extras/distributions/multivariate/__init__.py +3 -0
  13. pymc_extras-0.2.0/pymc_extras/distributions/multivariate/r2d2m2cp.py +446 -0
  14. pymc_extras-0.2.0/pymc_extras/distributions/timeseries.py +356 -0
  15. pymc_extras-0.2.0/pymc_extras/gp/__init__.py +18 -0
  16. pymc_extras-0.2.0/pymc_extras/gp/latent_approx.py +183 -0
  17. pymc_extras-0.2.0/pymc_extras/inference/__init__.py +18 -0
  18. pymc_extras-0.2.0/pymc_extras/inference/find_map.py +431 -0
  19. pymc_extras-0.2.0/pymc_extras/inference/fit.py +44 -0
  20. pymc_extras-0.2.0/pymc_extras/inference/laplace.py +570 -0
  21. pymc_extras-0.2.0/pymc_extras/inference/pathfinder.py +134 -0
  22. pymc_extras-0.2.0/pymc_extras/inference/smc/__init__.py +13 -0
  23. pymc_extras-0.2.0/pymc_extras/inference/smc/sampling.py +451 -0
  24. pymc_extras-0.2.0/pymc_extras/linearmodel.py +130 -0
  25. pymc_extras-0.2.0/pymc_extras/model/__init__.py +0 -0
  26. pymc_extras-0.2.0/pymc_extras/model/marginal/__init__.py +0 -0
  27. pymc_extras-0.2.0/pymc_extras/model/marginal/distributions.py +276 -0
  28. pymc_extras-0.2.0/pymc_extras/model/marginal/graph_analysis.py +372 -0
  29. pymc_extras-0.2.0/pymc_extras/model/marginal/marginal_model.py +595 -0
  30. pymc_extras-0.2.0/pymc_extras/model/model_api.py +56 -0
  31. pymc_extras-0.2.0/pymc_extras/model/transforms/__init__.py +0 -0
  32. pymc_extras-0.2.0/pymc_extras/model/transforms/autoreparam.py +434 -0
  33. pymc_extras-0.2.0/pymc_extras/model_builder.py +759 -0
  34. pymc_extras-0.2.0/pymc_extras/preprocessing/__init__.py +0 -0
  35. pymc_extras-0.2.0/pymc_extras/preprocessing/standard_scaler.py +17 -0
  36. pymc_extras-0.2.0/pymc_extras/printing.py +182 -0
  37. pymc_extras-0.2.0/pymc_extras/statespace/__init__.py +13 -0
  38. pymc_extras-0.2.0/pymc_extras/statespace/core/__init__.py +7 -0
  39. pymc_extras-0.2.0/pymc_extras/statespace/core/compile.py +48 -0
  40. pymc_extras-0.2.0/pymc_extras/statespace/core/representation.py +438 -0
  41. pymc_extras-0.2.0/pymc_extras/statespace/core/statespace.py +2268 -0
  42. pymc_extras-0.2.0/pymc_extras/statespace/filters/__init__.py +15 -0
  43. pymc_extras-0.2.0/pymc_extras/statespace/filters/distributions.py +453 -0
  44. pymc_extras-0.2.0/pymc_extras/statespace/filters/kalman_filter.py +820 -0
  45. pymc_extras-0.2.0/pymc_extras/statespace/filters/kalman_smoother.py +126 -0
  46. pymc_extras-0.2.0/pymc_extras/statespace/filters/utilities.py +59 -0
  47. pymc_extras-0.2.0/pymc_extras/statespace/models/ETS.py +670 -0
  48. pymc_extras-0.2.0/pymc_extras/statespace/models/SARIMAX.py +536 -0
  49. pymc_extras-0.2.0/pymc_extras/statespace/models/VARMAX.py +393 -0
  50. pymc_extras-0.2.0/pymc_extras/statespace/models/__init__.py +6 -0
  51. pymc_extras-0.2.0/pymc_extras/statespace/models/structural.py +1651 -0
  52. pymc_extras-0.2.0/pymc_extras/statespace/models/utilities.py +387 -0
  53. pymc_extras-0.2.0/pymc_extras/statespace/utils/__init__.py +0 -0
  54. pymc_extras-0.2.0/pymc_extras/statespace/utils/constants.py +74 -0
  55. pymc_extras-0.2.0/pymc_extras/statespace/utils/coord_tools.py +0 -0
  56. pymc_extras-0.2.0/pymc_extras/statespace/utils/data_tools.py +182 -0
  57. pymc_extras-0.2.0/pymc_extras/utils/__init__.py +23 -0
  58. pymc_extras-0.2.0/pymc_extras/utils/linear_cg.py +290 -0
  59. pymc_extras-0.2.0/pymc_extras/utils/pivoted_cholesky.py +69 -0
  60. pymc_extras-0.2.0/pymc_extras/utils/prior.py +200 -0
  61. pymc_extras-0.2.0/pymc_extras/utils/spline.py +131 -0
  62. pymc_extras-0.2.0/pymc_extras/version.py +11 -0
  63. pymc_extras-0.2.0/pymc_extras/version.txt +1 -0
  64. pymc_extras-0.2.0/pymc_extras.egg-info/PKG-INFO +99 -0
  65. pymc_extras-0.2.0/pymc_extras.egg-info/SOURCES.txt +111 -0
  66. pymc_extras-0.2.0/pymc_extras.egg-info/dependency_links.txt +1 -0
  67. pymc_extras-0.2.0/pymc_extras.egg-info/requires.txt +18 -0
  68. pymc_extras-0.2.0/pymc_extras.egg-info/top_level.txt +2 -0
  69. pymc_extras-0.2.0/pyproject.toml +80 -0
  70. pymc_extras-0.2.0/requirements-dev.txt +5 -0
  71. pymc_extras-0.2.0/requirements-docs.txt +4 -0
  72. pymc_extras-0.2.0/requirements.txt +2 -0
  73. pymc_extras-0.2.0/setup.cfg +4 -0
  74. pymc_extras-0.2.0/setup.py +96 -0
  75. pymc_extras-0.2.0/tests/__init__.py +13 -0
  76. pymc_extras-0.2.0/tests/distributions/__init__.py +19 -0
  77. pymc_extras-0.2.0/tests/distributions/test_continuous.py +185 -0
  78. pymc_extras-0.2.0/tests/distributions/test_discrete.py +210 -0
  79. pymc_extras-0.2.0/tests/distributions/test_discrete_markov_chain.py +258 -0
  80. pymc_extras-0.2.0/tests/distributions/test_multivariate.py +304 -0
  81. pymc_extras-0.2.0/tests/model/__init__.py +0 -0
  82. pymc_extras-0.2.0/tests/model/marginal/__init__.py +0 -0
  83. pymc_extras-0.2.0/tests/model/marginal/test_distributions.py +131 -0
  84. pymc_extras-0.2.0/tests/model/marginal/test_graph_analysis.py +182 -0
  85. pymc_extras-0.2.0/tests/model/marginal/test_marginal_model.py +867 -0
  86. pymc_extras-0.2.0/tests/model/test_model_api.py +29 -0
  87. pymc_extras-0.2.0/tests/statespace/__init__.py +0 -0
  88. pymc_extras-0.2.0/tests/statespace/test_ETS.py +411 -0
  89. pymc_extras-0.2.0/tests/statespace/test_SARIMAX.py +405 -0
  90. pymc_extras-0.2.0/tests/statespace/test_VARMAX.py +184 -0
  91. pymc_extras-0.2.0/tests/statespace/test_coord_assignment.py +116 -0
  92. pymc_extras-0.2.0/tests/statespace/test_distributions.py +270 -0
  93. pymc_extras-0.2.0/tests/statespace/test_kalman_filter.py +326 -0
  94. pymc_extras-0.2.0/tests/statespace/test_representation.py +175 -0
  95. pymc_extras-0.2.0/tests/statespace/test_statespace.py +818 -0
  96. pymc_extras-0.2.0/tests/statespace/test_statespace_JAX.py +156 -0
  97. pymc_extras-0.2.0/tests/statespace/test_structural.py +829 -0
  98. pymc_extras-0.2.0/tests/statespace/utilities/__init__.py +0 -0
  99. pymc_extras-0.2.0/tests/statespace/utilities/shared_fixtures.py +9 -0
  100. pymc_extras-0.2.0/tests/statespace/utilities/statsmodel_local_level.py +42 -0
  101. pymc_extras-0.2.0/tests/statespace/utilities/test_helpers.py +310 -0
  102. pymc_extras-0.2.0/tests/test_blackjax_smc.py +222 -0
  103. pymc_extras-0.2.0/tests/test_find_map.py +98 -0
  104. pymc_extras-0.2.0/tests/test_histogram_approximation.py +109 -0
  105. pymc_extras-0.2.0/tests/test_laplace.py +238 -0
  106. pymc_extras-0.2.0/tests/test_linearmodel.py +208 -0
  107. pymc_extras-0.2.0/tests/test_model_builder.py +306 -0
  108. pymc_extras-0.2.0/tests/test_pathfinder.py +45 -0
  109. pymc_extras-0.2.0/tests/test_pivoted_cholesky.py +24 -0
  110. pymc_extras-0.2.0/tests/test_printing.py +98 -0
  111. pymc_extras-0.2.0/tests/test_prior_from_trace.py +172 -0
  112. pymc_extras-0.2.0/tests/test_splines.py +77 -0
  113. pymc_extras-0.2.0/tests/utils.py +31 -0
@@ -0,0 +1,78 @@
1
+ # PyMC Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting PyMC developer Christopher Fonnesbeck via email
59
+ (chris.fonnesbeck@vanderbilt.edu) or phone (615-955-0380). Alternatively, you
60
+ may also contact NumFOCUS Executive Director Leah Silen (512-222-5449) or
61
+ fill an anonymous report using [NumFOCUS Typeform](https://numfocus.typeform.com/to/ynjGdT).
62
+ As PyMC is a member of NumFOCUS and subscribes to their code of conduct as a
63
+ precondition for continued membership. All complaints will be reviewed and
64
+ investigated and will result in a response that is deemed necessary and
65
+ appropriate to the circumstances. The project team is obligated to maintain
66
+ confidentiality with regard to the reporter of an incident. Further details of
67
+ specific enforcement policies may be posted separately.
68
+
69
+ Project maintainers who do not follow or enforce the Code of Conduct in good
70
+ faith may face temporary or permanent repercussions as determined by other
71
+ members of the project's leadership.
72
+
73
+ ## Attribution
74
+
75
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
76
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
77
+
78
+ [homepage]: https://www.contributor-covenant.org
@@ -0,0 +1,3 @@
1
+ # Contributing guide
2
+
3
+ Page in construction, for now go to https://github.com/pymc-devs/pymc-extras#questions.
@@ -0,0 +1,212 @@
1
+ =======
2
+ License
3
+ =======
4
+
5
+ PyMC is distributed under the Apache License, Version 2.0
6
+
7
+ Copyright (c) 2006 Christopher J. Fonnesbeck (Academic Free License)
8
+ Copyright (c) 2007-2008 Christopher J. Fonnesbeck, Anand Prabhakar Patil, David Huard (Academic Free License)
9
+ Copyright (c) 2009-2017 The PyMC developers (see contributors to pymc-devs on GitHub)
10
+ All rights reserved.
11
+
12
+ Apache License
13
+ Version 2.0, January 2004
14
+ http://www.apache.org/licenses/
15
+
16
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
17
+
18
+ 1. Definitions.
19
+
20
+ "License" shall mean the terms and conditions for use, reproduction,
21
+ and distribution as defined by Sections 1 through 9 of this document.
22
+
23
+ "Licensor" shall mean the copyright owner or entity authorized by
24
+ the copyright owner that is granting the License.
25
+
26
+ "Legal Entity" shall mean the union of the acting entity and all
27
+ other entities that control, are controlled by, or are under common
28
+ control with that entity. For the purposes of this definition,
29
+ "control" means (i) the power, direct or indirect, to cause the
30
+ direction or management of such entity, whether by contract or
31
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
32
+ outstanding shares, or (iii) beneficial ownership of such entity.
33
+
34
+ "You" (or "Your") shall mean an individual or Legal Entity
35
+ exercising permissions granted by this License.
36
+
37
+ "Source" form shall mean the preferred form for making modifications,
38
+ including but not limited to software source code, documentation
39
+ source, and configuration files.
40
+
41
+ "Object" form shall mean any form resulting from mechanical
42
+ transformation or translation of a Source form, including but
43
+ not limited to compiled object code, generated documentation,
44
+ and conversions to other media types.
45
+
46
+ "Work" shall mean the work of authorship, whether in Source or
47
+ Object form, made available under the License, as indicated by a
48
+ copyright notice that is included in or attached to the work
49
+ (an example is provided in the Appendix below).
50
+
51
+ "Derivative Works" shall mean any work, whether in Source or Object
52
+ form, that is based on (or derived from) the Work and for which the
53
+ editorial revisions, annotations, elaborations, or other modifications
54
+ represent, as a whole, an original work of authorship. For the purposes
55
+ of this License, Derivative Works shall not include works that remain
56
+ separable from, or merely link (or bind by name) to the interfaces of,
57
+ the Work and Derivative Works thereof.
58
+
59
+ "Contribution" shall mean any work of authorship, including
60
+ the original version of the Work and any modifications or additions
61
+ to that Work or Derivative Works thereof, that is intentionally
62
+ submitted to Licensor for inclusion in the Work by the copyright owner
63
+ or by an individual or Legal Entity authorized to submit on behalf of
64
+ the copyright owner. For the purposes of this definition, "submitted"
65
+ means any form of electronic, verbal, or written communication sent
66
+ to the Licensor or its representatives, including but not limited to
67
+ communication on electronic mailing lists, source code control systems,
68
+ and issue tracking systems that are managed by, or on behalf of, the
69
+ Licensor for the purpose of discussing and improving the Work, but
70
+ excluding communication that is conspicuously marked or otherwise
71
+ designated in writing by the copyright owner as "Not a Contribution."
72
+
73
+ "Contributor" shall mean Licensor and any individual or Legal Entity
74
+ on behalf of whom a Contribution has been received by Licensor and
75
+ subsequently incorporated within the Work.
76
+
77
+ 2. Grant of Copyright License. Subject to the terms and conditions of
78
+ this License, each Contributor hereby grants to You a perpetual,
79
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
80
+ copyright license to reproduce, prepare Derivative Works of,
81
+ publicly display, publicly perform, sublicense, and distribute the
82
+ Work and such Derivative Works in Source or Object form.
83
+
84
+ 3. Grant of Patent License. Subject to the terms and conditions of
85
+ this License, each Contributor hereby grants to You a perpetual,
86
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
87
+ (except as stated in this section) patent license to make, have made,
88
+ use, offer to sell, sell, import, and otherwise transfer the Work,
89
+ where such license applies only to those patent claims licensable
90
+ by such Contributor that are necessarily infringed by their
91
+ Contribution(s) alone or by combination of their Contribution(s)
92
+ with the Work to which such Contribution(s) was submitted. If You
93
+ institute patent litigation against any entity (including a
94
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
95
+ or a Contribution incorporated within the Work constitutes direct
96
+ or contributory patent infringement, then any patent licenses
97
+ granted to You under this License for that Work shall terminate
98
+ as of the date such litigation is filed.
99
+
100
+ 4. Redistribution. You may reproduce and distribute copies of the
101
+ Work or Derivative Works thereof in any medium, with or without
102
+ modifications, and in Source or Object form, provided that You
103
+ meet the following conditions:
104
+
105
+ (a) You must give any other recipients of the Work or
106
+ Derivative Works a copy of this License; and
107
+
108
+ (b) You must cause any modified files to carry prominent notices
109
+ stating that You changed the files; and
110
+
111
+ (c) You must retain, in the Source form of any Derivative Works
112
+ that You distribute, all copyright, patent, trademark, and
113
+ attribution notices from the Source form of the Work,
114
+ excluding those notices that do not pertain to any part of
115
+ the Derivative Works; and
116
+
117
+ (d) If the Work includes a "NOTICE" text file as part of its
118
+ distribution, then any Derivative Works that You distribute must
119
+ include a readable copy of the attribution notices contained
120
+ within such NOTICE file, excluding those notices that do not
121
+ pertain to any part of the Derivative Works, in at least one
122
+ of the following places: within a NOTICE text file distributed
123
+ as part of the Derivative Works; within the Source form or
124
+ documentation, if provided along with the Derivative Works; or,
125
+ within a display generated by the Derivative Works, if and
126
+ wherever such third-party notices normally appear. The contents
127
+ of the NOTICE file are for informational purposes only and
128
+ do not modify the License. You may add Your own attribution
129
+ notices within Derivative Works that You distribute, alongside
130
+ or as an addendum to the NOTICE text from the Work, provided
131
+ that such additional attribution notices cannot be construed
132
+ as modifying the License.
133
+
134
+ You may add Your own copyright statement to Your modifications and
135
+ may provide additional or different license terms and conditions
136
+ for use, reproduction, or distribution of Your modifications, or
137
+ for any such Derivative Works as a whole, provided Your use,
138
+ reproduction, and distribution of the Work otherwise complies with
139
+ the conditions stated in this License.
140
+
141
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
142
+ any Contribution intentionally submitted for inclusion in the Work
143
+ by You to the Licensor shall be under the terms and conditions of
144
+ this License, without any additional terms or conditions.
145
+ Notwithstanding the above, nothing herein shall supersede or modify
146
+ the terms of any separate license agreement you may have executed
147
+ with Licensor regarding such Contributions.
148
+
149
+ 6. Trademarks. This License does not grant permission to use the trade
150
+ names, trademarks, service marks, or product names of the Licensor,
151
+ except as required for reasonable and customary use in describing the
152
+ origin of the Work and reproducing the content of the NOTICE file.
153
+
154
+ 7. Disclaimer of Warranty. Unless required by applicable law or
155
+ agreed to in writing, Licensor provides the Work (and each
156
+ Contributor provides its Contributions) on an "AS IS" BASIS,
157
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
158
+ implied, including, without limitation, any warranties or conditions
159
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
160
+ PARTICULAR PURPOSE. You are solely responsible for determining the
161
+ appropriateness of using or redistributing the Work and assume any
162
+ risks associated with Your exercise of permissions under this License.
163
+
164
+ 8. Limitation of Liability. In no event and under no legal theory,
165
+ whether in tort (including negligence), contract, or otherwise,
166
+ unless required by applicable law (such as deliberate and grossly
167
+ negligent acts) or agreed to in writing, shall any Contributor be
168
+ liable to You for damages, including any direct, indirect, special,
169
+ incidental, or consequential damages of any character arising as a
170
+ result of this License or out of the use or inability to use the
171
+ Work (including but not limited to damages for loss of goodwill,
172
+ work stoppage, computer failure or malfunction, or any and all
173
+ other commercial damages or losses), even if such Contributor
174
+ has been advised of the possibility of such damages.
175
+
176
+ 9. Accepting Warranty or Additional Liability. While redistributing
177
+ the Work or Derivative Works thereof, You may choose to offer,
178
+ and charge a fee for, acceptance of support, warranty, indemnity,
179
+ or other liability obligations and/or rights consistent with this
180
+ License. However, in accepting such obligations, You may act only
181
+ on Your own behalf and on Your sole responsibility, not on behalf
182
+ of any other Contributor, and only if You agree to indemnify,
183
+ defend, and hold each Contributor harmless for any liability
184
+ incurred by, or claims asserted against, such Contributor by reason
185
+ of your accepting any such warranty or additional liability.
186
+
187
+ END OF TERMS AND CONDITIONS
188
+
189
+ APPENDIX: How to apply the Apache License to your work.
190
+
191
+ To apply the Apache License to your work, attach the following
192
+ boilerplate notice, with the fields enclosed by brackets "[]"
193
+ replaced with your own identifying information. (Don't include
194
+ the brackets!) The text should be enclosed in the appropriate
195
+ comment syntax for the file format. We also recommend that a
196
+ file or class name and description of purpose be included on the
197
+ same "printed page" as the copyright notice for easier
198
+ identification within third-party archives.
199
+
200
+ Copyright 2020 The PyMC Developers
201
+
202
+ Licensed under the Apache License, Version 2.0 (the "License");
203
+ you may not use this file except in compliance with the License.
204
+ You may obtain a copy of the License at
205
+
206
+ http://www.apache.org/licenses/LICENSE-2.0
207
+
208
+ Unless required by applicable law or agreed to in writing, software
209
+ distributed under the License is distributed on an "AS IS" BASIS,
210
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
211
+ See the License for the specific language governing permissions and
212
+ limitations under the License.
@@ -0,0 +1,5 @@
1
+ include requirements*.txt
2
+ include *.md *.rst
3
+ include LICENSE
4
+ include README.md
5
+ include pymc_extras/version.txt
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.1
2
+ Name: pymc-extras
3
+ Version: 0.2.0
4
+ Summary: A home for new additions to PyMC, which may include unusual probability distribitions, advanced model fitting algorithms, or any code that may be inappropriate to include in the pymc repository, but may want to be made available to users.
5
+ Home-page: http://github.com/pymc-devs/pymc-extras
6
+ Maintainer: PyMC Developers
7
+ Maintainer-email: pymc.devs@gmail.com
8
+ License: Apache License, Version 2.0
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
19
+ Classifier: Operating System :: OS Independent
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: pymc>=5.19.1
24
+ Requires-Dist: scikit-learn
25
+ Provides-Extra: dask-histogram
26
+ Requires-Dist: dask[complete]; extra == "dask-histogram"
27
+ Requires-Dist: xhistogram; extra == "dask-histogram"
28
+ Provides-Extra: histogram
29
+ Requires-Dist: xhistogram; extra == "histogram"
30
+ Provides-Extra: complete
31
+ Requires-Dist: dask[complete]; extra == "complete"
32
+ Requires-Dist: xhistogram; extra == "complete"
33
+ Provides-Extra: dev
34
+ Requires-Dist: dask[all]; extra == "dev"
35
+ Requires-Dist: blackjax; extra == "dev"
36
+ Requires-Dist: statsmodels; extra == "dev"
37
+
38
+ # Welcome to `pymc-extras`
39
+ <a href="https://gitpod.io/#https://github.com/pymc-devs/pymc-extras">
40
+ <img
41
+ src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
42
+ alt="Contribute with Gitpod"
43
+ />
44
+ </a>
45
+ <img
46
+ src="https://codecov.io/gh/pymc-devs/pymc-extras/branch/main/graph/badge.svg"
47
+ alt="Codecov Badge"
48
+ />
49
+
50
+ 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.
51
+ 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.
52
+ 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.
53
+ 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.
54
+
55
+ 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.
56
+ 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.
57
+
58
+ `pymc-extras` would be designed to mirror the namespaces in `pymc` to make usage and migration as easy as possible.
59
+ For example, a `ParabolicFractal` distribution could be used analogously to those in `pymc`:
60
+
61
+ ```python
62
+ import pymc as pm
63
+ import pymc_extras as pmx
64
+
65
+ with pm.Model():
66
+
67
+ alpha = pmx.ParabolicFractal('alpha', b=1, c=1)
68
+
69
+ ...
70
+
71
+ ```
72
+
73
+ ## Questions
74
+
75
+ ### What belongs in `pymc-extras`?
76
+
77
+ - newly-implemented statistical methods, for example step methods or model construction helpers
78
+ - distributions that are tricky to sample from or test
79
+ - infrequently-used fitting methods or distributions
80
+ - any code that requires additional optimization before it can be used in practice
81
+
82
+
83
+ ### What does not belong in `pymc-extras`?
84
+ - Case studies
85
+ - Implementations that cannot be applied generically, for example because they are tied to variables from a toy example
86
+
87
+
88
+ ### Should there be more than one add-on repository?
89
+
90
+ 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?
91
+ 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.
92
+
93
+
94
+ ### Unanswered questions & ToDos
95
+ This project is still young and many things have not been answered or implemented.
96
+ Please get involved!
97
+
98
+ * What are guidelines for organizing submodules?
99
+ * 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.
@@ -0,0 +1,62 @@
1
+ # Welcome to `pymc-extras`
2
+ <a href="https://gitpod.io/#https://github.com/pymc-devs/pymc-extras">
3
+ <img
4
+ src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
5
+ alt="Contribute with Gitpod"
6
+ />
7
+ </a>
8
+ <img
9
+ src="https://codecov.io/gh/pymc-devs/pymc-extras/branch/main/graph/badge.svg"
10
+ alt="Codecov Badge"
11
+ />
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.
17
+
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.
20
+
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`:
23
+
24
+ ```python
25
+ import pymc as pm
26
+ import pymc_extras as pmx
27
+
28
+ with pm.Model():
29
+
30
+ alpha = pmx.ParabolicFractal('alpha', b=1, c=1)
31
+
32
+ ...
33
+
34
+ ```
35
+
36
+ ## Questions
37
+
38
+ ### What belongs in `pymc-extras`?
39
+
40
+ - newly-implemented statistical methods, for example step methods or model construction helpers
41
+ - distributions that are tricky to sample from or test
42
+ - infrequently-used fitting methods or distributions
43
+ - any code that requires additional optimization before it can be used in practice
44
+
45
+
46
+ ### What does not belong in `pymc-extras`?
47
+ - Case studies
48
+ - Implementations that cannot be applied generically, for example because they are tied to variables from a toy example
49
+
50
+
51
+ ### Should there be more than one add-on repository?
52
+
53
+ 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?
54
+ 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.
55
+
56
+
57
+ ### Unanswered questions & ToDos
58
+ This project is still young and many things have not been answered or implemented.
59
+ Please get involved!
60
+
61
+ * What are guidelines for organizing submodules?
62
+ * 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.
@@ -0,0 +1,29 @@
1
+ # Copyright 2022 The PyMC Developers
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ import logging
15
+
16
+ from pymc_extras import gp, statespace, utils
17
+ from pymc_extras.distributions import *
18
+ from pymc_extras.inference.fit import fit
19
+ from pymc_extras.model.marginal.marginal_model import MarginalModel, marginalize
20
+ from pymc_extras.model.model_api import as_model
21
+ from pymc_extras.version import __version__
22
+
23
+ _log = logging.getLogger("pmx")
24
+
25
+ if not logging.root.handlers:
26
+ _log.setLevel(logging.INFO)
27
+ if len(_log.handlers) == 0:
28
+ handler = logging.StreamHandler()
29
+ _log.addHandler(handler)
@@ -0,0 +1,40 @@
1
+ # Copyright 2022 The PyMC Developers
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # coding: utf-8
16
+ """
17
+ Experimental probability distributions for stochastic nodes in PyMC.
18
+ """
19
+
20
+ from pymc_extras.distributions.continuous import Chi, GenExtreme, Maxwell
21
+ from pymc_extras.distributions.discrete import (
22
+ BetaNegativeBinomial,
23
+ GeneralizedPoisson,
24
+ Skellam,
25
+ )
26
+ from pymc_extras.distributions.histogram_utils import histogram_approximation
27
+ from pymc_extras.distributions.multivariate import R2D2M2CP
28
+ from pymc_extras.distributions.timeseries import DiscreteMarkovChain
29
+
30
+ __all__ = [
31
+ "Chi",
32
+ "Maxwell",
33
+ "DiscreteMarkovChain",
34
+ "GeneralizedPoisson",
35
+ "BetaNegativeBinomial",
36
+ "GenExtreme",
37
+ "R2D2M2CP",
38
+ "Skellam",
39
+ "histogram_approximation",
40
+ ]