Curve fitting while an unknown variable needs to be determined at each data point
2 ビュー (過去 30 日間)
古いコメントを表示
Subraya Krishna Bhat
2021 年 12 月 10 日
コメント済み: Subraya Krishna Bhat
2021 年 12 月 13 日
I am trying to perform curve fitting using MATLAB wherein the fitting function f(x,a1,C1,C2,C3...) consists of a set of parameters C1,C2,C3..., the independent variable x, and another variable a1.
The problem in my case is, the variable a1 needs to be determined along with the parameters C1,C2,C3..., but unlike the parameters, a1 needs to be different at each data point. I wonder how to estimate this variable a1 at each data point while also identifying the set of parameters during curve fitting.
I know the allowable range of this variable a1. But don't know how to implement such a program.
Presently, I am using the fmincon function by defining an objective function to be minimized in the least squares sense.
Kindly assist me in finding a way to approach this problem. Thanks!
0 件のコメント
採用された回答
Matt J
2021 年 12 月 10 日
編集済み: Matt J
2021 年 12 月 10 日
Presently, I am using the fmincon function by defining an objective function to be minimized in the least squares sense.
fmincon would work fine, but lsqcurvefit is more specifically tailored to curve fitting. The documentation and examples for lsqcurvefit should help you get started, but basically you need to supply a model function F(p,xdata) where p=[a1;C1;C2,...]
The problem in my case is, the variable a1 needs to be determined along with the parameters C1,C2,C3..., but unlike the parameters, a1 needs to be different at each data point.
That is of no consequence in terms of implementation. lsqcurvefit only cares that ydata=F(p,xdata) is a differentiable (in p) prediction of your dependent variables ydata. It does not care about the specific dependence beyond that.
However, it may be a concern that you have more parameters than data points. It might make the fit highly under-determined.
5 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!