linear fit with fitlm or regress
10 ビュー (過去 30 日間)
古いコメントを表示
Andreas Grøvan Aspaas
2019 年 5 月 13 日
コメント済み: Andreas Grøvan Aspaas
2019 年 5 月 15 日
Hi
I have a data set of three variables. I want to use the equation y = a + b*temp + c*temp* sigma. When i write this like y~temp+(sigma*temp) in fitlm, I get 4 terms, Intercept, temp, sigma and temp:sigma.
My question is if sigma is the slope c and temp:sigma is temp*sigma for the c? I think this is correct, but I have not been able to figure out how the equation would look like based on the input arguments. The displayed "Linear regression model" is y ~1 + t*sigma
Thanks a lot!
0 件のコメント
採用された回答
Jeff Miller
2019 年 5 月 14 日
Your three variables are y, temp, and sigma? If I understand the model you want to fit, you might get a cleaner picture if you form a new variable:
prod = temp.*sigma;
and then use
y~temp+prod
5 件のコメント
Jeff Miller
2019 年 5 月 14 日
Sorry, I just don't understand what model you are trying to fit. You say you are trying to get
y = (a0+b0*T) + (c0*sigma+d0*T)
but that does not look like a legitimate model to me as I said before.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Gaussian Process Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!