LINEST function for exponential regression with one fixed parameter

gifariz

Board Regular
Joined
May 2, 2021
Messages
120
Office Version
  1. 365
Platform
  1. Windows
Hi all. This question is more about mathematical problem than excel, but, anyway..
So, I have a data to do exponential regression using LINEST function.
Suppose the trendline would be y = a*e^bx, I can get the parameters by (please see screenshot for the data):
a=EXP(INDEX(LINEST(LN(B2:B5),A2:A5),1,2))
b=INDEX(LINEST(LN(B2:B5),A2:A5),1,1)

But I need to set 'a' parameter as fixed value, in this case as a=y(0)=563.21.
Is it possible to do this? How should I modify the y values before inputting to LINEST function?
Thank you in advance.

1647507874991.png
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
This is what I would do in Excel...based on the form of your regression model, subtract ln(a) from your y values, then exercise the constraint option in LINEST to make the intercept 0. Then after the regression, shift the a' regression result by ln(a).
MrExcel_20220315.xlsx
ABCDEFG
1xyy_regressionymodRegression of form y(x)=a*exp(b*x)
20563.21533.1517563.2100a533.151651
331.5321.67329.2628340.0775b-0.01529999
466.5170.76192.7428194.1520
598.1129.99118.8517117.0453Regression to obtain ymod by constraining "a"
6a_fixed563.21
7a'563.21
8b'-0.0160152
Sheet7
Cell Formulas
RangeFormula
C2:C5C2=$G$2*EXP($G$3*$A2)
D2:D5D2=$G$7*EXP($G$8*$A2)
G2G2=EXP(INDEX(LINEST(LN($B$2:$B$5),$A$2:$A$5),1,2))
G3G3=INDEX(LINEST(LN(B2:B5),A2:A5),1,1)
G7G7=EXP(INDEX(LINEST(LN(B2:B5)-LN(G6),A2:A5,FALSE),1,2)+LN(G6))
G8G8=INDEX(LINEST(LN(B2:B5)-LN(G6),A2:A5,FALSE),1,1)

A comparison of the original data, baseline non-constrained regression result, and constrained regression results:
1647557760120.png
 
Upvote 0
Solution
This is what I would do in Excel...based on the form of your regression model, subtract ln(a) from your y values, then exercise the constraint option in LINEST to make the intercept 0. Then after the regression, shift the a' regression result by ln(a).
MrExcel_20220315.xlsx
ABCDEFG
1xyy_regressionymodRegression of form y(x)=a*exp(b*x)
20563.21533.1517563.2100a533.151651
331.5321.67329.2628340.0775b-0.01529999
466.5170.76192.7428194.1520
598.1129.99118.8517117.0453Regression to obtain ymod by constraining "a"
6a_fixed563.21
7a'563.21
8b'-0.0160152
Sheet7
Cell Formulas
RangeFormula
C2:C5C2=$G$2*EXP($G$3*$A2)
D2:D5D2=$G$7*EXP($G$8*$A2)
G2G2=EXP(INDEX(LINEST(LN($B$2:$B$5),$A$2:$A$5),1,2))
G3G3=INDEX(LINEST(LN(B2:B5),A2:A5),1,1)
G7G7=EXP(INDEX(LINEST(LN(B2:B5)-LN(G6),A2:A5,FALSE),1,2)+LN(G6))
G8G8=INDEX(LINEST(LN(B2:B5)-LN(G6),A2:A5,FALSE),1,1)

A comparison of the original data, baseline non-constrained regression result, and constrained regression results:
View attachment 60345
Wow that's really perfect. Thank you very much sir.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top