How to define a temporal PDE library with multiple trajectories? #323
-
I understand when fitting the data multiple trajectories should be passed as a list each with (num_samples, num_features) such as:
where both X and t are the list of trajectories. When defining a PDE lib such as:
how do I pass the proper temporal grid because each trajectory contains a different number of samples? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi there @itsjacobhere. Enabling differing (spatio)temporal grids for different trajectories is on our list of features to implement (#222), so unfortunately, it isn't possible yet. I've been wanting to do this for a while, and it isn't that hard, but it will require a lot of small changes that will need to be validated. Instead, the best current solution is to interpolate the trajectories onto a common temporal grid. If you have data |
Beta Was this translation helpful? Give feedback.
Hi there @itsjacobhere. Enabling differing (spatio)temporal grids for different trajectories is on our list of features to implement (#222), so unfortunately, it isn't possible yet. I've been wanting to do this for a while, and it isn't that hard, but it will require a lot of small changes that will need to be validated.
Instead, the best current solution is to interpolate the trajectories onto a common temporal grid. If you have data
x1
andx2
on gridst1=np.arange(0, T1, dt1)
andt2=np.arange(0,T2,dt2)
, then maybe definet=np.arange(0,np.min(T1,T2),np.min(dt1,dt2))
and usescipy.interpolate.interp1d
to producex1_interp=interp1d(x1,t)
andx2_interp=interp1d(x2,t)
, thenmodel.fit([x1_int…