Formula Engine Reference Guide
 

 

Back to Class Index

 

POLYCOEF(X, Y, N)

Description
generates the least squares coefficients for the polynomial fit. The output of this function is a vector of length N+1. The output vector will be a row vector if X and Y are row vectors, and a column vector if X and Y are column vectors.
 
Parameters
X

A range representing a row or column vector of independent variable values
 
Y
A range representing a row or column vector of dependent variable values
 
N
polynomial degree in the range 1 to 10
 
Example
Matrix B1..B5 =
B
1
2
3
4
5
Matrix C1..C5 =
C
3
5
11
18
31
POLYCOEF(B1..B5, C1..C5, 2) =
1.6428571
-2.9571429
4.4