|
Method
of least squares
|
Print!
We will start from an example, then to propose a demonstration of the general formulas on a simple case.
This article is addressed to the professors in particular, because it shows how the teaching of this topic can be carried out by the intermediary of the TI-89-92.
| Objectives | To present the method of least squares |
| Public |
|
| Prérequis | Properties of the trinomial function of the second degree |
| Idea | B.Egger |
We will not detail the step, leaving with each one the care to equip it as it is appropriate to him.
Presentation on an example
X 2.1 1.8 3.4 5.1 6 7.2
y 6.9 4.7 10.8 13.8 16.2 14.1
| One chooses the options opposite in the screen which appears (one can make another choice for the Mark option) |
|
| **time-out** not forget to put y1(x) in the option " Blind Reg To ". That make it possible to preserve the equation of right-hand side in the variable y1 for possibly it trace or it use for some calculation later. |
|
| The following results then are obtained. We will not tackle here the question of correlation, but we will propose to find this equation by a calculation assisted by the TI-89-92. |
|
One then represents in the same reference mark the cloud and the curve.
|
|
The search of the equation of this curve is preceded by a presentation by the professor by the method of least squares.
Comes then a development step by step from the method.
Useful precision for the continuation : we called ACTIV the statistical table on TI-89-92.
| **time-out** one point out the column of table in the screen of
calculation (HOME) in make follow the name of table of a number between hook. (Extraction
of a line of a matrix)
One calculates then what one names M |
|
One replaces in the expression of sab, and one obtains a polynomial of degree 2 out of B. |
|
| This polynomial reaches its minimum at the point which cancels the
derivative. One then replaces B in the expression of A preceding. One finds the values of the curve of regression given by the computer. |
|
" general " case
X a1 a2 a3 a4
y b1 b2 b3 b4
One takes again the same step as précedemment.
| Even step that in the particular case. |
|
| In the general demonstration, one prefers to start with derivation compared to b: that will in the final analysis make it possible to show that that returns to same, but in more one leads to a formula more usable. |
|
The formula obtained can of multiple handling on the computer lead afterwards to a form " usable ". It is certainly preferable to make a written synthesis of it:
**time-out** B = - A/4 *
aI
- 1/4 *
bI
(to i=1 to i=4) that one write more frequently under the form y_=a*x_+b,
formula which highlight en évidence the membership of point average with straight
regression line de régression.
The demonstration of A by the computer mainly poses some problems if one wants to obtain the usual formula, because of the immediate evaluations of partial results which prevent desired working. To block these evaluations, one must replace certain calculations by inert variables.
In the formula called sab, one will carry out following substitutions:
a1+a2+a3+a4 = sx1
a1+a2+a3+a4 = sx2
b1+b2+b3+b4 = sy1
b1+b2+b3+b4 = sy2
a1*b1+a2*b2+a3*b3+a4*b4 = sxy
One can carry out these replacements by successive handling on the computer, but it can be faster of réecrire the formula giving sab with the new variables.
B sécrit then B = - a*sx1/4 + sy1/4
| The formula of sab modified is placed in
the variable sabb. One substitutes B by his value according to year sx1 and sy1. One stores the result in sabc. |
|
| The value of A which cancels the derivative of sabc compared to A is
given by the formula in bottom of the screen. In divisnat numerator and denominator by 16,
one finds the traditional writing: has = [ (x*y)_-(x_*y _) ] / (x_-x_) |
|
The two formulas giving has and B being shown in the case of series to 4 elements, one can admit them for unspecified series. The demonstration was voluntarily built a little différement of that given in the particular case.
**time-out** we go return with this one to check that we find well the same result and thus put in obviousness that it be equivalent to begin of a way or of another.
Return to the particular case
Initially, it is necessary to supplement the table called ACTIV by a column giving the squares of variable X, and by a column giving the products of variables X and y.
| Here, no difficulty to supplement the initial table. One places
oneself on c3 and one supplements the line " c3 = " by c3=c1². In the same way for c4=c1*c2 |
|
|
|
The same results are found.
We can imagine other activities of the same kind to introduce and present other models of regression.
For our part, we will finish by the exposure of a a little unusual use to the level college (or BTS) of the quadratic or cubic regression.