MathGroup Archive 1999

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

Search the Archive

Re: Using "Fit"

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16157] Re: [mg16128] Using "Fit"
  • From: "Tomas Garza" <tgarza at mail.internet.com.mx>
  • Date: Tue, 2 Mar 1999 01:13:09 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Philip M. Howe wrote:

> I'm trying to analyze some datasets in a moderately efficient way, and am
> having trouble. Your suggestions will be appreciated.
> 
> Suppose that I have a dataset, and I want to fit a function through a
> number of points, where I vary that number systematically, by taking just
> two {x,y} points, then three points, then four, etc. So, if "data" is my
> dataset, I can form new datasets by doing
> 
> Take[data,2], Take[data,3], etc. I can then do a fit to each dataset.
> 
> Fit[Take[data,2], {1,x},x];
> Fit[Take[data,3], {1,x},x];
> Fit[Take[data,4], {1,x},x]; etc.
> 
> But this is slow for large datasets. I can form a table of datasets.
> 
> Table[Take[data,n],{n,2,100}];
> 
> Now I'd like to apply Fit to each of the lists in the table, and I can't
> figure out the syntax. Or, perhaps there is a better approach.

Philip,

Try

Table[Fit[Take[data,n],{1,x},x],{n,2,100}];

or

Fit[Take[data,#],{1,x},x]&/@Range[2,100];

Good luck,

Tomas Garza
Mexico City


  • Prev by Date: Re: Numerical Methods
  • Next by Date: Re: Appearance in MacOS 8.5
  • Previous by thread: Re: Using "Fit"
  • Next by thread: Re: Using "Fit"