Multiple regression with nonlinear variables
3 views (last 30 days)
Show older comments
Fernando Maturi
on 29 Jan 2025
Commented: Star Strider
on 2 Feb 2025
Hello,
I am working with the attached dataset, where the first column represents temperature and the next six columns (2–7) correspond to temperature-dependent properties.
I would like to explore whether it is possible to model temperature as a function of these six properties simultaneously, similar to a multiple regression approach. I have previously done this with linear responses, but in this case, the relationships are nonlinear (sigmoidal, Z-shaped).
I considered using a generalized additive model (GAM), but I have no prior experience with this method and may be overlooking a simpler or more suitable approach.
Could anyone provide insights or suggestions on how to best tackle this?
Thanks in advance! :)
0 Comments
Accepted Answer
Star Strider
on 29 Jan 2025
I am not certain what you want to do.
Fitting a generalized additive model (GAM) for regression using the fitrgam function would go something like this —
T1 = readtable('temp-vs-properties.txt')
VN = T1.Properties.VariableNames;
figure
plot(T1{:,1}, T1{:,2:end})
grid
xlabel(VN{1})
ylabel('Properties')
legend(VN{2:end}, Location='best')
Mdl = fitrgam(T1, 'Var1')
I am not certain that I am plotting your data correctly.
There are other options, such as fitnlm that might be more appropriate, depending on what you want to do.
.
4 Comments
More Answers (0)
See Also
Categories
Find more on Linear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

