[Scilab-users] Insufficient documentation of interp1

classic Classic list List threaded Threaded
3 messages Options
fmiyara fmiyara
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Insufficient documentation of interp1


Dear All,

I find that the extrapolation option for interp1 is not thoroughly documented. In the Arguments section it states, for extrapolation,


(optional) string, or real value defining the yp(j) components for xp(j) values outside [x1,xn] interval.

In the Description section the only string listed is "extrap" which says:

the extrapolation is performed by the defined method

 
But which is the defined method? If one selects the method "spline" it is suggested to refer to interp(), which has a specific argument (called out_mode) with several possibilities for extrapolation. These possibilities aren't accessible from the interp1() function, so it should be completely clear in its documantation which one is used.

Besides, the argument extrapolation is optional but it is not clear what happens if it is not used. I suppose it is what appears under "by default", but again it says

the extrapolation is performed by the defined method (for spline method)


But, as already mentioned, tha spline method has more than one extrapolation strategy, which can be selected from interp but not from interp1.

Finally, at least for spline it seems to be no difference between setting the extrapolation argument to "extrap" or not using it.

Regards,

Federico Miyara
 

Libre de virus. www.avast.com

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Insufficient documentation of interp1

Le 10/01/2021 à 08:18, Federico Miyara a écrit :

Dear All,

I find that the extrapolation option for interp1 is not thoroughly documented. In the Arguments section it states, for extrapolation,


(optional) string, or real value defining the yp(j) components for xp(j) values outside [x1,xn] interval.

In the Description section the only string listed is "extrap" which says:

the extrapolation is performed by the defined method

 
But which is the defined method?

<method>, used for interpolation.


If one selects the method "spline" it is suggested to refer to interp(), which has a specific argument (called out_mode) with several possibilities for extrapolation. These possibilities aren't accessible from the interp1() function, so it should be completely clear in its documantation which one is used.


Right. This is true also for interp(), for which the default extrapolation behavior is not documented.



Besides, the argument extrapolation is optional but it is not clear what happens if it is not used. I suppose it is what appears under "by default",


Sure


but again it says

the extrapolation is performed by the defined method (for spline method)


But, as already mentioned, tha spline method has more than one extrapolation strategy, which can be selected from interp but not from interp1.


It is the same remark as above.

Finally, at least for spline it seems to be no difference between setting the extrapolation argument to "extrap" or not using it.

According to the current documentation,

interp1(x, y, xp, "spline", "extrap")  // is equivalent to
interp1(x, y, xp, "spline", "spline")

// while

interp1(x, y, xp, "spline")  // is as well equivalent to
interp1(x, y, xp, "spline", "spline")

So yes, same results are expected.

But i find as well the "by default" explanation uselessly complicated: From
  by default :
       the extrapolation is performed by the defined method (for spline method), and by nan for
       linear and nearest methods. yp=interp1(x,y,xp,method)
it could rather be something like
  by default :
       the extrapolation is performed by spline when the interpolation is done by spline, and by nan for
       linear and nearest interpolation methods.

Samuel Gougeon



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fmiyara fmiyara
Reply | Threaded
Open this post in threaded view
|

Re: Insufficient documentation of interp1


Samuel,

Thanks for your comments, which encouraged me to submit bug #16629.

Regards,

Federico Miyara


On 10/01/2021 11:18, Samuel Gougeon wrote:
Le 10/01/2021 à 08:18, Federico Miyara a écrit :

Dear All,

I find that the extrapolation option for interp1 is not thoroughly documented. In the Arguments section it states, for extrapolation,


(optional) string, or real value defining the yp(j) components for xp(j) values outside [x1,xn] interval.

In the Description section the only string listed is "extrap" which says:

the extrapolation is performed by the defined method

 
But which is the defined method?

<method>, used for interpolation.


If one selects the method "spline" it is suggested to refer to interp(), which has a specific argument (called out_mode) with several possibilities for extrapolation. These possibilities aren't accessible from the interp1() function, so it should be completely clear in its documantation which one is used.


Right. This is true also for interp(), for which the default extrapolation behavior is not documented.



Besides, the argument extrapolation is optional but it is not clear what happens if it is not used. I suppose it is what appears under "by default",


Sure


but again it says

the extrapolation is performed by the defined method (for spline method)


But, as already mentioned, tha spline method has more than one extrapolation strategy, which can be selected from interp but not from interp1.


It is the same remark as above.

Finally, at least for spline it seems to be no difference between setting the extrapolation argument to "extrap" or not using it.

According to the current documentation,

interp1(x, y, xp, "spline", "extrap")  // is equivalent to
interp1(x, y, xp, "spline", "spline")

// while

interp1(x, y, xp, "spline")  // is as well equivalent to
interp1(x, y, xp, "spline", "spline")

So yes, same results are expected.

But i find as well the "by default" explanation uselessly complicated: From
  by default :
       the extrapolation is performed by the defined method (for spline method), and by nan for
       linear and nearest methods. yp=interp1(x,y,xp,method)
it could rather be something like
  by default :
       the extrapolation is performed by spline when the interpolation is done by spline, and by nan for
       linear and nearest interpolation methods.

Samuel Gougeon



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users


Libre de virus. www.avast.com

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users