Using assumptions while curve fitting

조회 수: 10 (최근 30일)
James
James 2013년 8월 29일
Hello all,
I have a simple (I think!) question. I have an xy data set that I need to fit to a custom equation. x values range from 0 to 500 (they are concentrations, so negative values are unphysical/nonsensical), y values range from ~135 to 260.
The issue is this. The custom equation I need is a hyperbola. For x>0 the hyperbola the curve fitting tool solves for is excellent. However, I am left (in the curve fitting window) with a chunk of the hyperbola that is also for x<0. This piece of the function, which is nowhere near a data point, seems to be leading to an artificially low R^2 and other goodness-of-fit statistics.
Can I build an assumption into the curve fitting tool or command line fitting procedure where my custom equation assumes x>=0 and so yields reasonable goodness-of-fit values?
Thank you sincerely for any assistance you can provide!
Sam
  댓글 수: 1
Walter Roberson
Walter Roberson 2013년 8월 29일
Which routine are you using to do the fitting?

댓글을 달려면 로그인하십시오.

채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 8월 29일
Curve fitting tools will fit the equation you are trying to model. This equation may very well only be called for values of x < 0.
Since R^2 is computed purely by using your data - which I assume does not have x < 0 values, then what you see there is a purely visual artifact. You can continue to use the fitted model for your x > 0 only.
If this does not help, could you provide details on what is the exact equation you are trying to fit as well as how the data looks.
  댓글 수: 1
James
James 2013년 8월 29일
Shashank, thank you so much, I did not realize that. This makes my job much easier. Thanks again!
Sam

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by