Wikipedia:Reference desk/Archives/Mathematics/2015 November 15

Mathematics desk
< November 14 << Oct | November | Dec >> Current desk >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


November 15 edit

piecewise polynomial least squares edit

(I tried math.stackexchange and got no response for a week. Boo hoo.)

I have in mind a project involving a least-squares fit using piecewise polynomials; at a finite number of known arguments xj, the kjth derivative is discontinuous.

How many basis functions are needed? My guess is: xn for 0≤n<min(k), and then, for each j,n such that kjn ≤ the maximum degree, a pair of functions which are zero on one side and (x-xj)n on the other. Is that right?

In general, I welcome any pointers that might reduce the number of wheels I'll reinvent. —Tamfang (talk) 07:00, 15 November 2015 (UTC)[reply]

Just trying to understand the problem here. You are trying to create a spline composed of multiple polynomial arcs, right ? The adjacent arc endpoints must have point continuity, of course, but how about tangent & curvature continuity, etc. ? Since you are using least squares method, I assume you don't need an exact fit. So, how many points would each arc run through ? (Just offhand, this method sounds like it would generate an extremely "lumpy" spline.) I assume you already know how the number of constraints relates to the degree of the polynomial ? StuRat (talk) 07:12, 15 November 2015 (UTC)[reply]
Sure, let's say I'm trying to create a spline composed of multiple polynomial arcs, and the degree of continuity is kj-1. Maybe I like it runny lumpy; if it's lumpier than I like, I'll increase kj. Rather than discrete points, my input is piecewise continuous, so the algo involves integrals rather than sums. Number of constraints, in the sense I think you mean, is not meaningful here. —Tamfang (talk) 08:51, 15 November 2015 (UTC)[reply]
If the function is on the domain  , and the polynomials are of degree at most d, and for   the derivatives at   are expected to be continuous up to   (  constraints), then I'm pretty sure the number of degrees of freedom is  . -- Meni Rosenfeld (talk) 09:53, 15 November 2015 (UTC)[reply]
And I think the following basis functions will work (probably the same as what you wrote, but I think is clearer): Letting  , for each   and  , the function which is 0 for   and   for  . This also means their number can be rewritten as  . -- Meni Rosenfeld (talk) 10:06, 15 November 2015 (UTC)[reply]
Hm ... thanks, yes, I think that does work; the k0=0 is a good gimmick (removing some special cases from the description). You've saved me some redundancy; I was thinking that for each discontinuity I'd need pairs of functions: zero on the left and (x-xj)n on the right, (x-xj)n on the left and zero on the right. —Tamfang (talk) 03:51, 24 November 2015 (UTC)[reply]
Meni, thanks again; see result at [1]. —Tamfang (talk) 22:51, 8 December 2015 (UTC)[reply]
This is above my head (I don't know why I even look at this notice board!) but does Savitzky–Golay filter help? Thincat (talk) 09:00, 20 November 2015 (UTC)[reply]
That's interesting, but no. —Tamfang (talk) 03:03, 22 November 2015 (UTC)[reply]