MathGroup Archive 2005

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

Search the Archive

Re: NonLinearRegress and constraint parameters

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57206] Re: [mg57148] NonLinearRegress and constraint parameters
  • From: frank at kuesterei.ch (Frank Küster)
  • Date: Sat, 21 May 2005 02:39:19 -0400 (EDT)
  • References: <200505190708.DAA13073@smc.vnet.net> <acbec1a4050519193436b61667@mail.gmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

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