MathGroup Archive 2011

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

Search the Archive

Fittings 2 sets of equations and 2 data sets with nonlinearmodelfit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121691] Fittings 2 sets of equations and 2 data sets with nonlinearmodelfit
  • From: JamesE <haywanlar at excite.com>
  • Date: Mon, 26 Sep 2011 04:14:15 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hi,

My names is James Ellison; and I have 2 nonlinear equations of the type:

y[1]=x+a*x[1]^2+b*x[1]^3 and y[2]=a*x[2]^3+b*x[2]^5 with the real valued parameters a and b for both equations.

I further have 2 data sets 

data[1] for y[1] and 
data[2] for y[2]
 
I can use NonlinearModelFit in order to fit each data[i] set to its function y[i] and get good fits. But the parameters a and b should be the same.

How can I create a simple code with Mathematica, so that I can do a simultaneous fit resulting in the parameters a and b to be the same.

I am a Mathematica beginner and would be pleased, if someone could answer my question for beginners.

Best regards, James





> In[1]:= data = {{1., 0.75}, {2., 0.89}, {3., 0.42}, {4., 0.99}, {5.,0.84}, {6., 0.34}, {7., 0.83}, {8., 0.93}, {9., 0.76}, {10.,0.11}};
> nlm = NonlinearModelFit[data, {Exp[a + b x^2], b< -1/2}, {{a, 0}, {b, -1}}, x]
>
> In[2]:= nlm[{"ANOVATable", "ParameterConfidenceIntervalTable"}]




  • Prev by Date: Re: Artistic impression of cloudy structures
  • Next by Date: Re: A fast way to compare two vectors
  • Previous by thread: Re: Integration error? Integrate[1/(x^3-1)]?
  • Next by thread: Re: Fittings 2 sets of equations and 2 data sets with nonlinearmodelfit