Do you know where your variables are? PerlMonks

### quadratic and exponential regression

by halfcountplus (Hermit)
 on Jan 14, 2013 at 16:52 UTC Need Help??
halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:

I was just wincing through math related stuff on CPAN (math makes me wince), and there seems to be a bunch of tools for linear regression, but I can't find a thing for quadratic and exponential regression.

Anyone know of anything?

Replies are listed 'Best First'.
Re: quadratic and exponential regression
by talexb (Canon) on Jan 14, 2013 at 17:49 UTC

A long time ago, I used a Texas Instruments SR-50A to do linear regression in high school. This calculator had a single memory location, and the manual explained the procedure. Good times.

So, if you're trying to do exponential regression, how about just doing linear regression on x, log( f( x ) ) values? You can convert that back into an exponential afterwards.

That's what I'd try.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Thanks much for the tip!

(and the groklaw link)

Re: quadratic and exponential regression
by roboticus (Chancellor) on Jan 15, 2013 at 15:05 UTC

I noticed Algorithm::CurveFit, and it looks like it would do the job, though it seems you have to define your error function with Math::Symbolic. It's too bad they didn't simply specify the interface to a function you could provide. (Well, they may, but a brief review of the docs didn't make that obvious to me.)

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Create A New User
Node Status?
node history
Node Type: perlquestion [id://1013240]
Approved by davido
Front-paged by Arunbear
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2017-06-24 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
How many monitors do you use while coding?

Results (555 votes). Check out past polls.