Filter löschen
Filter löschen

Negative values in multiple regression

4 Ansichten (letzte 30 Tage)
mwer
mwer am 14 Mär. 2017
Bearbeitet: mwer am 15 Mär. 2017
Hey guys,
I got measured data (5 independent values and 1 which depends on the 5 independent ones) and want to create a function y = f(x1,x2,x3,x4,x5). I used nlinfit to do this and get a function which is okay but could be better. In addition, some of my dependent value y are negative, althouht the original resulting data CAN NOT be negative. Is there any possibility to tell nlinfit to find a function y = f(x1,x2,x3,x4,x5) where y is NEVER negative? In comparison to nlinfit, is there any better way do find a nonlinear function y = f(x1,x2,x3,x4,x5)?
  2 Kommentare
John BG
John BG am 14 Mär. 2017
nlinfit uses some constant and 1 exponential for the approximation.
It may be useful for stiff functions approximation, but with periodic functions may be you would like to consider approximating with a combination of trigonometric functions.
Or may be polynomials would be a better choice.
What is the shape of the function you want to approximate, and over which range do you want it approximated?
John BG
mwer
mwer am 15 Mär. 2017
Bearbeitet: mwer am 15 Mär. 2017
Thanks for your answer.
At first, the dependent value y does not have periodic behaviour. I tried another way with multiple regression.
I used a taylor series/square polynominal and created a design Matrix X: X = [ones(size(x1) x1 x2 x3 x4 x5 x1.^1 x2.^2....x1.*x2...x4.*x5]. Then I used the backlash operator to solve the parameters for my design Matrix (at mathworks.com it says that it uses the least-square fit model which i am supposed to use for my work).
With this procedure the resulting function for my depending value y is quite accurate. But in some cases the problem still exists that I'm getting negative values for y. This is NEVER possible.
Do you got some ideas to tell the multiple regression to find parameters for my function without y getting negative at all?
There is no real shape of my function. The dependent value y I'm looking for is an emission value of an engine depending on engine speed, torque, pressure and so on. So the Emission value y HAS TO BE positive. The range is from 0 to 1000, but I figured out that if I split the range into two parts and use one function for each of the two parts, I'm getting better results.
Thanks for your help

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by