My Math Forum  

Go Back   My Math Forum > College Math Forum > Applied Math

Applied Math Applied Math Forum


Reply
 
LinkBack Thread Tools Display Modes
April 4th, 2012, 08:19 AM   #1
Newbie
 
Joined: Apr 2012

Posts: 2
Thanks: 0

calculating coefficients to fit number series

I have a series of experimental data, let's call it d:
d[0], d[1], ..., d[n]

I know, according to the theory behind the experiment, that the d series is (approximately, because of noise in the experiment) described by a function of the form:

d(i) = p * i * log (i) + q * i + r

where p, q and r are constant real numbers and log(i) means the logarithm of i in some base. The base obviously doesn't matter since we have the p factor to accomodate it (i.e. logarithms of n for different bases only differ by a fixed ratio for any n). So we can assume that log (i) is the natural logarithm of i.

My question is: what kind of algorithm or numerical analysis tool would allow me to find the factors p and q and r so that the theoretical function best fits the data (e.g. according to the sum of the squares of the differences or some other "distance" metric).
mperdikeas is offline  
 
April 4th, 2012, 10:25 AM   #2
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 938

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: calculating coefficients to fit number series

A least-squares fit is pretty standard here.
CRGreathouse is offline  
April 4th, 2012, 11:27 AM   #3
Newbie
 
Joined: Apr 2012

Posts: 2
Thanks: 0

Re: calculating coefficients to fit number series

Yeah but the least squares is the metric we are trying to minimize. The question is: how do we select successive triplets of p, q, r ? Is it just brute-force or is there a better algorithm in this case? Even under a brute-force approach we have a 3-d space of possible p,q,r values so there must be some theory to allow us to at least bound the space of plausible values or determine what's the right level of granularity at different segments of the solution space or along different dimensions. To give a concrete example intuition would dictate that the granularity one uses when trying different values on the p-axis is a lot more finer than the granularity for the r-axis.

I mean do we start with a guess triplet p0,q0,r0 (using intuition) and somehow wander off from that starting point based on the results we get on each point along the way? Do we "spray"the 3-d space uniformly with triplets we wish to check and choose the best one? What is the current state of theory in numerical algorithms on how one approaches that kind of problems? I know about particle swarm algorithms and all that but I was hoping that for closed formulas one can use mathematical analysis (I was thinking derivatives) and not some kind of randomized brute force walk in the solution space.
mperdikeas is offline  
April 4th, 2012, 12:42 PM   #4
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 938

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: calculating coefficients to fit number series

There are well-known and widely-implemented algorithms for solving these sorts of problems. You can even do it in a spreadsheet if you like. R is a good tool (or S or SAS or the like), OOo Calc can do it, Mathematica and Matlab can do it. PARI/GP can do it. I imagine Maxima and others can do it as well.
CRGreathouse is offline  
Reply

  My Math Forum > College Math Forum > Applied Math

Tags
calculating, coefficients, fit, number, series



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculating a series hasti Real Analysis 1 February 28th, 2013 05:40 AM
calculating portfolio weights from regression coefficients xact Algebra 0 April 17th, 2012 09:53 AM
calculating the number of matrices icemanfan Linear Algebra 1 February 28th, 2012 04:00 PM
Calculating Coefficients bakerconspiracy Advanced Statistics 0 April 14th, 2011 05:49 PM
calculating a series hasti Applied Math 0 December 31st, 1969 04:00 PM





Copyright © 2019 My Math Forum. All rights reserved.