pymc-extras 0.6.0__py3-none-any.whl → 0.8.0__py3-none-any.whl
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.
- pymc_extras/distributions/timeseries.py +10 -10
- pymc_extras/inference/dadvi/dadvi.py +14 -83
- pymc_extras/inference/laplace_approx/laplace.py +187 -159
- pymc_extras/inference/pathfinder/pathfinder.py +12 -7
- pymc_extras/inference/smc/sampling.py +2 -2
- pymc_extras/model/marginal/distributions.py +4 -2
- pymc_extras/model/marginal/marginal_model.py +12 -2
- pymc_extras/prior.py +3 -3
- pymc_extras/statespace/core/properties.py +276 -0
- pymc_extras/statespace/core/statespace.py +182 -45
- pymc_extras/statespace/filters/distributions.py +19 -34
- pymc_extras/statespace/filters/kalman_filter.py +13 -12
- pymc_extras/statespace/filters/kalman_smoother.py +2 -2
- pymc_extras/statespace/models/DFM.py +179 -168
- pymc_extras/statespace/models/ETS.py +177 -151
- pymc_extras/statespace/models/SARIMAX.py +149 -152
- pymc_extras/statespace/models/VARMAX.py +134 -145
- pymc_extras/statespace/models/__init__.py +8 -1
- pymc_extras/statespace/models/structural/__init__.py +30 -8
- pymc_extras/statespace/models/structural/components/autoregressive.py +87 -45
- pymc_extras/statespace/models/structural/components/cycle.py +119 -80
- pymc_extras/statespace/models/structural/components/level_trend.py +95 -42
- pymc_extras/statespace/models/structural/components/measurement_error.py +27 -17
- pymc_extras/statespace/models/structural/components/regression.py +105 -68
- pymc_extras/statespace/models/structural/components/seasonality.py +138 -100
- pymc_extras/statespace/models/structural/core.py +397 -286
- pymc_extras/statespace/models/utilities.py +5 -20
- {pymc_extras-0.6.0.dist-info → pymc_extras-0.8.0.dist-info}/METADATA +4 -4
- {pymc_extras-0.6.0.dist-info → pymc_extras-0.8.0.dist-info}/RECORD +31 -30
- {pymc_extras-0.6.0.dist-info → pymc_extras-0.8.0.dist-info}/WHEEL +0 -0
- {pymc_extras-0.6.0.dist-info → pymc_extras-0.8.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from collections.abc import Sequence
|
|
1
2
|
from typing import cast as type_cast
|
|
2
3
|
|
|
3
4
|
import numpy as np
|
|
@@ -6,31 +7,12 @@ import pytensor.tensor as pt
|
|
|
6
7
|
from pytensor.tensor import TensorVariable
|
|
7
8
|
|
|
8
9
|
from pymc_extras.statespace.utils.constants import (
|
|
9
|
-
ALL_STATE_AUX_DIM,
|
|
10
|
-
ALL_STATE_DIM,
|
|
11
10
|
LONG_MATRIX_NAMES,
|
|
12
11
|
MATRIX_NAMES,
|
|
13
|
-
OBS_STATE_AUX_DIM,
|
|
14
|
-
OBS_STATE_DIM,
|
|
15
|
-
SHOCK_AUX_DIM,
|
|
16
|
-
SHOCK_DIM,
|
|
17
12
|
VECTOR_VALUED,
|
|
18
13
|
)
|
|
19
14
|
|
|
20
15
|
|
|
21
|
-
def make_default_coords(ss_mod):
|
|
22
|
-
coords = {
|
|
23
|
-
ALL_STATE_DIM: ss_mod.state_names,
|
|
24
|
-
ALL_STATE_AUX_DIM: ss_mod.state_names,
|
|
25
|
-
OBS_STATE_DIM: ss_mod.observed_states,
|
|
26
|
-
OBS_STATE_AUX_DIM: ss_mod.observed_states,
|
|
27
|
-
SHOCK_DIM: ss_mod.shock_names,
|
|
28
|
-
SHOCK_AUX_DIM: ss_mod.shock_names,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return coords
|
|
32
|
-
|
|
33
|
-
|
|
34
16
|
def cleanup_states(states: list[str]) -> list[str]:
|
|
35
17
|
"""
|
|
36
18
|
Remove meaningless symbols from state names
|
|
@@ -672,8 +654,11 @@ def get_exog_dims_from_idata(exog_name, idata):
|
|
|
672
654
|
return exog_dims
|
|
673
655
|
|
|
674
656
|
|
|
675
|
-
def validate_names(names:
|
|
657
|
+
def validate_names(names: Sequence[str] | None, var_name: str, optional: bool = True) -> None:
|
|
676
658
|
if names is None:
|
|
677
659
|
if optional:
|
|
678
660
|
return None
|
|
661
|
+
|
|
679
662
|
raise ValueError(f"Must specify {var_name}")
|
|
663
|
+
|
|
664
|
+
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pymc-extras
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
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
5
|
Project-URL: Documentation, https://pymc-extras.readthedocs.io/
|
|
6
6
|
Project-URL: Repository, https://github.com/pymc-devs/pymc-extras.git
|
|
@@ -235,8 +235,8 @@ Requires-Python: >=3.11
|
|
|
235
235
|
Requires-Dist: better-optimize>=0.1.5
|
|
236
236
|
Requires-Dist: preliz>=0.20.0
|
|
237
237
|
Requires-Dist: pydantic>=2.0.0
|
|
238
|
-
Requires-Dist: pymc>=5.
|
|
239
|
-
Requires-Dist: pytensor>=2.
|
|
238
|
+
Requires-Dist: pymc>=5.27.1
|
|
239
|
+
Requires-Dist: pytensor>=2.37.0
|
|
240
240
|
Requires-Dist: scikit-learn
|
|
241
241
|
Provides-Extra: complete
|
|
242
242
|
Requires-Dist: dask[complete]<2025.1.1; extra == 'complete'
|
|
@@ -245,7 +245,7 @@ Provides-Extra: dask-histogram
|
|
|
245
245
|
Requires-Dist: dask[complete]<2025.1.1; extra == 'dask-histogram'
|
|
246
246
|
Requires-Dist: xhistogram; extra == 'dask-histogram'
|
|
247
247
|
Provides-Extra: dev
|
|
248
|
-
Requires-Dist: blackjax; extra == 'dev'
|
|
248
|
+
Requires-Dist: blackjax>=0.12; extra == 'dev'
|
|
249
249
|
Requires-Dist: dask[all]<2025.1.1; extra == 'dev'
|
|
250
250
|
Requires-Dist: pytest-mock; extra == 'dev'
|
|
251
251
|
Requires-Dist: pytest>=6.0; extra == 'dev'
|
|
@@ -3,12 +3,12 @@ pymc_extras/deserialize.py,sha256=lA5Nc3ZMjlq8sXVBzJLdb3ZkK_PsJNkaH-QhBcQZcd4,59
|
|
|
3
3
|
pymc_extras/linearmodel.py,sha256=KkvZ_DBXOD6myPgVNzu742YV0OzDK449_pDqNC5yae4,3975
|
|
4
4
|
pymc_extras/model_builder.py,sha256=cypRVbSR2XE7xDU2mL2MfjNXoyruAwtKbuUEhzmWPao,26460
|
|
5
5
|
pymc_extras/printing.py,sha256=bFOANgsOWDk0vbRMvm2h_D5TsT7OiSojdG7tvyfCw28,6506
|
|
6
|
-
pymc_extras/prior.py,sha256=
|
|
6
|
+
pymc_extras/prior.py,sha256=cu6VWZejvYGll_yFc4lGJ4YOrc9ro7LXkbiQ4LPxU9E,44331
|
|
7
7
|
pymc_extras/distributions/__init__.py,sha256=Cge3AP7gzD6qTJY7v2tYRtSgn-rlnIo7wQBgf3IfKQ8,1377
|
|
8
8
|
pymc_extras/distributions/continuous.py,sha256=bCXOgnw2Vh_FbYOHCqB0c3ozFVay5Qwua2A211kvWNQ,11251
|
|
9
9
|
pymc_extras/distributions/discrete.py,sha256=HNi-K0_hnNWTcfyBkWGh26sc71FwBgukQ_EjGAaAOjY,13036
|
|
10
10
|
pymc_extras/distributions/histogram_utils.py,sha256=kkZHu1F_2qMfOEzwNP4K6QYA_xEKUk9cChImOQ2Nkjs,5847
|
|
11
|
-
pymc_extras/distributions/timeseries.py,sha256=
|
|
11
|
+
pymc_extras/distributions/timeseries.py,sha256=WysWtUchfObTGmKduF47bUBqV_g1kW-uAx4_oKENgDg,12709
|
|
12
12
|
pymc_extras/distributions/multivariate/__init__.py,sha256=E8OeLW9tTotCbrUjEo4um76-_WQD56PehsPzkKmhfyA,93
|
|
13
13
|
pymc_extras/distributions/multivariate/r2d2m2cp.py,sha256=5SzvD41pu-EWyWlDNz4AR4Sl8MkyC-1dYwkADFh5Avg,16009
|
|
14
14
|
pymc_extras/distributions/transforms/__init__.py,sha256=FUp2vyRE6_2eUcQ_FVt5Dn0-vy5I-puV-Kz13-QtLNc,104
|
|
@@ -18,25 +18,25 @@ pymc_extras/gp/latent_approx.py,sha256=cDEMM6H1BL2qyKg7BZU-ISrKn2HJe7hDaM4Y8GgQD
|
|
|
18
18
|
pymc_extras/inference/__init__.py,sha256=hI3yqfEVzoUNlCpL1z579F9EqM-NlPTzMfHj8IKY-xE,1009
|
|
19
19
|
pymc_extras/inference/fit.py,sha256=hNTqLms_mTdjfnCEVIHMcMiPZ3fkU3HEEkbt6LWWhLw,1443
|
|
20
20
|
pymc_extras/inference/dadvi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
-
pymc_extras/inference/dadvi/dadvi.py,sha256=
|
|
21
|
+
pymc_extras/inference/dadvi/dadvi.py,sha256=rERiyMn1ywEerWJ8rq3WNZKtKEpX2lHAdqApatZyJpQ,9698
|
|
22
22
|
pymc_extras/inference/laplace_approx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
23
|
pymc_extras/inference/laplace_approx/find_map.py,sha256=fbK0swDsSBo7pP1TBokREa2wkK1ajL_gLVVuREHH33k,13658
|
|
24
24
|
pymc_extras/inference/laplace_approx/idata.py,sha256=Dxj6A8aJXn8c24vD_PZmMgIgrwEmaYDlbw5UAJq0Nyw,14172
|
|
25
|
-
pymc_extras/inference/laplace_approx/laplace.py,sha256=
|
|
25
|
+
pymc_extras/inference/laplace_approx/laplace.py,sha256=1IHNYhL8CMvuvU90RmLSIRF8NI4GLlTz_FcRb1t79Bw,20381
|
|
26
26
|
pymc_extras/inference/laplace_approx/scipy_interface.py,sha256=Crhix_dLA8Y_NvuUDmVQnKWAWGjufmQwDLh-bK9dz_o,10235
|
|
27
27
|
pymc_extras/inference/pathfinder/__init__.py,sha256=FhAYrCWNx_dCrynEdjg2CZ9tIinvcVLBm67pNx_Y3kA,101
|
|
28
28
|
pymc_extras/inference/pathfinder/idata.py,sha256=muAPc9JeI8ZmpjzSp9tSj-uNrcsoNkYb4raJqjgf5UQ,18636
|
|
29
29
|
pymc_extras/inference/pathfinder/importance_sampling.py,sha256=NwxepXOFit3cA5zEebniKdlnJ1rZWg56aMlH4MEOcG4,6264
|
|
30
30
|
pymc_extras/inference/pathfinder/lbfgs.py,sha256=GOoJBil5Kft_iFwGNUGKSeqzI5x_shA4KQWDwgGuQtQ,7110
|
|
31
|
-
pymc_extras/inference/pathfinder/pathfinder.py,sha256=
|
|
31
|
+
pymc_extras/inference/pathfinder/pathfinder.py,sha256=MP71xjc3PSsgknEdfbRMXPpRfiXlMebqhBbnSQkXMPg,67344
|
|
32
32
|
pymc_extras/inference/smc/__init__.py,sha256=wyaT4NJl1YsSQRLiDy-i0Jq3CbJZ2BQd4nnCk-dIngY,603
|
|
33
|
-
pymc_extras/inference/smc/sampling.py,sha256=
|
|
33
|
+
pymc_extras/inference/smc/sampling.py,sha256=eyRIFPf--tcPpuHPNCxGZNQZVd7MazR4l9aURNY87S0,15385
|
|
34
34
|
pymc_extras/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
pymc_extras/model/model_api.py,sha256=UHMfQXxWBujeSiUySU0fDUC5Sd_BjT8FoVz3iBxQH_4,2400
|
|
36
36
|
pymc_extras/model/marginal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
-
pymc_extras/model/marginal/distributions.py,sha256=
|
|
37
|
+
pymc_extras/model/marginal/distributions.py,sha256=mf6Czm6av2nCydu6uKqjamKFPD8efWJmNlTMy4Ojrvk,15621
|
|
38
38
|
pymc_extras/model/marginal/graph_analysis.py,sha256=Ft7RZC126R0TW2GuFdgb9uN-JSgDGTeffs-UuPcDHQE,15884
|
|
39
|
-
pymc_extras/model/marginal/marginal_model.py,sha256=
|
|
39
|
+
pymc_extras/model/marginal/marginal_model.py,sha256=Wgfcq6hplACU4Kh8aKT2P_kz_yo7r0wIVTupZQtQUKw,23969
|
|
40
40
|
pymc_extras/model/transforms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
pymc_extras/model/transforms/autoreparam.py,sha256=_NltGWmNqi_X9sHCqAvWcBveLTPxVy11-wENFTcN6kk,12377
|
|
42
42
|
pymc_extras/preprocessing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -44,29 +44,30 @@ pymc_extras/preprocessing/standard_scaler.py,sha256=Vajp33ma6OkwlU54JYtSS8urHbMJ
|
|
|
44
44
|
pymc_extras/statespace/__init__.py,sha256=PxV8i4aa2XJarRM6aKU14_bEY1AoLu4bNXIBy_E1rRw,431
|
|
45
45
|
pymc_extras/statespace/core/__init__.py,sha256=LEhkqdMZzzcTyzYml45IM4ykWoCdbWWj2c29IpM_ey8,309
|
|
46
46
|
pymc_extras/statespace/core/compile.py,sha256=GB2H7sE28OdQ6GmNIjtq1R1Oua2GPf6kWJ7IPuYJaNA,1607
|
|
47
|
+
pymc_extras/statespace/core/properties.py,sha256=pDWjWY4u4cilLtZ7SkhVS_6ouzH7TwPgnJgEwYhbiTw,8118
|
|
47
48
|
pymc_extras/statespace/core/representation.py,sha256=boY-jjlkd3KuuO2XiSuV-GwEAyEqRJ9267H72AmE3BU,18956
|
|
48
|
-
pymc_extras/statespace/core/statespace.py,sha256=
|
|
49
|
+
pymc_extras/statespace/core/statespace.py,sha256=Q-sj7Lf5EiIjULQoaHq6140VDtXx4oCdiQQicVWtIVA,112457
|
|
49
50
|
pymc_extras/statespace/filters/__init__.py,sha256=F0EtZUhArp23lj3upy6zB0mDTjLIjwGh0pKmMny0QfY,420
|
|
50
|
-
pymc_extras/statespace/filters/distributions.py,sha256
|
|
51
|
-
pymc_extras/statespace/filters/kalman_filter.py,sha256=
|
|
52
|
-
pymc_extras/statespace/filters/kalman_smoother.py,sha256=
|
|
51
|
+
pymc_extras/statespace/filters/distributions.py,sha256=h98bstdTF3K4P4VAJBflGnyvokOw7j7ZHK5S2aoJFOw,11305
|
|
52
|
+
pymc_extras/statespace/filters/kalman_filter.py,sha256=NF-raNqf5m5szoirhYvghMT8ViFU24h7VwTO51nIW3E,31560
|
|
53
|
+
pymc_extras/statespace/filters/kalman_smoother.py,sha256=JmnvXwHVzWTdmtgECTJY0FJOFZG6O9aEfRoSTWEeU2s,4111
|
|
53
54
|
pymc_extras/statespace/filters/utilities.py,sha256=BBMDeWBcJWZfGc9owuMsOedVIXVDQ8Z2eMiU9vWeVr0,1494
|
|
54
|
-
pymc_extras/statespace/models/DFM.py,sha256=
|
|
55
|
-
pymc_extras/statespace/models/ETS.py,sha256=
|
|
56
|
-
pymc_extras/statespace/models/SARIMAX.py,sha256=
|
|
57
|
-
pymc_extras/statespace/models/VARMAX.py,sha256=
|
|
58
|
-
pymc_extras/statespace/models/__init__.py,sha256=
|
|
59
|
-
pymc_extras/statespace/models/utilities.py,sha256=
|
|
60
|
-
pymc_extras/statespace/models/structural/__init__.py,sha256=
|
|
61
|
-
pymc_extras/statespace/models/structural/core.py,sha256=
|
|
55
|
+
pymc_extras/statespace/models/DFM.py,sha256=FPIBOJaHDv-WYZgkQTtRUCCw96KagRY_gD2jXcxdfbM,36829
|
|
56
|
+
pymc_extras/statespace/models/ETS.py,sha256=J27qKunJDc__7_T7UP5RJz_Ga3Ku4ozkz34LwFE2ieg,28593
|
|
57
|
+
pymc_extras/statespace/models/SARIMAX.py,sha256=INxC0Jp5vHAf9rGMrj7VN4ol4m1d5DWcQtlevcAghpA,24269
|
|
58
|
+
pymc_extras/statespace/models/VARMAX.py,sha256=a-39jN1zi7jLe5jtz9rspV9yCPjDRvpiMDYz_AL5L9A,21866
|
|
59
|
+
pymc_extras/statespace/models/__init__.py,sha256=8ocvgETetsikaKf-Y9K50_Yjf8emU5xkMrz_5oLwmrc,435
|
|
60
|
+
pymc_extras/statespace/models/utilities.py,sha256=Ak_pJxcUUdniXcXVYdBoOtoNNPQEJIBB3GYf_lNn8bI,26932
|
|
61
|
+
pymc_extras/statespace/models/structural/__init__.py,sha256=NlegsutNOzfM2239mi0vvmq69_9_V4Y3JceywvoZZ10,1342
|
|
62
|
+
pymc_extras/statespace/models/structural/core.py,sha256=S-ZOhlt9zwyt1pch1N-nswLwhMOyutaIalG5eB59k40,38858
|
|
62
63
|
pymc_extras/statespace/models/structural/utils.py,sha256=Eze34Z0iXJzDC_gZEY2mHrp2VIYu8rHV915vM4U5Sn4,359
|
|
63
64
|
pymc_extras/statespace/models/structural/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
-
pymc_extras/statespace/models/structural/components/autoregressive.py,sha256=
|
|
65
|
-
pymc_extras/statespace/models/structural/components/cycle.py,sha256=
|
|
66
|
-
pymc_extras/statespace/models/structural/components/level_trend.py,sha256=
|
|
67
|
-
pymc_extras/statespace/models/structural/components/measurement_error.py,sha256=
|
|
68
|
-
pymc_extras/statespace/models/structural/components/regression.py,sha256=
|
|
69
|
-
pymc_extras/statespace/models/structural/components/seasonality.py,sha256=
|
|
65
|
+
pymc_extras/statespace/models/structural/components/autoregressive.py,sha256=XpaA5rKv9WZjqUeS7ue4yJniF-zWrfOG7GSwNVg88OY,9179
|
|
66
|
+
pymc_extras/statespace/models/structural/components/cycle.py,sha256=5dcJ_6VjxFQ2ZUO19RVyh8nArwHGNTZFd2uLCTJsta0,14952
|
|
67
|
+
pymc_extras/statespace/models/structural/components/level_trend.py,sha256=eo7NIAOuM4mFeuA3ev9tBQzGzPcPu6tjNVCY0fZvA6Q,13082
|
|
68
|
+
pymc_extras/statespace/models/structural/components/measurement_error.py,sha256=1f6mpQWD7ElDhG3XN44J7o4e-xq81oWrUaDA_oBTnHk,5625
|
|
69
|
+
pymc_extras/statespace/models/structural/components/regression.py,sha256=pbp_1EmcMxKqf6ikGq7F1pOijelJiR938HKml26g3kw,9981
|
|
70
|
+
pymc_extras/statespace/models/structural/components/seasonality.py,sha256=h3R2G8KxsmgcCujs9mBJgJeXeTopRGLMRNlxMX253cM,28338
|
|
70
71
|
pymc_extras/statespace/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
72
|
pymc_extras/statespace/utils/constants.py,sha256=Dj1XpY_u5EliyStGrEFq5jmA5d_EMHCT4teaifxiTko,2577
|
|
72
73
|
pymc_extras/statespace/utils/coord_tools.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -76,7 +77,7 @@ pymc_extras/utils/linear_cg.py,sha256=KkXhuimFsrKtNd_0By2ApxQQQNm5FdBtmDQJOVbLYk
|
|
|
76
77
|
pymc_extras/utils/model_equivalence.py,sha256=9MLwSj7VwxxKupzmEkKBbwGD1X0WM2FGcGIpfb8bViw,2197
|
|
77
78
|
pymc_extras/utils/prior.py,sha256=mnuFpamp04eQJuTU5NyB2PfCG5r-1McSmQGwQXSR_Lg,6670
|
|
78
79
|
pymc_extras/utils/spline.py,sha256=R0u3eAcV5bRmD2YSLqDm0qnaJbEuf3V38OZ7amV7-Tc,4732
|
|
79
|
-
pymc_extras-0.
|
|
80
|
-
pymc_extras-0.
|
|
81
|
-
pymc_extras-0.
|
|
82
|
-
pymc_extras-0.
|
|
80
|
+
pymc_extras-0.8.0.dist-info/METADATA,sha256=_aigNVZF-Z-BSkS0nT45vHbZPnPC16H7RsRtYiP9b0Q,18904
|
|
81
|
+
pymc_extras-0.8.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
82
|
+
pymc_extras-0.8.0.dist-info/licenses/LICENSE,sha256=WjiLhUKEysJvy5e9jk6WwFv9tmAPtnov1uJ6gcH1kIs,11720
|
|
83
|
+
pymc_extras-0.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|