while doing curve-fitting for custom equation, error is occuring??

1 回表示 (過去 30 日間)
Dileepa B S
Dileepa B S 2020 年 2 月 13 日
コメント済み: Dileepa B S 2020 年 3 月 6 日
iam doing a custom equaion in curve-fitting tool to find the constants.
y= c+a*log(x)+b*log(1-x) it is the equation. I took more x and y points to plot the graph. Then also "" Inf computed by model function, fitting cannot continue.
Try using or tightening upper and lower bounds on coefficients"" this error is occuring when i entered the equation. Please help me out to clear this error and to get constants??
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 2 月 13 日
That could happen if any of your x are exactly 0 or exactly 1, due to your log terms.
It could also happen if a or b or c are permitted to go to infinity. My experience suggest that none of those would be likely to go to infinity unless log(x) or log(1-x) are very small in absolute value -- such as x values that are near 1 +/- eps (for first log) or x values that are near 0 (leading to the 1-x to be near 1 leading to log(1) being about 0)
Dileepa B S
Dileepa B S 2020 年 3 月 6 日
thank you sir

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

回答 (1 件)

Jakob B. Nielsen
Jakob B. Nielsen 2020 年 2 月 13 日
編集済み: Jakob B. Nielsen 2020 年 2 月 13 日
If your input data contains or spans x=0, your first logaritm will not be defined. In addition, if your x exceeds 1, your second logaritm log(1-x) will be a complex number, and therefore can't be fitted - while it, again, will not be defined for x=1.
Make sure your x input lies between 0 and 1, but not containing either.

カテゴリ

Help Center および File ExchangeFit Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by