MathGroup Archive 2005

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

Search the Archive

Re: NonLinearRegress and constraint parameters


Chris Chiasson <chris.chiasson at gmail.com> wrote:

> http://forums.wolfram.com/mathgroup/archive/2003/Sep/msg00184.html
>

Thanks for the hint - I didn't find this.  However, with Mathematica 5.1
it does not seem to work:

In[1]:=

modelgenerate[x_]:=a*x+b*x^2+c*x^3
modelanalyse[x_]:=a*x+b*x^2
dat=Range[0,10,0.1];
xydat=Map[{#,modelgenerate[#]/.{a->2,b->3,c->0.5}}&,dat];
<<Statistics`NonlinearFit`
fitresult= 
    NonlinearRegress[xydat,modelanalyse[x],{x},{a,b},
      ShowProgress->False];
fitresultconstrained1=
    NonlinearRegress[xydat,modelanalyse[x],{x},
      {{a,{-15,-14},-18,-10},{b,{5,50},0,100}},
      ShowProgress->False];
(* This gives an error message:
fitresultconstrained2=
    NonlinearRegress[xydat,modelanalyse[x],{x},
        {{a,{-18,-10},-15,-14},{b,{5,50},0,100}},
        ShowProgress->False];*)
BestFitParameters/.fitresult
BestFitParameters/.fitresultconstrained1

Out[8]=
{a->-18.1977,b->9.69956}

Out[9]=
{a->-18.1977,b->9.69956}

Regards, Frank

-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer


  • Prev by Date: Clearing function definitions by argument type?
  • Next by Date: Re: four approaches to do a simple sum
  • Previous by thread: Re: NonLinearRegress and constraint parameters
  • Next by thread: Re: Beginner : how to convert .bmp or .jpeg fordigital processing