ParametricDMD for scalar time-series #365
Replies: 9 comments
-
Hi @alirezakarimi82, I propose pairing from pydmd import ParametricDMD, HankelDMD
from ezyrb import POD, RBF
pdmd = ParametricDMD(dmds, POD(svd_rank=-1), RBF())
# params x space x time
X = np.arange(100*len(params)).reshape(len(params), 1, 100)
params = np.array([0.5 * i for i in range(20)])
pdmd.fit(X, params)
pdmd.parameters = np.array([0.25, 0.75])
pdmd.reconstructed_data Let me know if you need more clarification. What I think is the problem in your case is that you did not provide an appropriate shape for |
Beta Was this translation helpful? Give feedback.
-
Thanks @fAndreuzzi for your prompt reply. The shape of X in my code was right. However, after fitting the ParametricDMD to my training data all the reconstructed data rows are zeros. I'm wondering what causes this issue. This is my code: dmds = [HankelDMD(svd_rank=-1) for _ in range(len(params))]
pdmd = ParametricDMD(dmds, POD(rank=-1), RBF())
pdmd.fit(x_train, params)
pdmd.parameters = params
pdmd.reconstructed_data By the way, as a side note, for each time series I have two parameters, so my params array has a shape of (10, 2), for example. I just to want to make sure it doesn't cause any issue. |
Beta Was this translation helpful? Give feedback.
-
This should work @alirezakarimi82, if you notice any problem it means there's a bug to fix :)
You should set the parameter |
Beta Was this translation helpful? Give feedback.
-
Thanks again. Using your advice and also setting exact and opt to True, I was able to train and obtain good reconstructed data. There is another question which I very much appreciate to know your recommendation. I'm trying to model multiple types of variables as time series. For smooth signals, the combination of sub_dmd = HankelDMD(svd_rank=-1, exact=True, opt=True, d=5)
dmds = [MrDMD(sub_dmd, max_level=7, max_cycles=1) for _ in range(len(training_params))]
pdmd = ParametricDMD(dmds, POD(rank=-1), RBF())
pdmd.fit(training_snapshots, training_params) |
Beta Was this translation helpful? Give feedback.
-
Hi @alirezakarimi82, I'm happy that my solution did the work.
You're using a kind of triple nested DMD, which is something we never tested internally (even MrDMD+(*DMD) different than the standard one is quite new in PyDMD, #260). This is an interesting behavior and might be related to #251. Does this happen in |
Beta Was this translation helpful? Give feedback.
-
This happens in |
Beta Was this translation helpful? Give feedback.
-
I'll check, thanks for the report. |
Beta Was this translation helpful? Give feedback.
-
Hi @alirezakarimi82, sorry for the long wait but I couldn't work on this for a few weeks. Could you please provide your dataset? I tried a few examples, but it looks like the problem occurs only when pathological data is provided (e.g. all-zero matrix). |
Beta Was this translation helpful? Give feedback.
-
Thanks @fAndreuzzi for following up. Since it is proprietary data, unfortunately I cannot share it. But my data is not ill-posed as far as I know. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to model a parametric dynamical system which is not a function of space. So, basically for each value of the parameter we have a scalar time series. However, it seems that the current implementation of the ParametricDMD is not able to handle the case when the training snapshots are not a function of space. I guess implementing that feature as a special case should be straightforward and I'd appreciate if you could help me in this regard.
Beta Was this translation helpful? Give feedback.
All reactions