MathGroup Archive 2003

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

Search the Archive

Report using Fit


Hi all,
Despite the documentation, does anyone know if Fit can give best fit 
parameters as Regress does? The reason I ask is that, Fit is a lot 
faster than Regress if you have large volumes of data to deal with. 
Regress slows down because (I assume) it is generating the "pretty" 
output. Is there another way of getting at the output of Regress 
(perhaps) before formatting via RegressionReport. Below is an example.

Yas

In[668]:=
Clear[b,nr,nc,ns,nv,syndat,a0,gt1,gt2]

In[650]:=
b={0.1,0.2,0.3};
nr=4;
nc=4;
ns=5;
nv=Length[b];
syndat=Range[nr*nc*ns*nv];
a0=nr*nc*ns;

In[657]:=
yVals=Transpose[Partition[syndat,a0]];
model={1,x};
var=x;
parms=RegressionReport\[Rule]BestFit;

gt1=Table[{{b,yVals[[i]]}//Transpose,model,var},{i,1,a0,1}]//Transpose;

In[662]:=
hmm=MapThread[Fit,gt];//Timing

Out[662]=
{0.03 Second,Null}

In[666]:=
gt2=Table[{{b,yVals[[i]]}//Transpose,model,var,parms},{i,1,a0,1}]//Transpose;
doublehmm=MapThread[Regress,gt];//Timing

Out[667]=
{1.21 Second,Null}



  • Prev by Date: RE: New Plot output in version 5
  • Next by Date: Re: serious NDSolve bug?
  • Previous by thread: RE: New Plot output in version 5
  • Next by thread: Re: serious NDSolve bug?