error calculation perfect fit

조회 수: 1 (최근 30일)
sarah
sarah 2015년 5월 30일
댓글: Star Strider 2015년 6월 3일
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