MathGroup Archive 2011

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

Search the Archive

Re: NonlinearModelFit: Freezing parameters

  • To: mathgroup at
  • Subject: [mg117484] Re: NonlinearModelFit: Freezing parameters
  • From: Peter Pein <petsie at>
  • Date: Sun, 20 Mar 2011 04:53:44 -0500 (EST)
  • References: <im201l$tl$>

Am 19.03.2011 11:20, schrieb dg:
> Hello,
> is there an easy way to disable the fitting of some of the parameters
> (and force them to some constant value) in NonlinerModelFit?
> I searched the documentation and online and could not find anything.
> Obviously I am looking for something different from just having to
> change the model by removing the parameters I want to be constant
> every time.
> Thanks.


you can wrap a Block[] around the call to NonlinearModelFit (NMF). You 
just have to change the way how the parameters are given to NMF using 

In[1]:= model=a0+a1 x+a2 x^2;

the normal call to NMF:
In[3]:= f0=NonlinearModelFit[data,model,Variables[{a0,a1,a2}],x]//Normal
Out[3]= 0.22546 + 0.601959 x + 0.416822 x^2

Say you knew a0=1/4:

In[4]:= f1=Block[{a0=.25},
Out[4]= 0.25 + 0.557096 x + 0.434077 x^2


  • Prev by Date: Re: Wolfram, meet Stefan and Boltzmann
  • Next by Date: Re: Mathematica 8 bug (related to Graph[])
  • Previous by thread: NonlinearModelFit: Freezing parameters
  • Next by thread: Re: NonlinearModelFit: Freezing parameters