Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to identify different datasets' topicStudent Support Forum > General > "How to identify different datasets"

Next Comment >Help | Reply To Topic
Author Comment/Response
Conor
04/08/10 1:38pm

To quote a previous (successfully answered) query:

I have multiple datasets, and one function that depend on multiple
parameters, of which I would like to find a global best fit to three of the
parameters. However, within each dataset, I need to specify slightly
different parameters within the function. For example (not actual function
and will not make sense),
f(a_,b_,c_,d_,e_) = a*x^5 + b*x^4 + c*x^3 + d*x^2 + e*x
In datasets 1-5, I would like to specify different "a" and "b" values (for
each dataset), while finding the best single fit (global) for "c," "d," and
"e" in the function using all datasets.

I know quote the proposed solution:

You could e.g. add an additional first coordinate x0 to your data
points, that indicates the data set, and define f (I call the known
parameters a and b and the unknown p1,p2,p3):
f[x0_,x_,p1_,p2_,p3_]:=Which[
x0==1, f[x,a1,b1,p1,p2,p3],
x0==2, f[x,a2,b2,p1,p2,p3],
x0==3, f[x,a3,b3,p1,p2,p3],
x0==4, f[x,a4,b4,p1,p2,p3],
x0==5, f[x,a5,b5,p1,p2,p3]
]
Then you would call FindFit:

FindFit[data,f[x0,x,x2,x3,x4,x5],{p1,p2,p3},{x0,x}]

My problem is that I don't know how to define individual datasets, i.e. how to say that the dataset where x0==1 is the same as data0={{1,2},{2,4},{4,8}}
Any help greatly appreciated

URL: ,

Subject (listing for 'How to identify different datasets')
Author Date Posted
How to identify different datasets Conor 04/08/10 1:38pm
Re: How to identify different datasets Conor 04/09/10 07:38am
Re: How to identify different datasets anika 02/15/11 7:51pm
Next Comment >Help | Reply To Topic