File:Linear least squares.svg
出自Wikimedia Commons
跳至導覽
跳至搜尋
此 SVG 檔案的 PNG 預覽的大小:494 × 599 像素。 其他解析度:198 × 240 像素 | 396 × 480 像素 | 633 × 768 像素 | 844 × 1,024 像素 | 1,688 × 2,048 像素 | 512 × 621 像素。
原始檔案 (SVG 檔案,表面大小:512 × 621 像素,檔案大小:77 KB)
檔案資訊
結構化資料
說明
描述Linear least squares.svg | Illustration of linear least squares. | |||
日期 | (UTC) | |||
來源 | self-made with MATLAB, tweaked in Inkscape. | |||
作者 | Oleg Alexandrov | |||
授權許可 (重用此檔案) |
|
|||
SVG開發 InfoField | ||||
原始碼 InfoField | MATLAB code% Illustration of linear least squares.
function main()
% KSmrq's colors
red = [0.867 0.06 0.14];
blue = [0, 129, 205]/256;
green = [0, 200, 70]/256;
yellow = [254, 194, 0]/256;
white = 0.99*[1, 1, 1];
gray = 0.2*white;
% Set up the grid and other parameters
N = 100;
A = -2.2; B = 2;
X = linspace(A, B, N);
C=-4; D = 4;
% Set up the figure
lw = 4; % linewidth
fs = 18; % font size
figure(1); clf; hold on;
set(gca, 'fontsize', fs);
set(gca, 'linewidth', lw/2.5)
hold on; grid on;
% random numbers
a = 1.1; b = 3.5; c = 1.4;
M = 50;
XX=linspace(A+0.3, B-0.3, M+1);
Xr = 0*(1:M);
Yr = Xr;
for i=1:M
r=rand(1);
Xr(i) = XX(i)*r+XX(i+1)*(1-r);
Yr(i) = a*Xr(i) + b + c*0.4*erfinv(2*rand(1) - 1);
end
myrad = 0.05;
for i=1:length(Xr)
ball(Xr(i), Yr(i), myrad, red);
end
% least squares fitting
Yr = Yr';
Mat = [Xr' (0*Xr+1)'];
V=Mat'*Yr;
V=(Mat'*Mat)\V;
ae = V(1); be = V(2);
plot(X, ae*X+be, 'b', 'linewidth', lw);
grid on;
set(gca, 'GridLineStyle', '-', 'xcolor', gray);
set(gca, 'GridLineStyle', '-', 'ycolor', gray);
set(gca, 'XTick', [-2 -1 0 1 2]);
axis equal;
axis([-2, 2, 1, 6]);
saveas(gcf, 'Linear_least_squares.eps', 'psc2'); % save as eps
%plot2svg('Linear_least_squares.svg'); % save as svg
function ball(x, y, r, color)
Theta=0:0.1:2*pi;
X=r*cos(Theta)+x;
Y=r*sin(Theta)+y;
H=fill(X, Y, color);
set(H, 'EdgeColor', 'none');
|
檔案歷史
點選日期/時間以檢視該時間的檔案版本。
日期/時間 | 縮圖 | 尺寸 | 使用者 | 備註 | |
---|---|---|---|---|---|
目前 | 2009年2月22日 (日) 04:33 | 512 × 621(77 KB) | Oleg Alexandrov(留言 | 貢獻) | Normal noise per Michael Hardy | |
2008年2月3日 (日) 00:58 | 412 × 523(75 KB) | Oleg Alexandrov(留言 | 貢獻) | tweak width | ||
2008年2月2日 (六) 20:27 | 401 × 523(75 KB) | Oleg Alexandrov(留言 | 貢獻) | tweak bd box | ||
2008年2月2日 (六) 19:54 | 4,609 × 5,778(75 KB) | Oleg Alexandrov(留言 | 貢獻) | tweak bd box | ||
2008年2月2日 (六) 19:50 | 4,609 × 5,778(75 KB) | Oleg Alexandrov(留言 | 貢獻) | tweak bd box | ||
2008年2月2日 (六) 19:41 | 754 × 945(74 KB) | Oleg Alexandrov(留言 | 貢獻) | tweak text font size | ||
2008年2月2日 (六) 19:38 | 55 × 69(74 KB) | Oleg Alexandrov(留言 | 貢獻) | tweak text font size | ||
2008年2月2日 (六) 19:15 | 303 × 411(74 KB) | Oleg Alexandrov(留言 | 貢獻) | {{Information |Description=Illustration of linear least squares. |Source=self-made with MATLAB, tweaked in Inkscape. |Date=~~~~~ |Author= Oleg Alexandrov |Permission=See below |other_versions= }} {{PD |
無法覆蓋此檔案。
檔案用途
沒有使用此檔案的頁面。
全域檔案使用狀況
以下其他 wiki 使用了這個檔案:
- en.wikipedia.org 的使用狀況
- en.wikiversity.org 的使用狀況
- eu.wikipedia.org 的使用狀況
- it.wikipedia.org 的使用狀況
- th.wikipedia.org 的使用狀況
- zh.wikipedia.org 的使用狀況