Error message in build_statespace_graph when cycle is one of the model components #280
-
When I build a PyMC statespace model with pymc-experimental, I always get an error message when adding a cycle to the model: "TypeError: The type of the replacement (Vector(float64, shape=(2,))) must be compatible with the type of the original Variable (Vector(float64, shape=(1,)))." Below the code. The error message refers to the line "annual cycle = ...": mod = st.LevelTrendComponent(order=2, innovations_order=[0, 1]) I guess the problem is that annual_cycle should have shape = (2,), but has shape = (1,). May that point to a bug in the base code? Anyone else here with the same problem? Any suggestions of how to solve it? |
Beta Was this translation helpful? Give feedback.
Replies: 19 comments 13 replies
-
Would be great. I can't fix it myself in the base code. |
Beta Was this translation helpful? Give feedback.
-
Great. Will do so. |
Beta Was this translation helpful? Give feedback.
-
Dear Jesse,
How can I get access to the new code?
Roland Klees
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 18 Dec 2023, at 19:32, Jesse Grabowski ***@***.******@***.***>> wrote:
I just pushed a bugfix, so you shouldn't hit this problem anymore. There were some changes to the naming of dims and variables, so your model should now look like this:
from pymc_experimental.statespace import structural as st
import pymc as pm
import pytensor.tensor as pt
import pandas as pd
import numpy as np
data = np.random.normal(size=(100, 1))
mod = st.LevelTrendComponent(order=2, innovations_order=[0, 1])
mod += st.CycleComponent(name='annual_cycle', cycle_length=12, innovations=True)
mod += st.MeasurementError(name="obs")
model = mod.build(name="IRW+cycle+measurement_error")
model.param_dims
initial_trend_dims, sigma_trend_dims, sigma_obs_dims, P0_dims = model.param_dims.values()
coords = model.coords
data = np.random.normal(size=(100,))
with pm.Model(coords=coords) as model_1:
P0_diag = pm.Gamma("P0_diag", alpha=2, beta=5, dims=P0_dims[0])
P0 = pm.Deterministic("P0", pt.diag(P0_diag), dims=P0_dims)
initial_trend = pm.Normal("initial_trend", dims=initial_trend_dims)
sigma_trend = pm.Gamma("sigma_trend", alpha=2, beta=10, dims=sigma_trend_dims)
annual_cycle = pm.Normal("annual_cycle", sigma=5)
sigma_annual_cycle = pm.Gamma("sigma_annual_cycle", alpha=2, beta=5)
sigma_obs = pm.Gamma("sigma_obs", alpha=2, beta=5, dims=['observed_state'])
model.build_statespace_graph(data[:, None], mode="JAX")
idata = pm.sample(nuts_sampler="numpyro", target_accept=0.9)
Let me know if you can get it to run
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7889602__;Iw!!PAKc-5URQlI!4tqLMYybod6sLpzvTxXYCBrZ1SdawbTv7ycgsNAQuusq_8kY6PVlUmkVJELJ1DucFxFBGBzJCYbasIsaq7OTDz91FA$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZI7YHUGRMH5J7U2I53YKCD4FAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOBZGYYDE__;!!PAKc-5URQlI!4tqLMYybod6sLpzvTxXYCBrZ1SdawbTv7ycgsNAQuusq_8kY6PVlUmkVJELJ1DucFxFBGBzJCYbasIsaq7PKPBHVhw$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You should be able to install directly from the github repo with |
Beta Was this translation helpful? Give feedback.
-
Thanks. Will do so and run some tests. Will let you know asap about the outcome. Thanks a lot !!
Roland Klees
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 18 Dec 2023, at 19:36, Jesse Grabowski ***@***.******@***.***>> wrote:
You should be able to install directly from the github repo with pip install git+https://github.com/pymc-devs/pymc-experimental.git
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7889634__;Iw!!PAKc-5URQlI!_h3Svccx8_Cwrgo5bZXEt4hgjWLJR1aFNdF0jINSoHC307fXJRfZO_ypxZqsWqpe2HEdm-BH4XWfGUsSGM8vAga7yQ$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZPZMQDSTNNYA4H2OCDYKCEMHAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOBZGYZTI__;!!PAKc-5URQlI!_h3Svccx8_Cwrgo5bZXEt4hgjWLJR1aFNdF0jINSoHC307fXJRfZO_ypxZqsWqpe2HEdm-BH4XWfGUsSGM8sYINREA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Dear Jesse,
Does not seem to work. First of all, the model.param_info tells me that the cycle still has shape (1,), though to my understanding is must have shape (2,) (like a seasonal cycle with 1 harmonic term). In a combination of integrated random walk + 2 cyclic terms + measurement noise, mod.build() gives:
The following parameters should be assigned priors inside a PyMC model block:
initial_trend -- shape: (2,), constraints: None, dims: ('trend_state',)
sigma_trend -- shape: (1,), constraints: Positive, dims: ('trend_shock',)
annual_cycle -- shape: (1,), constraints: None, dims: None
sigma_annual_cycle -- shape: (1,), constraints: Positive, dims: None
SA_cycle -- shape: (1,), constraints: None, dims: None
sigma_obs -- shape: (1,), constraints: Positive, dims: None
P0 -- shape: (6, 6), constraints: Positive semi-definite, dims: ('state', 'state_aux')
And model.param_info gives
{'initial_trend': {'shape': (2,),
'constraints': 'None',
'dims': ('trend_state',)},
'sigma_trend': {'shape': (1,),
'constraints': 'Positive',
'dims': ('trend_shock',)},
'annual_cycle': {'shape': (1,), 'constraints': 'None', 'dims': None},
'sigma_annual_cycle': {'shape': (1,),
'constraints': 'Positive',
'dims': 'None'},
'SA_cycle': {'shape': (1,), 'constraints': 'None', 'dims': None},
'sigma_obs': {'shape': (1,), 'constraints': 'Positive', 'dims': 'None'},
'P0': {'shape': (6, 6),
'constraints': 'Positive semi-definite',
'dims': ('state', 'state_aux')}}
Now I get an error message earlier, already when xxx = model.param_dims.values():
…---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[22], line 1
----> 1 initial_trend_dims, sigma_trend_dims, annual_cycle_dims, SA_cycle_dims, sigma_obs_dims, P0_dims = model.param_dims.values()
2 #initial_trend_dims, sigma_trend_dims, annual_cycle_dims, sigma_obs_dims, P0_dims = model.param_dims.values()
3 coords = model.coords
ValueError: not enough values to unpack (expected 6, got 4)
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 18 Dec 2023, at 19:36, Jesse Grabowski ***@***.******@***.***>> wrote:
You should be able to install directly from the github repo with pip install git+https://github.com/pymc-devs/pymc-experimental.git
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7889634__;Iw!!PAKc-5URQlI!_h3Svccx8_Cwrgo5bZXEt4hgjWLJR1aFNdF0jINSoHC307fXJRfZO_ypxZqsWqpe2HEdm-BH4XWfGUsSGM8vAga7yQ$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZPZMQDSTNNYA4H2OCDYKCEMHAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOBZGYZTI__;!!PAKc-5URQlI!_h3Svccx8_Cwrgo5bZXEt4hgjWLJR1aFNdF0jINSoHC307fXJRfZO_ypxZqsWqpe2HEdm-BH4XWfGUsSGM8sYINREA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Dear Jesse,
Now I get an error message when I generate my test dataset. I guess that you overlooked another dependency as now the shape seems to be (2,), but in another program still shape (1,) is expected (it is now the other way around). Here is the error message:
…---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/link/basic.py:102, in Container.__set__(self, value)
100 try:
101 # Use in-place filtering when/if possible
--> 102 self.storage[0] = self.type.filter_inplace(
103 value, self.storage[0], **kwargs
104 )
105 except NotImplementedError:
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/type.py:130, in Type.filter_inplace(self, value, storage, strict, allow_downcast)
111 """Return data or an appropriately wrapped/converted data by converting it in-place.
112
113 This method allows one to reuse old allocated memory. If this method
(...)
128 NotImplementedError
129 """
--> 130 raise NotImplementedError()
NotImplementedError:
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
Cell In[4], line 17
8 param_dict = {
9 "initial_trend": np.zeros((2,)), "sigma_trend": np.array([0.2]),
10 "annual_cycle": np.array([10.]), "sigma_annual_cycle": np.array([1.0]),
11 "SA_cycle": np.array([20., 0.]), "sigma_SA_cycle": np.array([0.5]),
12 "sigma_obs": np.array([0.1]),
13 }
15 mod = IRW + cycle + SA_cycle + measurement_error
---> 17 x, y = simulate_from_numpy_model(mod, rng, param_dict, steps=144)
18 # x comprises the states: level, slope, annual_cycle, conj annual_cycle, SA_cycle, conj SA_cycle
19 plt.figure(figsize=(10,5))
Cell In[2], line 17, in simulate_from_numpy_model(mod, rng, param_dict, steps)
13 def simulate_from_numpy_model(mod, rng, param_dict, steps=100):
14 """
15 Helper function to visualize the components outside of a PyMC model context
16 """
---> 17 x0, P0, c, d, T, Z, R, H, Q = unpack_symbolic_matrices_with_params(mod, param_dict)
18 Z_time_varies = Z.ndim == 3
20 k_states = mod.k_states
Cell In[2], line 9, in unpack_symbolic_matrices_with_params(mod, param_dict)
5 def unpack_symbolic_matrices_with_params(mod, param_dict):
6 f_matrices = pytensor.function(
7 list(mod._name_to_variable.values()), unpack_statespace(mod.ssm), on_unused_input="ignore"
8 )
----> 9 x0, P0, c, d, T, Z, R, H, Q = f_matrices(**param_dict)
10 return x0, P0, c, d, T, Z, R, H, Q
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/compile/function/types.py:897, in Function.__call__(self, *args, **kwargs)
895 if kwargs: # for speed, skip the items for empty kwargs
896 for k, arg in kwargs.items():
--> 897 self[k] = arg
899 if (
900 not self.trust_input
901 and
(...)
904 ):
905 # Collect aliased inputs among the storage space
906 args_share_memory = []
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/compile/function/types.py:549, in Function.__setitem__(self, item, value)
548 def __setitem__(self, item, value):
--> 549 self.value[item] = value
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/compile/function/types.py:505, in Function.__init__.<locals>.ValueAttribute.__setitem__(self, item, value)
499 raise TypeError(
500 f"Ambiguous name: {item} - please check the "
501 "names of the inputs of your function "
502 "for duplicates."
503 )
504 if isinstance(s, Container):
--> 505 s.value = value
506 s.provided += 1
507 else:
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/link/basic.py:106, in Container.__set__(self, value)
102 self.storage[0] = self.type.filter_inplace(
103 value, self.storage[0], **kwargs
104 )
105 except NotImplementedError:
--> 106 self.storage[0] = self.type.filter(value, **kwargs)
108 except Exception as e:
109 e.args = e.args + (f'Container name "{self.name}"',)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/tensor/type.py:256, in TensorType.filter(self, data, strict, allow_downcast)
247 raise TypeError(
248 "The numpy.ndarray object is not aligned."
249 " PyTensor C code does not support that.",
250 )
252 if not all(
253 ds == ts if ts is not None else True
254 for ds, ts in zip(data.shape, self.shape)
255 ):
--> 256 raise TypeError(
257 f"The type's shape ({self.shape}) is not compatible with the data's ({data.shape})"
258 )
260 if self.filter_checks_isfinite and not np.all(np.isfinite(data)):
261 raise ValueError("Non-finite elements not allowed")
TypeError: ("The type's shape ((2,)) is not compatible with the data's ((1,))", 'Container name "annual_cycle"')
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 18 Dec 2023, at 22:07, Jesse Grabowski ***@***.******@***.***>> wrote:
Ok I have another PR to fix it correctly this time, can you try to install it with pip install ***@***.*** and see if it works?
model.param_dims.values() should return: dict_values([('trend_state',), ('trend_shock',), ('annual_cycle_state',), ('observed_state',), ('state', 'state_aux')])
model.params_info() should be:
{'initial_trend': {'shape': (2,),
'constraints': 'None',
'dims': ('trend_state',)},
'sigma_trend': {'shape': (1,),
'constraints': 'Positive',
'dims': ('trend_shock',)},
'annual_cycle': {'shape': (2,),
'constraints': 'None',
'dims': '(annual_cycle_state, )'},
'sigma_annual_cycle': {'shape': (1,),
'constraints': 'Positive',
'dims': 'None'},
'sigma_obs': {'shape': (1,), 'constraints': 'Positive', 'dims': 'None'},
'P0': {'shape': (4, 4),
'constraints': 'Positive semi-definite',
'dims': ('state', 'state_aux')}}
annual_cycle should correctly have shape (2,) with a named dimension "annual_cycle_state" (the state names are "annual_cycle_cos" and "annual_cycle_sin")
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7890877__;Iw!!PAKc-5URQlI!51CsrXyVIiA3ZqE1Rc5NMbAUNT0qDnpPzNtcGcdXNkJHcXypJP5Hq0ZsD9y_Vdtr_eo_ZOygkHzFl0pqiK4Hwdhunw$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZIV3I7S7M6FTKNUDITYKCWCNAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOJQHA3TO__;!!PAKc-5URQlI!51CsrXyVIiA3ZqE1Rc5NMbAUNT0qDnpPzNtcGcdXNkJHcXypJP5Hq0ZsD9y_Vdtr_eo_ZOygkHzFl0pqiK4XmQgvQg$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Furthermore,
Indeed, the shape is now (2,) as it should be. However, the error message I reported yesterday in the evening still persists:
…---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[7], line 1
----> 1 initial_trend_dims, sigma_trend_dims, annual_cycle_dims, SA_cycle_dims, sigma_obs_dims, P0_dims = model.param_dims.values()
2 coords = model.coords
3 print(coords)
ValueError: not enough values to unpack (expected 6, got 4)
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 18 Dec 2023, at 22:07, Jesse Grabowski ***@***.******@***.***>> wrote:
Ok I have another PR to fix it correctly this time, can you try to install it with pip install ***@***.*** and see if it works?
model.param_dims.values() should return: dict_values([('trend_state',), ('trend_shock',), ('annual_cycle_state',), ('observed_state',), ('state', 'state_aux')])
model.params_info() should be:
{'initial_trend': {'shape': (2,),
'constraints': 'None',
'dims': ('trend_state',)},
'sigma_trend': {'shape': (1,),
'constraints': 'Positive',
'dims': ('trend_shock',)},
'annual_cycle': {'shape': (2,),
'constraints': 'None',
'dims': '(annual_cycle_state, )'},
'sigma_annual_cycle': {'shape': (1,),
'constraints': 'Positive',
'dims': 'None'},
'sigma_obs': {'shape': (1,), 'constraints': 'Positive', 'dims': 'None'},
'P0': {'shape': (4, 4),
'constraints': 'Positive semi-definite',
'dims': ('state', 'state_aux')}}
annual_cycle should correctly have shape (2,) with a named dimension "annual_cycle_state" (the state names are "annual_cycle_cos" and "annual_cycle_sin")
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7890877__;Iw!!PAKc-5URQlI!51CsrXyVIiA3ZqE1Rc5NMbAUNT0qDnpPzNtcGcdXNkJHcXypJP5Hq0ZsD9y_Vdtr_eo_ZOygkHzFl0pqiK4Hwdhunw$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZIV3I7S7M6FTKNUDITYKCWCNAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOJQHA3TO__;!!PAKc-5URQlI!51CsrXyVIiA3ZqE1Rc5NMbAUNT0qDnpPzNtcGcdXNkJHcXypJP5Hq0ZsD9y_Vdtr_eo_ZOygkHzFl0pqiK4XmQgvQg$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
This addresses the error message I got when generating synthetic data.
Roland
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 19 Dec 2023, at 08:44, Jesse Grabowski ***@***.******@***.***>> wrote:
Here you need to update the parameters in param_dict. annual_cycle needs to have shape (2,) now.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7894372__;Iw!!PAKc-5URQlI!79PaaTnnYw8HwdVol8dqYvFH0aKL45njNCDisRQRq2VT2mlefWB38s3lN__g7LMLZYaepS7xWXLyoaPdS7m-d4jf3Q$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZISPJPNIWIJC72BYTTYKFAV3AVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOJUGM3TE__;!!PAKc-5URQlI!79PaaTnnYw8HwdVol8dqYvFH0aKL45njNCDisRQRq2VT2mlefWB38s3lN__g7LMLZYaepS7xWXLyoaPdS7noiNt24Q$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
This does not solve the problem. I use 2 cyclic terms (annual cycle and SA cycle), so in line with what you say I need to have 6 returns from param_dims.values(). However, I only got 4. So there is still somewhere a bug in the code.
Roland
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 19 Dec 2023, at 08:37, Jesse Grabowski ***@***.******@***.***>> wrote:
Variables that are always scalars shouldn't ever have dims returned, so the number of returns has changed. You will need to adjust your code to reflect this. There should be 5 returns:
initial_trend_dims, sigma_trend_dims, annual_cycle_dims, sigma_obs_dims, P0_dims = model.param_dims.values()
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7894337__;Iw!!PAKc-5URQlI!_saSn2dziJpFg2bSOcZuzKMYT0lFOEXOEUE4rBIe2a0cPd4HKgykvpTEwIWTfD7ugDDqJxAsl-TyhQ9mLYXylpIkDA$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZJFD4AHABFLA532ZQTYKE725AVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOJUGMZTO__;!!PAKc-5URQlI!_saSn2dziJpFg2bSOcZuzKMYT0lFOEXOEUE4rBIe2a0cPd4HKgykvpTEwIWTfD7ugDDqJxAsl-TyhQ9mLYUBGyviiQ$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
In my case, the code passes the param_dims.values() when I remove the dims for the 2 cycles. This reduces the number of dims to 4, which obviously is provided by param_dims.values().
However, I get a new error message an another place in the code, see below. That happens when I use build_statespace_graphi. Obviously, somewhere in the code, the cycle component is still assumed to have shape (1,), though the correct shape is (2,) as now implemented in other parts of the code.
TypeError Traceback (most recent call last)
Cell In[17], line 2
1 with model_1:
----> 2 model.build_statespace_graph(data['meas'], mode="JAX")
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymc_experimental/statespace/core/statespace.py:779, in PyMCStateSpace.build_statespace_graph(self, data, register_data, mode, missing_fill_value, cov_jitter, return_updates, include_smoother)
721 """
722 Given a parameter vector `theta`, constructs the full computational graph describing the state space model and
723 the associated log probability of the data. Hidden states and log probabilities are computed via the Kalman
(...)
775 If `return_updates` is False, the method will return None.
776 """
777 pm_mod = modelcontext(None)
--> 779 self._insert_random_variables()
780 obs_coords = pm_mod.coords.get(OBS_STATE_DIM, None)
782 self.data_len = data.shape[0]
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymc_experimental/statespace/core/statespace.py:637, in PyMCStateSpace._insert_random_variables(self)
633 matrices = list(self._unpack_statespace_with_placeholders())
634 replacement_dict = {
635 var: pt.atleast_1d(pymc_model[name]) for name, var in self._name_to_variable.items()
636 }
--> 637 self.subbed_ssm = graph_replace(matrices, replace=replacement_dict, strict=True)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/replace.py:199, in graph_replace(outputs, replace, strict)
191 raise ValueError(f"{key} is not a part of graph")
193 sorted_replacements = sorted(
194 fg_replace.items(),
195 # sort based on the fg toposort, if a variable has no owner, it goes first
196 key=partial(toposort_key, fg, toposort),
197 reverse=True,
198 )
--> 199 fg.replace_all(sorted_replacements, import_missing=True)
200 if as_list:
201 return list(fg.outputs)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/fg.py:515, in FunctionGraph.replace_all(self, pairs, **kwargs)
513 """Replace variables in the `FunctionGraph` according to ``(var, new_var)`` pairs in a list."""
514 for var, new_var in pairs:
--> 515 self.replace(var, new_var, **kwargs)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/fg.py:508, in FunctionGraph.replace(self, var, new_var, reason, verbose, import_missing)
501 raise AssertionError(
502 "The replacement variable has a test value with "
503 "a shape different from the original variable's "
504 f"test value. Original: {tval_shape}, new: {new_tval_shape}"
505 )
507 for node, i in list(self.clients[var]):
--> 508 self.change_node_input(
509 node, i, new_var, reason=reason, import_missing=import_missing
510 )
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/fg.py:428, in FunctionGraph.change_node_input(self, node, i, new_var, reason, import_missing, check)
426 r = node.inputs[i]
427 if check and not r.type.is_super(new_var.type):
--> 428 raise TypeError(
429 f"The type of the replacement ({new_var.type}) must be "
430 f"compatible with the type of the original Variable ({r.type})."
431 )
432 node.inputs[i] = new_var
434 if r is new_var:
TypeError: The type of the replacement (Vector(float64, shape=(1,))) must be compatible with the type of the original Variable (Vector(float64, shape=(2,))).
…--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 19 Dec 2023, at 08:37, Jesse Grabowski ***@***.******@***.***>> wrote:
Variables that are always scalars shouldn't ever have dims returned, so the number of returns has changed. You will need to adjust your code to reflect this. There should be 5 returns:
initial_trend_dims, sigma_trend_dims, annual_cycle_dims, sigma_obs_dims, P0_dims = model.param_dims.values()
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7894337__;Iw!!PAKc-5URQlI!_saSn2dziJpFg2bSOcZuzKMYT0lFOEXOEUE4rBIe2a0cPd4HKgykvpTEwIWTfD7ugDDqJxAsl-TyhQ9mLYXylpIkDA$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZJFD4AHABFLA532ZQTYKE725AVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOJUGMZTO__;!!PAKc-5URQlI!_saSn2dziJpFg2bSOcZuzKMYT0lFOEXOEUE4rBIe2a0cPd4HKgykvpTEwIWTfD7ugDDqJxAsl-TyhQ9mLYUBGyviiQ$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
It is a Jupiter notebook, which you find attached. It does not depend on any input from outside. It first generates the data and then tries to recover the model.
Roland Klees
…--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 19 Dec 2023, at 09:33, Jesse Grabowski ***@***.******@***.***>> wrote:
Can you post the model you're working with now?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7894740__;Iw!!PAKc-5URQlI!6o8WSOmTyDBjwhenR7PHNuxuK0sbR8TYyAF091IIjq0ribhf9OtnIhBo8nI7gxdY1r-ZUwpJiA5ZpQhCaqYSZnDw4w$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZLZ5ZLI7LZAYOU3FSTYKFGPDAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOJUG42DA__;!!PAKc-5URQlI!6o8WSOmTyDBjwhenR7PHNuxuK0sbR8TYyAF091IIjq0ribhf9OtnIhBo8nI7gxdY1r-ZUwpJiA5ZpQhCaqbJhUB5fA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Dear Jesse,
I sent you the Jupiter notebook yesterday. I hope that you received in in good order.
R Klees
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 19 Dec 2023, at 09:33, Jesse Grabowski ***@***.******@***.***>> wrote:
Can you post the model you're working with now?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7894740__;Iw!!PAKc-5URQlI!6o8WSOmTyDBjwhenR7PHNuxuK0sbR8TYyAF091IIjq0ribhf9OtnIhBo8nI7gxdY1r-ZUwpJiA5ZpQhCaqYSZnDw4w$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZLZ5ZLI7LZAYOU3FSTYKFGPDAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOJUG42DA__;!!PAKc-5URQlI!6o8WSOmTyDBjwhenR7PHNuxuK0sbR8TYyAF091IIjq0ribhf9OtnIhBo8nI7gxdY1r-ZUwpJiA5ZpQhCaqbJhUB5fA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Dear Jesse,
I will run some tests this evening and let you know.
Roland Klees
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Jesse Grabowski ***@***.***>
Sent: Thursday, December 21, 2023 12:11:23 AM
To: pymc-devs/pymc-experimental ***@***.***>
Cc: rklees ***@***.***>; Author ***@***.***>
Subject: Re: [pymc-devs/pymc-experimental] Error message in build_statespace_graph when cycle is one of the model components (Discussion #280)
Hey I didn't see the notebook (if you use email to reply to these messages they don't add attachments).
I re-worked some more stuff and added a lot more tests, I'm pretty certain everything should work now. Just pay close attention to the names of params and dims, I did some renaming for consistency (removed "inital" from state names, and made all dim names singular [so ar_lags -> ar_lag, among others])
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7912960__;Iw!!PAKc-5URQlI!5IqNZrMZf7qUwGVu7AZW2Y-F3VoxZtFUrLP81CaYD4ZHpnSoH-o_8weZaQ2eIVjGpHo2K9yoUrM0YGJ4iBSVOILCkg$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZMP7Y6LQ4TVPM7XWALYKNWBXAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSMJSHE3DA__;!!PAKc-5URQlI!5IqNZrMZf7qUwGVu7AZW2Y-F3VoxZtFUrLP81CaYD4ZHpnSoH-o_8weZaQ2eIVjGpHo2K9yoUrM0YGJ4iBTr420VxA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Dear Jesse,
I downloaded the latest fix. Unfortunately, I don’t get it running. I get an error message from build_statespace_graph, see below. How can I send you the Jupiter notebook I use. It may help you figuring out what is going wrong.
Roland Klees
TypeError Traceback (most recent call last)
Cell In[14], line 2
1 with model_1:
----> 2 model.build_statespace_graph(data['meas'], mode="JAX")
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymc_experimental/statespace/core/statespace.py:779, in PyMCStateSpace.build_statespace_graph(self, data, register_data, mode, missing_fill_value, cov_jitter, return_updates, include_smoother)
721 """
722 Given a parameter vector `theta`, constructs the full computational graph describing the state space model and
723 the associated log probability of the data. Hidden states and log probabilities are computed via the Kalman
(...)
775 If `return_updates` is False, the method will return None.
776 """
777 pm_mod = modelcontext(None)
--> 779 self._insert_random_variables()
780 obs_coords = pm_mod.coords.get(OBS_STATE_DIM, None)
782 self.data_len = data.shape[0]
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pymc_experimental/statespace/core/statespace.py:637, in PyMCStateSpace._insert_random_variables(self)
633 matrices = list(self._unpack_statespace_with_placeholders())
634 replacement_dict = {
635 var: pt.atleast_1d(pymc_model[name]) for name, var in self._name_to_variable.items()
636 }
--> 637 self.subbed_ssm = graph_replace(matrices, replace=replacement_dict, strict=True)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/replace.py:199, in graph_replace(outputs, replace, strict)
191 raise ValueError(f"{key} is not a part of graph")
193 sorted_replacements = sorted(
194 fg_replace.items(),
195 # sort based on the fg toposort, if a variable has no owner, it goes first
196 key=partial(toposort_key, fg, toposort),
197 reverse=True,
198 )
--> 199 fg.replace_all(sorted_replacements, import_missing=True)
200 if as_list:
201 return list(fg.outputs)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/fg.py:515, in FunctionGraph.replace_all(self, pairs, **kwargs)
513 """Replace variables in the `FunctionGraph` according to ``(var, new_var)`` pairs in a list."""
514 for var, new_var in pairs:
--> 515 self.replace(var, new_var, **kwargs)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/fg.py:508, in FunctionGraph.replace(self, var, new_var, reason, verbose, import_missing)
501 raise AssertionError(
502 "The replacement variable has a test value with "
503 "a shape different from the original variable's "
504 f"test value. Original: {tval_shape}, new: {new_tval_shape}"
505 )
507 for node, i in list(self.clients[var]):
--> 508 self.change_node_input(
509 node, i, new_var, reason=reason, import_missing=import_missing
510 )
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytensor/graph/fg.py:428, in FunctionGraph.change_node_input(self, node, i, new_var, reason, import_missing, check)
426 r = node.inputs[i]
427 if check and not r.type.is_super(new_var.type):
--> 428 raise TypeError(
429 f"The type of the replacement ({new_var.type}) must be "
430 f"compatible with the type of the original Variable ({r.type})."
431 )
432 node.inputs[i] = new_var
434 if r is new_var:
TypeError: The type of the replacement (Vector(float64, shape=(1,))) must be compatible with the type of the original Variable (Vector(float64, shape=(2,))).
…--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 21 Dec 2023, at 00:11, Jesse Grabowski ***@***.******@***.***>> wrote:
Hey I didn't see the notebook (if you use email to reply to these messages they don't add attachments).
I re-worked some more stuff and added a lot more tests, I'm pretty certain everything should work now. Just pay close attention to the names of params and dims, I did some renaming for consistency (removed "inital" from state names, and made all dim names singular [so ar_lags -> ar_lag, among others])
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7912960__;Iw!!PAKc-5URQlI!5IqNZrMZf7qUwGVu7AZW2Y-F3VoxZtFUrLP81CaYD4ZHpnSoH-o_8weZaQ2eIVjGpHo2K9yoUrM0YGJ4iBSVOILCkg$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZMP7Y6LQ4TVPM7XWALYKNWBXAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSMJSHE3DA__;!!PAKc-5URQlI!5IqNZrMZf7qUwGVu7AZW2Y-F3VoxZtFUrLP81CaYD4ZHpnSoH-o_8weZaQ2eIVjGpHo2K9yoUrM0YGJ4iBTr420VxA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I uploaded some code under “issues”.
Roland Klees
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 21 Dec 2023, at 13:50, Jesse Grabowski ***@***.******@***.***>> wrote:
You can make it a gist, but it should be enough to just post the model code as you did in the first post.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7918031__;Iw!!PAKc-5URQlI!82Pk_fu9FfiPEGYR1MIkCbmrwl1hiBFZyqLJdIveQF7vxntSV4lP4U6lycs1XKRnS_dHjEIaGjwmGq8ZXnHEwVLbOw$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZP2JQDGPJN62O6C65TYKQWC7AVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSMJYGAZTC__;!!PAKc-5URQlI!82Pk_fu9FfiPEGYR1MIkCbmrwl1hiBFZyqLJdIveQF7vxntSV4lP4U6lycs1XKRnS_dHjEIaGjwmGq8ZXnFmISedFA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I also created a public gist, see rklees/SSM_test_synthetic_data.jpynb
R Klees
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 21 Dec 2023, at 13:50, Jesse Grabowski ***@***.******@***.***>> wrote:
You can make it a gist, but it should be enough to just post the model code as you did in the first post.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7918031__;Iw!!PAKc-5URQlI!82Pk_fu9FfiPEGYR1MIkCbmrwl1hiBFZyqLJdIveQF7vxntSV4lP4U6lycs1XKRnS_dHjEIaGjwmGq8ZXnHEwVLbOw$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZP2JQDGPJN62O6C65TYKQWC7AVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSMJYGAZTC__;!!PAKc-5URQlI!82Pk_fu9FfiPEGYR1MIkCbmrwl1hiBFZyqLJdIveQF7vxntSV4lP4U6lycs1XKRnS_dHjEIaGjwmGq8ZXnFmISedFA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I always did an uninstall and checked whether the files were removed. I also did restart my MacBook. I added the two dims of the cyclic/seasonal term and indeed software is now running smoothly. Thanks a lot for your support. Very much appreciated. Do I need to put a message on GitHub?
Roland Klees
--------------------------------------------
Prof. Dr.-Ing. habil. Roland Klees
***@***.******@***.***>
Delft University of Technology | Visiting address: room 2.08, Stevinweg 1, 2628 CN Delft | Postal address: PO Box 5048, 2600 GA Delft, The Netherlands | Phone +31 15 2785100 | ResearcherID: I-3574-2013 | ORCID 0000-0002-0670-2607
On 21 Dec 2023, at 15:34, Jesse Grabowski ***@***.******@***.***>> wrote:
Make sure you !pip uninstall pymc-experimental before you re-install from the bug-fix branch. I had to do this for the fixes to be applied. After that I was able to run your code. There were some mistakes in the model block, here is a corrected version. I added dims to several places that were missing them:
mod = st.LevelTrendComponent(order=2, innovations_order=[0, 1])
mod += st.CycleComponent(name='annual_cycle', cycle_length=12, innovations=True)
mod += st.FrequencySeasonality(name='SA_cycle', season_length=5.347, n=1, innovations=True)
mod += st.MeasurementError(name="obs")
model = mod.build(name="IRW+cycle+measurement_error")
initial_trend_dims, sigma_trend_dims, annual_cycle_dims, \
SA_cycle_dims, sigma_obs_dims, P0_dims = model.param_dims.values()
with pm.Model(coords=model.coords) as model_1:
P0_diag = pm.Gamma("P0_diag", alpha=2, beta=5, dims=P0_dims[0])
P0 = pm.Deterministic("P0", pt.diag(P0_diag), dims=P0_dims)
initial_trend = pm.Normal("initial_trend", dims=initial_trend_dims)
sigma_trend = pm.Gamma("sigma_trend", alpha=2, beta=10, dims=sigma_trend_dims)
annual_cycle = pm.Normal("annual_cycle", sigma=5, dims=annual_cycle_dims)
sigma_annual_cycle = pm.Gamma("sigma_annual_cycle", alpha=2, beta=5)
SA_cycle = pm.Normal("SA_cycle", sigma=5, dims=SA_cycle_dims)
sigma_SA_cycle = pm.Gamma("sigma_SA_cycle", alpha=2, beta=5)
sigma_obs = pm.Gamma("sigma_obs", alpha=2, beta=5, dims=('observed_state',))
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/pymc-devs/pymc-experimental/discussions/280*discussioncomment-7918972__;Iw!!PAKc-5URQlI!795EwULGgZqRpY9XBgNCC17bse1FJRIrSJDo5spfzAE3E9MNr7wgEbIIGNePq6WbFzzQcB029_cWxkJ1GWXDC5qi1w$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AWKBIZLNTG5FDAYKNFNUXFLYKRCHNAVCNFSM6AAAAABATE3766VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSMJYHE3TE__;!!PAKc-5URQlI!795EwULGgZqRpY9XBgNCC17bse1FJRIrSJDo5spfzAE3E9MNr7wgEbIIGNePq6WbFzzQcB029_cWxkJ1GWWMxw2PiA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Make sure you !pip uninstall pymc-experimental before you re-install from the bug-fix branch. I had to do this for the fixes to be applied. After that I was able to run your code. There were some mistakes in the model block, here is a corrected version. I added dims to several places that were missing them: