Comparing multiple curves to an optimal curve
Show older comments
I am collecting twice a total of 240 Trials of 4 secs each. Subjects are required to apply a certain amount of force (depending on the day's max force) at the time point 3secs with their thumb. This results in a 240 different curves per day. I manage to compute the graphs for the 240 trials. My Question now is: How can I fit an additional curve to the 240 curves which depicts the perfect curve, usinf on only a handfull of data-points based on the day's max force(the program I am using currently collects 4000 data points during the 4 secs, which is way to much to write down by hand)? Furthermore how do I calculate the average difference between each trial and the optimal curve? So far I am only using plot() to generate the graphs.
Thank you very much
Answers (1)
Shashank Prasanna
on 31 Jan 2013
0 votes
Depends on how you define your "perfect curve" there should be some criterion. Do you want to average it? If you want to fit the average curve, then depending on the curve choose an equation or model that best describes your curve and fit it using curve fitting or optimization.
Once you have your "optimal curve" you can always find a sum or squares error or MSE
7 Comments
Ben
on 31 Jan 2013
Shashank Prasanna
on 31 Jan 2013
I am not sure, you may have to upload it else where and link it to this post.
Ben
on 4 Feb 2013
Shashank Prasanna
on 4 Feb 2013
That should be easy enough, you can choose a polynomial or another model to fit your optimal curve. There are several ways to do that. If you have curve fitting toolbox that would be easiest. If you don't then you will have to set up an optimization problem to fit that curve. You can also find the mean square error between the optimial curve and your other curve to quantify how "off" they are. If it is just 10-20 points can you please share it here so I can show you an example?
Ben
on 6 Feb 2013
Shashank Prasanna
on 8 Feb 2013
Are you sure? that data looks nothing like the curve in your picture.
In anycase you can fit the curve using curve fitting toolbox, and the way to check is to try the following command in MATLAB.
>> cftool
It is intuitive enough that you can get to work immediately. If you don't then you will have to set up an optimization problem to do the same. You can start here:
Ben
on 14 Feb 2013
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!