Regression and Data Fitting
? 2008 Waterloo Maple Inc.
Introduction
This worksheet contains examples using the function LeastSquares from the "CurveFitting" package to perform linear, polynomial, and non-linear regression. It is important to load this package before you attempt to perform these calculations. The package has been loaded in the Startup Code (Edit>Startup Code).
Defining the Data
Create a set of data, X values and Y values, in separate lists:
![[3.80, 4.11, 5.18, 4.52, 5.49, 4.89, 1.11, 5.35, 2.09, .60, 6.53, 1.40]](/view.aspx?SI=6685/Regression and Data Fitting 2008_3.gif) |
(2.1) |
![[56.1, 56.2, 40.0, 45.9, 45.3, 38.5, 32.4, 31.0, 50.0, 18.2, 30.1, 45.8]](/view.aspx?SI=6685/Regression and Data Fitting 2008_5.gif) |
(2.2) |
Linear Regression
This example will fit a linear equation to the data represented.
 |
(3.1) |
Polynomial Regression
The mathematics below show examples using Maple for polynomial regression. An equation of a given form is produced for the data defined above and then plotted on a graph.
 |
(4.1) |
 |
(4.2) |
Non-Linear Regression
The following examples show how to fit non-linear equations to the data defined above. The equations will be of type logarithmic and exponential.
 |
(5.1) |
 |
(5.2) |
NOTE: The previous examples illustrate Maple's built-in functional capabilities. However, it is important to note that Maple is a programming language and can be used to implement different algorithms or methods
Legal Notice: The copyright for this application is owned by Maplesoft. The application is intended to demonstrate the use of Maple to solve a particular problem. It has been made available for product evalution purposes only and may not be used in any other context without the express permission of Maplesoft.