Equation for non linear model

2 views (last 30 days)
Tania
Tania on 17 Jun 2014
Answered: Roger Wohlwend on 17 Jun 2014
Hi! I am trying to create a nonlinear model for my data at the moment using fitnlm. I have imported the data into matlab, but I am not quite sure how to define my equation. In the example in the documentation they had:
modelfun=@(b,x)b(1) + b(2)*x(:,1).^b(3)+b(4)*x(:,2).^b(5):
-> MPG ~ b1 + b2*Horsepower^b3 + b4*Weight^b5
How did they decide on this equation? Is their a certain technique?
Thank you!

Accepted Answer

Roger Wohlwend
Roger Wohlwend on 17 Jun 2014
I have no idea why Matlab chose to use that equation. They don't explain. In some cases theory suggests the relationship between the indepent and the dependent variables (for example in physics). But in many cases theory does not help you defining the equation. Then it can be very difficult to find the equation. It helps to plot the dependent variable as a function of each independent variable. Sometimes you can recognize a certain relationship between the two variables (linear, logarithmmic, exponential, ...).

More Answers (0)

Categories

Find more on Symbolic Math Toolbox 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!