P.S. Well, any data has an exact polynomial fit, so maybe I should have said 
"exact low degree polynomial fit".  Maybe what I want is a verb whose left 
argument n requests a fit of degree n or less for the right argument.

Kip Murray wrote:
> Thank you, Ambrus, I will study your verbs.  Of course I would like the 
> lowest 
> degree that fits the data.  I'm assuming data that has an exact polynomial 
> fit.
> 
> Kip
> 
> Zsbán Ambrus wrote:
>> On Tue, Aug 18, 2009 at 11:27 PM, Kip Murray<[email protected]> wrote:
>>> Have you seen a polynomial-fitting verb for data such as iii0 10 and iii1 
>>> 10 ?
>> Sure, and it's quite simple:
>>
>>    se0=: 1 4  7 10  13  16  19  22  25  28
>>    se1=: 0 4 20 54 112 200 324 490 704 972
>>    ]p0 =: (%.[:^/~...@#) se0
>> 1 3 7.97184e_8 _7.964e_8 4.15017e_8 _1.25439e_8 2.27913e_9
>> _2.45331e_10 1.44069e_11 _3.55401e_13
>>    p0 p. i. 10
>> 1 4 7 10 13 16 19 22 25 28
>>    ]p1 =: (%.[:^/~...@#) se1
>> _7.96167e_11 2.1526e_7 3 1 _2.66006e_7 7.83796e_8 _1.39068e_8
>> 1.46474e_9 _8.43371e_11 2.04392e_12
>>    p1 p. i. 10
>> _7.96167e_11 4 20 54 112 200 324 490 704 972
>>    NB. or, if you want lower degree polynomyals
>>    ]p0d2 =: (%.2^/&i.~#) se0
>> 1 3
>>    p0d2 p. i. 10
>> 1 4 7 10 13 16 19 22 25 28
>>    ]p1d4 =: (%.4^/&i.~#) se1
>> 1.3074e_12 _2.50111e_12 3 1
>>    p1d4 p. i. 10
>> 1.3074e_12 4 20 54 112 200 324 490 704 972
>>
>> Ambrus
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to