using linest function for 2nd order polynomial

balan

New Member
Joined
Jul 13, 2015
Messages
4
Hi All,

I am using linest function to get coefficient of 2nd order polynomial {y = (c2*x^2)+(c1*x) + c0 } for the following variable,
[TABLE="width: 128"]
<colgroup><col width="64"><col width="64"></colgroup><tbody>[TR]
[TD="class: et1, width: 64"]250[/TD]
[TD="class: et2, width: 64"]1.3 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]500[/TD]
[TD="class: et2, width: 64"]3.8 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]750[/TD]
[TD="class: et2, width: 64"]7.2 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]1000[/TD]
[TD="class: et2, width: 64"]11.4 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]1250[/TD]
[TD="class: et2, width: 64"]16.2 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]1500[/TD]
[TD="class: et2, width: 64"]21.6 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]1750[/TD]
[TD="class: et2, width: 64"]27.6 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]2000[/TD]
[TD="class: et2, width: 64"]34.1 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]2250[/TD]
[TD="class: et2, width: 64"]41.1 [/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]2500[/TD]
[TD="class: et2, width: 64"]48.6 [/TD]
[/TR]
</tbody>[/TABLE]
and using the following equation
c2 = index(linest(y,x^{1,2},1)
c1 = index(linest(y,x^{1,2},1,2)
c0 = index(linest(y,x^{1,2},1,3) and these do calculate values as
c2 = 0.0000048, c1 = 0.008 and c0 = -1.25. But when I keep input variables in row wise(as shown below), I am not able to use these equations. Looking for a help.
[TABLE="width: 640"]
<colgroup><col width="64"><col width="64"><col width="64"><col width="64"><col width="64"><col width="64"><col width="64"><col width="64"><col width="64"><col width="64"></colgroup><tbody>[TR]
[TD="class: et2, width: 64"]250.0 [/TD]
[TD="class: et2, width: 64"]500.0 [/TD]
[TD="class: et2, width: 64"]750.0 [/TD]
[TD="class: et2, width: 64"]1000.0 [/TD]
[TD="class: et2, width: 64"]1250.0 [/TD]
[TD="class: et2, width: 64"]1500.0 [/TD]
[TD="class: et2, width: 64"]1750.0 [/TD]
[TD="class: et2, width: 64"]2000.0 [/TD]
[TD="class: et2, width: 64"]2250.0 [/TD]
[TD="class: et2, width: 64"]2500.0 [/TD]
[/TR]
[TR]
[TD="class: et2, width: 64"]1.3 [/TD]
[TD="class: et2, width: 64"]3.8 [/TD]
[TD="class: et2, width: 64"]7.2 [/TD]
[TD="class: et2, width: 64"]11.4 [/TD]
[TD="class: et2, width: 64"]16.2 [/TD]
[TD="class: et2, width: 64"]21.6 [/TD]
[TD="class: et2, width: 64"]27.6 [/TD]
[TD="class: et2, width: 64"]34.1 [/TD]
[TD="class: et2, width: 64"]41.1 [/TD]
[TD="class: et2, width: 64"]48.6 [/TD]
[/TR]
</tbody>[/TABLE]

Thanks in advance for any help someone may be able to give.
[TABLE="width: 97"]
<colgroup><col width="97"></colgroup><tbody>[TR]
[TD="class: et3, width: 97"] [/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hello Aladin,

If I convert variables from row format to column format by using this transpose function, it works. But If I can able to use this linest function when these variables in row format, it will be better for me. Because this method I am using for finding optimum design point from 'n' set of design points.
 
Upvote 0
Hello Aladin,

If I convert variables from row format to column format by using this transpose function, it works. But If I can able to use this linest function when these variables in row format, it will be better for me. Because this method I am using for finding optimum design point from 'n' set of design points.

Vertical data...

Control+shift+enter, not just enter:

=INDEX(LINEST(A1:A10,B1:B10^{1,2}),1)

Horizontal data...

Control+shift+enter, not just enter:

=INDEX(LINEST(TRANSPOSE(A1:J1),TRANSPOSE(A2:J2)^{1,2}),1)

Both produce the same outcome.
 
Upvote 0
HI Aladin,

Thank You for your reply. It works well and saves lot of time during my optimization study.

Many thanks once again.
 
Upvote 0
Hi All,

I am using linest function to get coefficient of 2nd order polynomial {y = (c2*x^2)+(c1*x) + c0 } for the following variable,
[TABLE="width: 128"]
<tbody>[TR]
[TD="class: et1, width: 64"]250[/TD]
[TD="class: et2, width: 64"]1.3[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]500[/TD]
[TD="class: et2, width: 64"]3.8[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]750[/TD]
[TD="class: et2, width: 64"]7.2[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]1000[/TD]
[TD="class: et2, width: 64"]11.4[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]1250[/TD]
[TD="class: et2, width: 64"]16.2[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]1500[/TD]
[TD="class: et2, width: 64"]21.6[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]1750[/TD]
[TD="class: et2, width: 64"]27.6[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]2000[/TD]
[TD="class: et2, width: 64"]34.1[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]2250[/TD]
[TD="class: et2, width: 64"]41.1[/TD]
[/TR]
[TR]
[TD="class: et1, width: 64"]2500[/TD]
[TD="class: et2, width: 64"]48.6[/TD]
[/TR]
</tbody>[/TABLE]
and using the following equation
c2 = index(linest(y,x^{1,2},1)
c1 = index(linest(y,x^{1,2},1,2)
c0 = index(linest(y,x^{1,2},1,3) and these do calculate values as
c2 = 0.0000048, c1 = 0.008 and c0 = -1.25. But when I keep input variables in row wise(as shown below), I am not able to use these equations. Looking for a help.
[TABLE="width: 640"]
<tbody>[TR]
[TD="class: et2, width: 64"]250.0[/TD]
[TD="class: et2, width: 64"]500.0[/TD]
[TD="class: et2, width: 64"]750.0[/TD]
[TD="class: et2, width: 64"]1000.0[/TD]
[TD="class: et2, width: 64"]1250.0[/TD]
[TD="class: et2, width: 64"]1500.0[/TD]
[TD="class: et2, width: 64"]1750.0[/TD]
[TD="class: et2, width: 64"]2000.0[/TD]
[TD="class: et2, width: 64"]2250.0[/TD]
[TD="class: et2, width: 64"]2500.0[/TD]
[/TR]
[TR]
[TD="class: et2, width: 64"]1.3[/TD]
[TD="class: et2, width: 64"]3.8[/TD]
[TD="class: et2, width: 64"]7.2[/TD]
[TD="class: et2, width: 64"]11.4[/TD]
[TD="class: et2, width: 64"]16.2[/TD]
[TD="class: et2, width: 64"]21.6[/TD]
[TD="class: et2, width: 64"]27.6[/TD]
[TD="class: et2, width: 64"]34.1[/TD]
[TD="class: et2, width: 64"]41.1[/TD]
[TD="class: et2, width: 64"]48.6[/TD]
[/TR]
</tbody>[/TABLE]

Thanks in advance for any help someone may be able to give.
[TABLE="width: 97"]
<tbody>[TR]
[TD="class: et3, width: 97"][/TD]
[/TR]
</tbody>[/TABLE]

Hi

Another option

Since the data and the exponents array must be orthogonal, if your data is in horizontal rows, like in the second table, use like:

c2 = index(linest(y,x^{1;2},1)
 
Upvote 0
Hi

Another option

Since the data and the exponents array must be orthogonal, if your data is in horizontal rows, like in the second table, use like:

c2 = index(linest(y,x^{1;2},1)

Good idea... Adding the missing paren:

=INDEX(LINEST(A1:J1,A2:J2^{1;2}),1)
 
Upvote 0

Forum statistics

Threads
1,223,574
Messages
6,173,146
Members
452,502
Latest member
PQCurious

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