# # Numerical Mathematics and Computing, Fifth Edition # Ward Cheney & David Kincaid # Brooks/Cole Publ. Co. # (c) 2003 # # file: lstsq1 # # linear least squares example # with(stats): Xvalues := [1.0, 2.0, 2.5, 3.0]; Yvalues := [3.7, 4.1, 4.3, 5.0]; fit[leastsquare[[x,y], y=a*x+b]] ([Xvalues, Yvalues]);