[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trendline fit
From: |
Marcus G. Daniels |
Subject: |
Re: trendline fit |
Date: |
31 May 1999 17:06:16 -0700 |
User-agent: |
Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3.10 |
>>>>> "TP" == Tamas Papp <address@hidden> writes:
TP> I'm looking for a solution for fitting a trendline (an equation of
TP> the form y=ax+b) on a set of (x,y) pairs. Any library would do,
TP> the problem is that I don't know any (I haven't done it
TP> before).
TP> It would be nice if it was in some kind of C, and easy to use.
Here's a new C++ library that has some regression features.
ftp://ftp.gnu.org/pub/goose/goose-0.0.9.tar.gz
Below is a demo using it's Guile shell:
$ gooseshell
goose> (define rs1 (make-realset 1 2 3 4))
goose> (define rs2 (make-realset 5 6 7 8))
goose> (linear-regression rs1 rs2)
<linear-regression: y = 1.000000 x + 4.000000, r = 1.000000>
The C++ usage is similiar:
void LinearRegression::model(const RealSet& x, const RealSet& y)
PJ> If you have a nice, quick algorithm to find medians, please give it to
PJ> me, because I've tried pretty hard with this one.
goose> (define rs3 (make-realset 1 1 1 1 1 1 3 4 5 6 8 9 10 11 20 100 100))
goose> (realset-percentile rs3 .5)
5.0
[But, judging from the source, it uses sorted data.]
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- trendline fit, Tamas Papp, 1999/05/06
- Re: trendline fit,
Marcus G. Daniels <=