Polynomial fitting with dependent variables

1 回表示 (過去 30 日間)
Olga Galluppi
Olga Galluppi 2016 年 10 月 13 日
回答済み: Torsten 2016 年 10 月 13 日
How can I obtain a polynomial fitting in Matlab having coefficients depending on another variable ? e.g I have variables X1 and Y and I want to find the line (polynomial of degree 1) that fits Y=f(X1)=p0+p1*X1. That would result in the two polynomial coefficients p0,p1 with the function polyfit. Now, I would like to obtain a fitting for which the coefficients p0,p1 depend (linearly) on another variable X2 so p0=f1(X2)=a*X2+b, p1=f2(X2)=c*X2+d.
That would finally result in Y=f1(X2)+f2(X2)*X1.
How to do that ?
Thanks in advance.

採用された回答

Torsten
Torsten 2016 年 10 月 13 日
In this case, your model is of the form
Y=c*X1*X2+d*X1+a*X2+b
and you have to estimate the coefficients a,b,c and d.
Since this model is also linear in the coefficients, you can use the same method as for the model
Y=p0+p1*X1
Best wishes
Torsten.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by