pypomp 0.0.1__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.
@@ -0,0 +1,167 @@
1
+
2
+ *~
3
+
4
+ #### the following is the default Python package gitignore from GitHub ####
5
+
6
+ # Byte-compiled / optimized / DLL files
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ share/python-wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+ MANIFEST
33
+
34
+ # PyInstaller
35
+ # Usually these files are written by a python script from a template
36
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
37
+ *.manifest
38
+ *.spec
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ # Unit test / coverage reports
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py,cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+
86
+ # IPython
87
+ profile_default/
88
+ ipython_config.py
89
+
90
+ # pyenv
91
+ # For a library or package, you might want to ignore these files since the code is
92
+ # intended to run in multiple environments; otherwise, check them in:
93
+ # .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ #Pipfile.lock
101
+
102
+ # poetry
103
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
104
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
105
+ # commonly ignored for libraries.
106
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
107
+ #poetry.lock
108
+
109
+ # pdm
110
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
111
+ #pdm.lock
112
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
113
+ # in version control.
114
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
115
+ .pdm.toml
116
+ .pdm-python
117
+ .pdm-build/
118
+
119
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
120
+ __pypackages__/
121
+
122
+ # Celery stuff
123
+ celerybeat-schedule
124
+ celerybeat.pid
125
+
126
+ # SageMath parsed files
127
+ *.sage.py
128
+
129
+ # Environments
130
+ .env
131
+ .venv
132
+ env/
133
+ venv/
134
+ ENV/
135
+ env.bak/
136
+ venv.bak/
137
+
138
+ # Spyder project settings
139
+ .spyderproject
140
+ .spyproject
141
+
142
+ # Rope project settings
143
+ .ropeproject
144
+
145
+ # mkdocs documentation
146
+ /site
147
+
148
+ # mypy
149
+ .mypy_cache/
150
+ .dmypy.json
151
+ dmypy.json
152
+
153
+ # Pyre type checker
154
+ .pyre/
155
+
156
+ # pytype static type analyzer
157
+ .pytype/
158
+
159
+ # Cython debug symbols
160
+ cython_debug/
161
+
162
+ # PyCharm
163
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
164
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
165
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
166
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
167
+ .idea/
pypomp-0.0.1/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2018 The Python Packaging Authority
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
20
+
pypomp-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.3
2
+ Name: pypomp
3
+ Version: 0.0.1
4
+ Summary: Modeling and inference using partially observed Markov process (POMP) models
5
+ Project-URL: Homepage, https://github.com/ionides/pomp-py
6
+ Project-URL: Issues, https://github.com/ionides/pomp-py/issues
7
+ Author-email: Kevin Tan <kevtan@wharton.upenn.edu>, Jun Chen <chenjunc@umich.edu>, Jesse Wheeler <jeswheel@umich.edu>, Edward Ionides <ionides@umich.edu>
8
+ Maintainer-email: Edward Ionides <ionides@umich.edu>, Kevin Tan <kevtan@wharton.upenn.edu>
9
+ License-File: LICENSE
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+
16
+ # pypomp
17
+
18
+ Python code for modeling and inference using partially observed Markov process (POMP) models, featuring automatic differentiation.
19
+
20
+ ### Expected package users
21
+
22
+ * Scientists wanting to perform data analysis on a dynamic system via partially observed Markov processes (POMP), also called state-space models (SSM) or hidden Markov models (HMM) in other contexts.
23
+
24
+ * This package design and intended use is similar to the popular [**pomp** R package](https://kingaa.github.io/pomp/). As such, many of the expected use cases and motivating examples of this package can be found on the [pomp package bibliography page](https://kingaa.github.io/pomp/biblio.html).
25
+
26
+ * Researchers wishing to develop novel inference methodology for POMP models.
27
+
28
+ * Like the **pomp** R package, this package provides a framework for implementing computer representations of arbitrary POMP models. This ability provides an environment for researchers to develop, test, and deploy novel algorithms that are applicable to POMP models.
29
+
30
+ ### Package Development
31
+
32
+ * The **pypomp** package is currently at early stages of development. All version numbers below 0.1 are pre-release.
33
+
34
+ * All contributions are welcome! Contributions should keep in mind the intended uses of this package, and its intended users.
35
+
36
+ * The **pypomp** package is run by the [pypomp organization](https://github.com/pypomp).
37
+
pypomp-0.0.1/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # pypomp
2
+
3
+ Python code for modeling and inference using partially observed Markov process (POMP) models, featuring automatic differentiation.
4
+
5
+ ### Expected package users
6
+
7
+ * Scientists wanting to perform data analysis on a dynamic system via partially observed Markov processes (POMP), also called state-space models (SSM) or hidden Markov models (HMM) in other contexts.
8
+
9
+ * This package design and intended use is similar to the popular [**pomp** R package](https://kingaa.github.io/pomp/). As such, many of the expected use cases and motivating examples of this package can be found on the [pomp package bibliography page](https://kingaa.github.io/pomp/biblio.html).
10
+
11
+ * Researchers wishing to develop novel inference methodology for POMP models.
12
+
13
+ * Like the **pomp** R package, this package provides a framework for implementing computer representations of arbitrary POMP models. This ability provides an environment for researchers to develop, test, and deploy novel algorithms that are applicable to POMP models.
14
+
15
+ ### Package Development
16
+
17
+ * The **pypomp** package is currently at early stages of development. All version numbers below 0.1 are pre-release.
18
+
19
+ * All contributions are welcome! Contributions should keep in mind the intended uses of this package, and its intended users.
20
+
21
+ * The **pypomp** package is run by the [pypomp organization](https://github.com/pypomp).
22
+
File without changes
@@ -0,0 +1,37 @@
1
+ from .pomp_class import *
2
+
3
+
4
+
5
+ def fit(pomp_object=None, J=100, Jh=1000, theta=None, rinit=None, rprocess=None, dmeasure=None, rprocesses=None,
6
+ dmeasures=None, ys=None, sigmas=None, sigmas_init=None, covars=None, M=10, a=0.9, method='Newton', itns=20,
7
+ beta=0.9, eta=0.0025, c=0.1,
8
+ max_ls_itn=10, thresh_mif=100, thresh_tr=100, verbose=False, scale=False, ls=False, alpha=0.1, monitor=True,
9
+ mode="IFAD"):
10
+ if pomp_object is not None:
11
+ if mode == "IF2" or mode == "IFAD":
12
+ if sigmas is not None and sigmas_init is not None:
13
+ return pomp_object.fit(sigmas, sigmas_init, M, a, J, Jh, method, itns, beta, eta, c, max_ls_itn,
14
+ thresh_mif, thresh_tr, verbose, scale, ls, alpha, monitor, mode)
15
+ else:
16
+ raise ValueError("Invalid Argument Input with Missing sigmas or sigmas_init")
17
+ elif mode == "GD":
18
+ return pomp_object.fit(sigmas, sigmas_init, M, a, J, Jh, method, itns, beta, eta, c, max_ls_itn, thresh_mif,
19
+ thresh_tr, verbose, scale, ls, alpha, monitor, mode)
20
+ else:
21
+ raise ValueError("Invalid Mode Input")
22
+ elif rinit is not None and rprocess is not None and dmeasure is not None and theta is not None and ys is not None:
23
+ if mode == "IF2" or mode == "IFAD":
24
+ if rprocesses is not None and dmeasures is not None and sigmas is not None and sigmas_init is not None:
25
+ return fit_internal(theta, ys, rinit, rprocess, dmeasure, rprocesses, dmeasures, sigmas, sigmas_init,
26
+ covars, M, a, J, Jh, method, itns, beta, eta, c, max_ls_itn, thresh_mif, thresh_tr,
27
+ verbose, scale, ls, alpha, monitor, mode)
28
+ else:
29
+ raise ValueError("Invalid Argument Input with Missing workhorse or sigmas")
30
+ elif mode == "GD":
31
+ return fit_internal(theta, ys, rinit, rprocess, dmeasure, rprocesses, dmeasures, sigmas, sigmas_init,
32
+ covars, M, a, J, Jh, method, itns, beta, eta, c, max_ls_itn, thresh_mif, thresh_tr,
33
+ verbose, scale, ls, alpha, monitor, mode)
34
+ else:
35
+ raise ValueError("Invalid Mode Input")
36
+ else:
37
+ raise ValueError("Invalid Argument Input with Missing Required Argument")