(re-posting on the advice of Ken Pledger of the sci.math group)
Hello;
1) I have numerous sufficiently-smooth (analytical) multidimensional data sets. Let us only consider the 1D sets. I need to set the 1st derivative at the endpoints for a cubic spline interpolation in 1D. Setting the 2nd derivative to zero (natural spline) at the boundaries does not appear to be practical, since the 1st derivative would be close to infinity at those points, and I'd later need the 1st derivative at all the set points!
2) The simplest alternative approach would be to join the N points of the set by a polynomial of degree N-1 and calculate the 1st derivative at the endpoints, and input those values for the cubic spline. Obviously, if N, say, equals 40 for one data set, then it does not make sense in this case to apply a 39th deg poly to compute the 1st derivative at the boundaries!!
3) Instead of using the entire N points, I thought it might be suffice to use only 3 points (for 2nd deg poly) or 4 points (for 3rd deg poly) at each end for the 1st derivative. But would using few points at each end be good enough ??
4) Realizing polys are the easiest to apply and most difficult to predict, I wonder if there're some mathematical criteria that one should observe in deciding how many points would be sufficient for a particular data set, so that the 1st derivative there would be "realistic and more representative" of the data set.
Would some statistical characteristics describing the data help ??
Do you expert recommend a better approach for setting the 1st derivative at the endpoints for cubic splines ??
Your comments/suggestions would be greatly appreciated.
In article <6a07f408-e5ee-4ec9-855a-f75ebca45...@o31g2000vbi.googlegroups.com>,
monir <mon...@mondenet.com> writes: >(re-posting on the advice of Ken Pledger of the sci.math group)
>Hello;
>1) I have numerous sufficiently-smooth (analytical) multidimensional >data sets. >Let us only consider the 1D sets. >I need to set the 1st derivative at the endpoints for a cubic spline >interpolation in 1D. >Setting the 2nd derivative to zero (natural spline) at the boundaries >does not appear to be practical, since the 1st derivative would be >close to infinity at those points, and I'd later need the 1st >derivative at all the set points!
this sounds no good, since the interpolation error is dependent on the (local) derivatives and hence might be huge (this holds whatever interpolation you might invent)
>2) The simplest alternative approach would be to join the N points of >the set by a polynomial of degree N-1 and calculate the 1st derivative >at the endpoints, and input those values for the cubic spline. >Obviously, if N, say, equals 40 for one data set, then it does not >make sense in this case to apply a 39th deg poly to compute the 1st >derivative at the boundaries!!
terrible idea. try this with 10, 20,... equidistant data points and plot the polynomial. you will never try this again, for sure
>3) Instead of using the entire N points, I thought it might be suffice >to use only 3 points (for 2nd deg poly) or 4 points (for 3rd deg poly) >at each end for the 1st derivative. >But would using few points at each end be good enough ??
much better idea, and for comformity with the spline approximation which is h^4 (h = grid size) a third order polynomial suffices (i.e. four points)
>4) Realizing polys are the easiest to apply and most difficult to >predict, I wonder if there're some mathematical criteria that one >should observe in deciding how many points would be sufficient for a >particular data set, so that the 1st derivative there would be >"realistic and more representative" of the data set.
yes, see above: the interpolation error in the derivative value should not destroy the goodness of fit of the main scheme
>Would some statistical characteristics describing the data help ??
??? hopefully the data are noise free, otherwise local interpolation is nothing good at all, and instead of an interpolating spline you might use a smoothing spline which would not need artificial end conditions.
>Do you expert recommend a better approach for setting the 1st >derivative at the endpoints for cubic splines ??
>Your comments/suggestions would be greatly appreciated.
>Monir
with very large derivative values at the end points you better might obtain estimates of these by using local rational interpolation. something like (a0+a1*x)/(1+b1*x+b2*x^2)
hence y(i) = a0 + a1*x(i) - y(i)*x(i)*b1 -y(i)*x(i)^2*b2 i=0,1,2,3 give a system of four equations for the four unknowns remainder analysis left as an exercise in taylorseries (for y(x) ) in my next unseen.
anyway, here is a set of formulae for the derivative at the left endpoint x0 of an equidistant grid : values f(x0+i*h) i=0,1,.... get the coefficients from the list, added up, divided by common denominator)
On Nov 18, 10:27 am, spellu...@fb04633.mathematik.tu-darmstadt.de
(Peter Spellucci) wrote:
> monir <mon...@mondenet.com> writes: > >(re-posting on the advice of Ken Pledger of the sci.math group)
Peter;
Thank you for your prompt and thoughtful reply.
I tried earlier the 4-point 3rd deg poly at the endpoints, and am anxious to try your suggested rational form / Taylor series with the remainder term, and compare the results.
Will report back shortly. Thanks again for your help.