フィルターのクリア

error calculation perfect fit

2 ビュー (過去 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
  1 件のコメント
Star Strider
Star Strider 2015 年 5 月 30 日
See also for context: fitting data with equation.

サインインしてコメントする。

採用された回答

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 Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by