Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5216
| From | JamesE <haywanlar@excite.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Fittings 2 sets of equations and 2 data sets with nonlinearmodelfit |
| Date | 2011-09-26 08:17 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j5pcf8$8h2$1@smc.vnet.net> (permalink) |
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"}]
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread
Fittings 2 sets of equations and 2 data sets with nonlinearmodelfit JamesE <haywanlar@excite.com> - 2011-09-26 08:17 +0000 Re: Fittings 2 sets of equations and 2 data sets with nonlinearmodelfit Ray Koopman <koopman@sfu.ca> - 2011-09-27 00:09 +0000
csiph-web