[time-nuts] exponential+linear fit

Jim Lux jimlux at earthlink.net
Sat Oct 5 12:25:04 EDT 2013


On 10/5/13 9:10 AM, Joseph Gwinn wrote:
> Re: time-nuts Digest, Vol 111, Issue 21
> On Sat, 05 Oct 2013 11:54:08 -0400, time-nuts-request at febo.com wrote:
>>
>> Message: 6
>> Date: Sat, 05 Oct 2013 08:53:52 -0700
>> From: Jim Lux <jimlux at earthlink.net>
>> To: time-nuts at febo.com
>> Subject: Re: [time-nuts] exponential+linear fit
>> Message-ID: <52503610.4040301 at earthlink.net>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> On 10/5/13 8:47 AM, Tim Shoppa wrote:
>>> How slow of a processor are you working with? A modern PC using a general
>>> purpose graphing and fitting tool (e.g. gnuplot) will fit tens of thousands
>>> of points in a fraction of a second.
>>> http://people.duke.edu/~hpgavin/gnuplot.html
>>>
>>> If you want to do this in your own code, there are lots of least-squares
>>> fitting examples in every first year numerical analysis textbook in every
>>> computer language ever written (I learned this in FORTRAN 4 naturally).
>>> http://en.wikipedia.org/wiki/Least_squares
>>>
>>> If you have hardware substantially more primitive (e.g. a PIC, a bag of
>>> 2N2222's and 555's, etc.) you have to do the fit on, then it's an
>>> interesting problem :-)
>>>
>>
>> In the future, more the latter than the former. 48 MHz ARM Cortex-M4,
>> for instance.
>>
>> For now, though, yeah, it's on a not very fast PC (Windows Experience
>> Rating around 2), but compiled matlab does it very quickly.  But, given
>> that sooner or later I'm going to be heading for a more resource
>> constrained environment, or trying to FPGA it, I'm looking for simple
>> algorithms to implement the simplified models.
>>
>> And, of course, I don't want to drag in all the libraries that one gets
>> with Matlab,Octave,gnuplot, etc.
>>
>> They're great for figuring out what's going on and trying out the
>> algorithms.
>
> There are lots of suitable subroutines available in "Numerical Recipes
> in C" by Press et al, that can be used as is, or as the starting point.
>
>   <http://apps.nrbook.com/c/index.html>
>

Yes, I have that (and in FORTRAN, too)..

It's not so much the implementation details (although efficient 
implementations are of use) as the general strategy.

e.g. do a nonlinear iterative fit to find the 4 parameters of interest 
OR do some sort of sequential "remove this" then "remove that"





More information about the time-nuts mailing list