interp_nearest

interp_nearest(prev_data: Tensor, next_data: Tensor, sample_at: Tensor, step_time: float, **kwargs) Tensor[source]

Interpolates by selecting the nearest state.

\[\begin{split}D(t_s) = \begin{cases} D(\Delta t) &\Delta t - t_s > t_s\\ D(0) &\text{otherwise} \end{cases}\end{split}\]
Parameters:
  • prev_data (torch.Tensor) – most recent observation prior to sample time, \(D(t=0)\).

  • next_data (torch.Tensor) – most recent observation subsequent to sample time, \(D(t=\Delta t)\).

  • sample_at (torch.Tensor) – relative time at which to sample data, \(t_s\).

  • step_time (float) – length of time between the prior and subsequent observations, \(\Delta t\).

Returns:

interpolated data at sample time, \(D(t=t_s)\).

Return type:

torch.Tensor