How to choose the right model for Non-linear regression?

Hi, I'm trying to use fitnlm to create a model from 7 predictor variables and 1 response variable. If I understand correctly, I need to use something like
mdl = fitnlm(predictors,responses,@modelfun,beta0).
I'm struggling to find which model (@modelfun) is appropriate for my data. how do I see which pre-built models are available? Is there a list of them somewhere?

4 Comments

Read the description of that input
You must define the function using a function handle or a character vector or string. The function should be what you believe is the underlying function that produced your data, ignoring the variation due to noise.
If you scroll down on that page, there are examples.
Thanks for your answer. Do you have any advice on designing a good function? For example, I know that 2 of the 7 predictors have a linear relationship with the response, and the rest have a quadratic relationship with the response. So would a function like this be appropriate?
f = (ax+b)+(cy+d)+(ez^2+gz+h)+(iw^2+jw+k)+etc..
I figured that a linear combination of the individual functions could work, but I don't know much about modelling so I might as well ask here.
Try running pca() on it, or use partial least squares, to decide upon an intelligent model. You're just using the kitchen sink approach or multiple least squares where you throw in everything plus the kitchen sink. It may fit your training data will but might not fit your test data well.
This answer by the talented John D'Errico walks you through his process of assessing the underlying function of noisy data, although the function in that answer is different from yours.
The curve fitting toolbox may also come in handy while exploring different functions.
Just be cautious of overfitting (as Image Analyst mentioned) and correlated predictors (multicollinearity).
These two pages in Matlab's Documentation may be helpful as well,

Sign in to comment.

Answers (1)

The Curve fitting toolbox can be used for this purpose. The documentation for the toolbox can be accessed by clicking here. Alternatively, there are some examples demonstrating the use of this which can be accessed here.

Categories

Asked:

on 22 Aug 2020

Answered:

on 26 Aug 2020

Community Treasure Hunt

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

Start Hunting!