File:LinearRegression.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 600 × 480 pixels, file size: 41 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description Illustration of linear regression on a data set.
Date
Source self-made in Gnuplot.
Author Berland
Other versions

Gnuplot source code

[edit]
set terminal svg fname "Helvetica" fsize 25
set output "LinearRegression.svg"
set key left
set xtics axis 4.0,0.5
set ytics nomirror 1
set border 2
f(x) = a*x + b
fit f(x) 'randpts' using 1:2 via a,b
set yrange [-0.9:4]
plot 'randpts' with points pointtype 7 pointsize 0.3 title 'Datapoints', \
	f(x) with lines linetype 3 linewidth 3 title 'Regression',  \
	0 with lines linetype -1 notitle

The datafile 'randpts' was made in GNU Octave using the commands

f = fopen('randpts', 'w');
for i=1:200; 
   x=rand(1); 
   y=0.2*randn(1) + 3*x + 0.35; 
   fprintf(f, '%g %g\n', x, y); 
end
fclose(f)

(identical code also works in Matlab.)

Licensing

[edit]
Public domain This work has been released into the public domain by its author, Berland. This applies worldwide.
In some countries this may not be legally possible; if so:
Berland grants anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current12:50, 28 October 2008Thumbnail for version as of 12:50, 28 October 2008600 × 480 (41 KB)F l a n k e r (talk | contribs)Reverted to version as of 10:01, 28 October 2008
10:16, 28 October 2008Thumbnail for version as of 10:16, 28 October 2008600 × 480 (42 KB)F l a n k e r (talk | contribs)Using Helvetica as the font
10:13, 28 October 2008Thumbnail for version as of 10:13, 28 October 2008600 × 480 (42 KB)F l a n k e r (talk | contribs)Using Helvetica as the font
10:01, 28 October 2008Thumbnail for version as of 10:01, 28 October 2008600 × 480 (41 KB)F l a n k e r (talk | contribs)Tring to resolve
09:30, 28 October 2008Thumbnail for version as of 09:30, 28 October 2008600 × 480 (23 KB)Wiso (talk | contribs){{Information |Description= |Source= |Date= |Author= |Permission= |other_versions= }}
20:57, 25 June 2007Thumbnail for version as of 20:57, 25 June 2007600 × 480 (20 KB)Berland (talk | contribs){{Information |Description=Illustration of linear regression on a data set. |Source=self-made in Gnuplot. |Date=24 June 2007 |Author= Berland }} ==Gnuplot source code== set terminal svg fname "Helvetic
18:56, 24 June 2007Thumbnail for version as of 18:56, 24 June 2007600 × 480 (19 KB)Berland (talk | contribs){{Information |Description=Illustration of linear regression on a data set. |Source=self-made in Gnuplot. |Date=24 June 2007 |Author= Berland }} ==Gnuplot source code== set terminal svg fname "Helvetic

The following page uses this file:

File usage on other wikis

The following other wikis use this file: