Fitting the best curve to the data
1 view (last 30 days)
Show older comments
I'm trying to fit the best curve to my data that produces a function by minimizing the SSE. The behavior of my data is: as x-datapoints increase y-datapoints either increase or stays the same. Additionally, my data points are in the range between zero and 100. I want the curve to start at (0,0) and pass (100,100) and try to minimize SSE. All matlab statistical fitting didn't work.
0 Comments
Answers (1)
John D'Errico
on 16 Jun 2015
I'm not going to be able to check back in about this question for a day, but the answer is simple in general. Of course, I have no idea why you failed to get a result, but I could hazard some guesses. There could be so many reasons why you failed to get a result to make you happy, so if I DID try to guess, I'd surely guess wrong.
Anyway, use my SLM toolbox. This is exactly that it is designed to do. You can force the curve to pass through those endpoints. Just as a rough guess, your call might like like this:
slm = slmengine(x,y,'knots',0:10:100,'leftvalue',0,'rightvalue',100,'increasing','on','plot','on');
You can choose other knots of course, as long as they go from 0 to 100. And you can decide not to plot the result automatically, but I ALWAYS recommend looking at the result.
See Also
Categories
Find more on Get Started with Curve Fitting Toolbox 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!