Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: conditionals during nonlinear regression

  • To: mathgroup at
  • Subject: [mg28426] Re: [mg28420] conditionals during nonlinear regression
  • From: BobHanlon at
  • Date: Wed, 18 Apr 2001 03:23:29 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Make ds a parameter of the model

model = (2-ds)*(a1*Exp[m]+b1)+(ds-1)*(a2*Exp[m]+b2);

model /. {{ds -> 1}, {ds -> 2}}

{E^m*a1 + b1, E^m*a2 + b2}

model = (2-ds)*(3-ds)*(a1*Exp[m]+b1)/
          2+(ds-1)*(3-ds)*(a2*Exp[m]+b2) + (ds-1)*(ds-2)*(a3*Exp[m]+b3)/2;

model /. {{ds -> 1}, {ds -> 2}, {ds -> 3}}

{E^m*a1 + b1, E^m*a2 + b2, 
  E^m*a3 + b3}

Bob Hanlon

In a message dated 2001/4/17 1:48:08 AM, baker at writes:

>I'm trying to use NonlinearRegress to simultaneously fit multiple datasets,
>each dataset described by some global (shared) parameter as well as local
>parameters. I have one big list of the type {x1,x2,x3,ds,y}, where x1-x3
>independent variables for each dataset, and ds indicates the dataset number.
>In the old-fashioned fortran and C fitting packages I used to use, I just
>used If statements to test which dataset was being fitted and setup the
>function appropriately. If I try to do this with Mathematica, it yells
>me. For a basic example, if I have two datasets with ds=1 or 2, I try as
>fitting function
>I can fit data just fine if I limit things to one dataset and leave out
>conditional statements. But anything more complicated doesn't work. Any

  • Prev by Date: MatrixTemplate (Generalization)
  • Next by Date: Bug in Integrate?
  • Previous by thread: Re: conditionals during nonlinear regression
  • Next by thread: MatrixTemplate (was SpecialMatrix)