Jump to content

File:LinearRegression.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

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

Summary

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

Gnuplot source code

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

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

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

24 June 2007

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 rReverted 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 rUsing 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 rUsing 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 rTring to resolve
09:30, 28 October 2008Thumbnail for version as of 09:30, 28 October 2008600 × 480 (23 KB)Wiso{{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{{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{{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
No pages on the English Wikipedia use this file (pages on other projects are not listed).

Global file usage

The following other wikis use this file: