Bill Allombert on Tue, 17 May 2011 19:18:20 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Spreading the word


On Tue, May 17, 2011 at 10:53:41AM -0400, Charles Greathouse wrote:
> Third, there are some tasks I have avoided coding because I can't find any
> good way to do them in GP.  Not that I can't do them -- GP is
> Turing-complete, after all -- but I feel that these should have an easy
> solution and I hate to submit a clumsy solution if an elegant one might be
> at hand.  For example:
> http://rosettacode.org/wiki/Reduced_row_echelon_form

No idea. This is not the first time this come up on this list.

> http://rosettacode.org/wiki/Polynomial_regression

This one seems poorly defined. Should we do a Lagrange interpolation , least-square fit, or
something else ?

Lagrange interpolation:

? polinterpolate([0,1,2,3,4,5,6,7,8,9,10],[1,6,17,34,57,86,121,162,209,262,321])
%13 = 3*x^2 + 2*x + 1

least-square fit:

? V=[1,6,17,34,57,86,121,162,209,262,321]~;
? M=matrix(#V,3,i,j,(i-1)^(j-1));Polrev(matsolve(M~*M,M~*V))
%40 = 3*x^2 + 2*x + 1

Cheers,
Bill.