MathGroup Archive 2009

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

Search the Archive

Re: FindFit & NIntegrate

  • To: mathgroup at
  • Subject: [mg96141] Re: FindFit & NIntegrate
  • From: dh <dh at>
  • Date: Fri, 6 Feb 2009 04:13:50 -0500 (EST)
  • References: <gmecbc$acc$>


this problem comes up all the time. The cause is, that FindFit first 

calls the model with symbolic arguments and parameters, in order to see 

if it can simplify it. To prevent this, you have to declare the model 

argument as numerical, like e.g.:


hope this helps, Daniel

hmalissa wrote:

> I want to use the FindFit function (or similar) to fit some

> experimental data:


> fit=FindFit[data,expr,pars,vars]


> Usually this works very well, but in this particular case the model

> expr consists of a NIntegrate over another function, like:


> model[x_,a_,b_,c_]:=NIntegrate[function[x_,t_,a_,b_,c_],{t,0,inf}];

> fit=FindFit[data,model[x,a,b,c],{a,b,c},x]


> FindFit now complains about non-numerical values; of course that makes

> sense.

> How can I force FindFit to do the fitting anyway?


  • Prev by Date: Re: Options for Eigenvalues
  • Next by Date: Re: Options for Eigenvalues
  • Previous by thread: Re: FindFit & NIntegrate
  • Next by thread: Re: FindFit & NIntegrate