help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] Polynomial Regression


From: Brian Gough
Subject: Re: [Help-gsl] Polynomial Regression
Date: Thu, 21 Jun 2007 16:56:17 +0100
User-agent: Wanderlust/2.14.0 (Africa) Emacs/21.3 Mule/5.0 (SAKAKI)

At Wed, 20 Jun 2007 09:34:29 -0700,
Jack Denman wrote:
> I remember from the "bad old days" a FORTRAN package that called
> statpack or statpac than started with linear regression and
> proceeded to increase the degree of the polynomial until there was
> no further reduction in the sum of the squares.

Hello,

I know the algorithm you mean, by Shampine, it's not currently
available in GSL though.

> Is there a way to run a cubic regression. My second degree
> regression was with the following calls from examples in the gsl
> HTML page.

You can extend the matrix X with an extra column for x**3 (or any
other term that you want to add to the fit),

   X = gsl_matrix_alloc (n, 4)
   ....
   gsl_matrix_set (X, i, 3, xi * xi * xi);

The corresponding sizes of the other vectors and matrices will also
need to be increased from 3 to 4.

-- 
Brian Gough
(GSL Maintainer)

Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]