A little error is corrected below. Sorry. Bo.
> Fra: Bo Jacoby <[email protected]>
> Emne: Re: [Jprogramming] Takes from a mystery sequence
> Til: "Programming forum" <[email protected]>
> Dato: torsdag 20. august 2009 20.55
> This is a solution
>
> etc=.[: T [ {. [: T ] NB. extend
> polynomial sequence
>
> T NB. Transformation
> from values to coefficients, or back
> 3 : 0 NB. (This should be done more elegantly)
> a=.0$0
> while. #y do.
> a=. a,{.y
> y=.(}:-}.)y
> end.
> a
> )
>
> 20 etc 1 4 NB. extend sequence se0 from 2
> to 20 elements
> 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58
>
> 20 etc 0 4 20 54 NB. extend sequence se1
> from 4 to 20 elements
> 0 4 20 54 112 200 324 490 704 972 1300 1694 2160 2704 3332
> 4050 4864 5780 6804 7942
>
> b= T T b=. ? 20$100 NB. test (T T) = ]
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
>
> Bo
>
> --- Den tors 20/8/09 skrev Kip Murray <[email protected]>:
>
> > Fra: Kip Murray <[email protected]>
> > Emne: Re: [Jprogramming] Takes from a mystery
> sequence
> > Til: "Programming forum" <[email protected]>
> > Dato: torsdag 20. august 2009 16.52
> > 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
> >
>
>
> Find din nye laptop på kelkoo.dk. Se
> de gode tilbud her - http://dk.yahoo.com/r/pat/mm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
Trænger du til at se det store billede? Kelkoo giver dig gode tilbud på
LCD TV! Se her http://dk.yahoo.com/r/pat/lcd
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm