File:Regression lineaire abscisses ordonnees orthogonal.svg
Original file (SVG file, nominally 317 × 384 pixels, file size: 46 KB)
Captions
Summary
[edit]DescriptionRegression lineaire abscisses ordonnees orthogonal.svg |
English: Illustration of least squares fitting. The data (red dots) are at co-ordinates (1,6), (2,5), (3,7) and (4,10). A linear approximation is obtained using least-squares estimation of the vertical offset (plain blue line), of the horizontal offset (dashed blue line) and of the perpendicular offset (total least squares, blue mixed line). Created using Scilab, modified with Inkscape.
Français : Illustration de la régression linéaire par la méthode des moindres carrés. Les données (points rouges) ont pour coordonnées (1 ; 6), (2 ; 5), (3 ; 7) et (4 ; 10). On effectue une régression linéaire en considérant les écarts en ordonnée (ligne bleue continue), en abscisse (ligne bleue pointillée) et orthogonaux (moindres carrés totaux, trait mixe bleu). Réalisé avec Scilab, modifié avec Inkscape. |
Date | (UTC) |
Source |
This file was derived from: |
Author |
This is a retouched picture, which means that it has been digitally altered from its original version. Modifications: Redrawn with Scilab, with three different algorithms. Modifications made by Cdang.
|
Scilab source
This media was created with Scilab, a free open-source software. Here is a listing of the Scilab source used to create this file. |
// Données
X = 1:4;
Y = [6, 5, 7, 10];
// régression horizontale
[a, b, sigma] = reglin(Y, X);
// régression verticale
[aa, bb, sigma] = reglin(X, Y);
// régression orthogonale
Ainit = [0, 1];
function [e] = resorth(A, X, Y)
e = 1/(1 + A(2)^2)*(Y - A(1) - A(2)*X).^2
endfunction
[S, Aopt] = leastsq(list(resorth, X', Y'), Ainit);
// points projetés sur la droite
Xh = a*Y + b;
Yv = aa*X + bb;
normdo = sqrt(1 + Aopt(2)^2);
distcurv = (1/normdo)*(X + Aopt(2)*(Y - Aopt(1)));
Xorth = (1/normdo)*distcurv;
Yorth = Aopt(1) + (Aopt(2)/normdo)*distcurv;
// droite de régression horizontale
y1 = 4; x1 = a*y1 + b;
y2 = 10.25; x2 = a*y2 + b;
// droite de régression verticale
xx1 = (y1 - bb)/aa;
xx2 = (y2 - bb)/aa;
// droite de régression orthogonale
xxx1 = (y1 - Aopt(1))/Aopt(2);
xxx2 = (y2 - Aopt(1))/Aopt(2);
// tracé
clf;
couleurs = [get(sdf(), 'color_map') ; 0.75, 0.75, 0.75];
xset('colormap', couleurs);
xsegs([X ; Xh], [Y ; Y], 14) // segments horizontaux
h1 = gce();
h1.line_style = 2;
xsegs([X ; X], [Y ; Yv], 14) // segments verticaux
h2 = gce();
h2.thickness = 2;
xsegs([X ; Xorth], [Y ; Yorth], 14) // segments orthogonaux
h2 = gce();
h2.line_style = 6;
xpoly([xx1, xx2], [y1, y2]) // droite de régression verticale
h3 = gce();
h3.thickness = 2;
h3.foreground = 2;
xpoly([x1, x2], [y1, y2]) // droite de régression horizontale
h4 = gce();
h4.line_style = 2;
h4.foreground = 2;
xpoly([xxx1, xxx2], [y1, y2]) // droite de régression orthogonale
h5 = gce();
h5.line_style = 6;
h5.foreground = 2;
plot(X, Y, 'ok') // points
h5 = gce();
h5.children.mark_background = 5;
axe = gca();
axe.data_bounds = [0, 4 ; 5, 10.25];
axe.grid = [33, 33];
axe.tight_limits = 'on';
axe.isoview = 'on';
xtitle(' ', 'x', 'y')
Licensing
[edit]- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
Original upload log
[edit]This image is a derivative work of the following images:
- File:Linear_least_squares_example2.svg licensed with Cc-by-sa-3.0, GFDL
- 2011-06-10T03:35:22Z Krishnavedala 279x274 (51647 Bytes) {{Information |Description ={{en|1=Illustration of [[:w:Linear_least_squares_(mathematicsleast squares fitting]]. The data (red dots) are at co-ordinates (1,6), (2,5), (3,7) and (4,10). A linear approximation is obtained u
Uploaded with derivativeFX
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 07:40, 5 April 2013 | 317 × 384 (46 KB) | Cdang (talk | contribs) | for all lines: same thickness, different colours + G | |
14:54, 3 April 2013 | 317 × 384 (44 KB) | Cdang (talk | contribs) | == {{int:filedesc}} == {{Information |Description={{en|1=Illustration of least squares fitting. The data (red dots) are at co-ordinates (1,6), (2,5), (3,7) and (4,10). A linear approximation is obtained using l... |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Short title | Comparaison entre les régressions linéaires verticale, horizontale et orthogonale |
---|---|
Width | 317.23727 |
Height | 383.6875 |