Re: Non linear model fitting with an integral model
- To: mathgroup at smc.vnet.net
- Subject: [mg125425] Re: Non linear model fitting with an integral model
- From: DC <b.gatessucks at gmail.com>
- Date: Tue, 13 Mar 2012 03:07:13 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jjkeeg$1a6$1@smc.vnet.net>
Use ?NumericQ in the definition of your model : In[2]:= data=Table[{i,i^2+RandomReal[{-0.5,-.5}]},{i,1,5}] Out[2]= {{1,0.5},{2,3.5},{3,8.5},{4,15.5},{5,24.5}} In[3]:= model[a_?NumericQ, b_?NumericQ,x_?NumericQ]:=Integrate[a t+b,{t,0,x}] In[4]:= NonlinearModelFit[data,model[a,b,x],{a,b},x] Out[4]= FittedModel[model[2.1087,-0.358696,x]]