MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Linear and logarithmic fit


Use regression and choose the model that minimizes the sum of squared 
errors (or some other measure of total error, if you prefer).

Here's a bit of sample data, three possible models, and the sum of squared 
error for each:

data = {#, Random[] + 0.3Log@# + 0.2#} & /@ Range[9]
{x, y} = Transpose@data;
Fit[data, {1, Log@q}, q]
error = #.# &[(% /. q -> x) - y]
Fit[data, {1, q}, q]
error = #.# &[(% /. q -> x) - y]
Fit[data, {1, q, Log@q}, q]
error = #.# &[(% /. q -> x) - y]

Bobby

On Wed, 12 Feb 2003 03:54:03 -0500 (EST), jay Johnson <joh_nson at yahoo.com> 
wrote:

> Hi everybody,
>
> If I have 9 points in a 2 dimensional space how do I decide if they
> fit better a linear function or a logarithmic function?
>
> Thanks in advance,
>
> Jay
>
>



-- 
majort at cox-internet.com
Bobby R. Treat



  • Prev by Date: Re: a first-time user question
  • Next by Date: RE: Plotting Root Functions
  • Previous by thread: Linear and logarithmic fit
  • Next by thread: Re: Linear and logarithmic fit