Closed ego-thales closed 1 year ago
I thought a little bit about it when implementing the restrict method. I agree that this problem exists, specially for measurements which are not very dense. At that moment I did not thought about interpolating at the boundaries, which is probably a reasonable approach. I thus would love to add such an option.
I think that this option as proposed would also be applicable to high dimensional functions (surfaces and so on). If that is true I have nothing against it.
Solved in #561.
Hi,
Currently,
FDataGrid.restrict(domain)
eliminates points outside ofdomain
. As a consequence, the first (resp. last) grid point (in the 1D case) might be relatively far from the lower (resp. upper) bound ofdomain
. In this case, after restriction, between the bound and the grid point,skfda
will essentially use extrapolation, when only interpolation should occur, which might lower the accuracy of the "guess".For example:
This is why I propose to add an
include_bounds
option, that would interpolate at boundaries before restricting if the grid points don't include thedomain
values. The option default value should be discussed. IfTrue
might seem better, it will also silently add new grid_points, which might not be wanted.What do you think about it? Élie