Polynomial Regression

This program will fit a polynomial in two variables to a set of data.  The polynomial is of the form:

d=a1+a2*x+a3*x^2+a4*y+a5*y^2+a6*x*y+a7*x^2*y+a8*x*y^2+a9*x^2*y^2

where x and y are the independent variables..

Data can be input via keyboard or data table in x,y,d form.

Downloads:

Basic program:(liberty basic) 2ivarreg.bas

 

Test case (data in file):

Polynomial Regression for Two Variables

where x and y are the independent variables
and d is the dependent variable

Number of points to input? 16
Use keyboard (k) or read from data (d)? d

Coefficients a1 to a9 are:

a(1)= 530.7275
a(2)= 683.368749
a(3)= -89.2968748
a(4)= -0.3176375
a(5)= 0.1590625e-3
a(6)= 0.15253125
a(7)= -0.30078125e-1
a(8)= -0.12421875e-3
a(9)= 0.29296875e-4

standard deviation= 0.54184292

Interpolation (enter x=q to end program)

x= 1.76
y= 1550
d= 1311.13209

x= q