Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: multiple variable exponential regression
Replies: 1   Last Post: Nov 6, 2013 12:30 PM

 Messages: [ Previous | Next ]
 TARUN REDDY Posts: 1 Registered: 11/4/13
multiple variable exponential regression
Posted: Nov 4, 2013 2:32 PM

Hello,
I was using other nonlinear regression methods but was getting an imaginary solution (a+ib) form

I need to solve y = a0 + (a1*(x1^b1)) + (a2*(x2^b2)) + (a3*(x3^b3))

a0, a1, a2, a3 are known

I have data set for y, x1, x2, x3

I need to calculate b1, b2, b3

I was using following code till (this yields imaginary solutions)

opts = statset ('nlinfit');
opts.RobustWgtFun = 'bisquare';
beta0 = [0, 0, 0, 0];
modelfun
= @(b, x)((100 - 15*(x(2, :).^b(1)))) - (40*((x(3, :).^b(2)))) - (15*((x(4, :).^b(3))))
x = TestData;
y = x(1, :);

[beta, R, J, CovB, MSE] = nlinfit(x, y, modelfun, beta0, opts);
SSresidual=sum(R.^2);
SStotal =sum((y-mean(y)).^2);
rsquare =1-(SSresidual/SStotal);

Date Subject Author
11/4/13 TARUN REDDY
11/6/13 Tom Lane