How to change confidence intervals using fit and Curve Fitting App?

14 次查看(过去 30 天)
Hello, I have an issue fitting some data to a simple y=ax equation. The issue, I believe, is that with 95% confidence, the fit is correct, but I'd like to improve it. In the below pictures, you can see the four data points I'm trying to fit to a straight line. If I chose the starting point for a as -0.1, it says that -0.1 is good and within 95% confidence. If I set it as -0.5, the same thing happens. How can I improve this if possible?
The second and fourth data point may be bad, meaning that I'm expecting the answer to this to be closer to the -0.5.
Additionally, the data that is being plotted here, from a physical sense, should pass through 0,0.

采纳的回答

Matt J
Matt J 2022-4-12
编辑:Matt J 2022-4-12
The confidence intervals are a function of the input x,y data and the model function, and nothing else. The confidence interval tightness that you can achieve depends entirely on how well the x,y data agrees with the model you've specified.
If the 2nd and 4th data points are bad, you should remove them. I do not see any indication that the curve fails to pass through (0,0).
  8 个评论
Megan Renny
Megan Renny 2022-4-14
编辑:Megan Renny 2022-4-14
Hmm. So you're saying, for y=ax, a=x(:)\y(:) is enough, and if I need to ignore data x(pointToRemove)=[] and y(pointToRemove)=[] is the way to go. For the y=ax+b, polyfit will default to better fitting methods than the general algorithms in the custom equation of the curve fitting app? Thank you very much for your kind answers the past few days, and your patience with me taking an extra comment to understand why it is most efficient to just get out of iterative fitting. I am going to incoorporate your suggestions into my code!
Thank you also for the suggestion about just increasing the data values, I think that is equally reasonable!
Matt J
Matt J 2022-4-14
编辑:Matt J 2022-4-14
Yes, but even with analytical solvers like polyfit, it is still good to measure your data in natural units, where natural means that they aren't all super large or super small, or with orders of magnitude difference between the x and y values.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by