error calculation perfect fit

1 次查看(过去 30 天)
Hi guys, so I have experimental data in column matrix y. And I want to use the equation below to find x as a function of y. This means have constant b adjusted from 0 to 2 and hence want to obtain the ideal b value.
I'm thinking of using a double for loop however would anyone know how to calculate for error and set a desirable tolerance. Or tips on how to solve for it effectively?
Thanks in advance. The equation is:
y= (1-0.05*x^(b))/(1-0.03*x^b)^2

采纳的回答

Star Strider
Star Strider 2015-5-30
I would use nlinfit and nlparci to estimate ‘b’, and use a few values of ‘x’ and ‘y’ to provide an initial estimate, with:
b = log(20*(1-1./y))./log(x);
Noting the assumptions and restrictions that I mentioned earlier.
  25 个评论
sarah
sarah 2015-6-3
编辑:sarah 2015-6-3
Sure.
Also i wanted to ask you regarding residuals. Residuals for some selective data is very small e-8 and the system solves. However for say the whole range i.e. 70 data points the fit isn't good i.e. residuals are large 1000. However my b(1) and b(2) are satisfactory. It doesn't mean my model is wrong right i.e. my coding. I'm assuming that experimental data at certain range is wrong.
Star Strider
Star Strider 2015-6-3
It’s difficult to determine the reasons the residuals are very low in one region and high in another. My guess is that either (1) your model does not completely describe the process that created your data, or (2) some regions simply have more noise than others. This may not be a problem if your parameter estimates are acceptable and your model provides a good fit in your area of interest.

请先登录,再进行评论。

更多回答(1 个)

John D'Errico
John D'Errico 2015-5-30
How many points do you have that you expect a perfect fit? (Hint: with only one parameter to solve for, only ONE point will give you a perfect fit in general. With more points than that, you won't get a perfect fit.)
Anyway, with the model you have chosen, is there some good reason why you choose to define it as
y= (1-0.05*x^(b))/(1-0.05*x^b)^2
instead of the algebraically identical
y= 1./(1-0.05*x.^b)
(Note my use of ./ and .^. This is important.)
And with that model, I seriously doubt you will get a very good fit, and I have not even seen your data. That model has very little capability of adjustment.
  1 个评论
sarah
sarah 2015-5-30
编辑:sarah 2015-5-30
my y data ranges from 1-6 but yeah i have alot of points.
so say if my experimental data is y. And say if I want to solve for b ie. the most ideal value of b. So there is no way i could do that? I think even a point of intersection which shows one value of b is good for me. As long as i get a good estimate of b - i was initially thinking of a surface plot. I do know that x ranges from 2-40. haha

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Support Vector Machine Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by