File:Random Walk example.svg

頁面內容唔支援其他語言。
出自維基百科,自由嘅百科全書

原本檔案(SVG檔案,表面大細: 720 × 540 像素,檔案大細:30 KB)

摘要

This file was copied from en.wikipedia by Toobaz, what follows is its original description:

描述 Eight different random walks.
日期
來源 I created this work entirely by myself.
 
This W3C-unspecified plot was created with Matplotlib.
作者 Morn (talk)
Other versions File:Random_Walk_example.png

Code

Made with the following Python script (needs Matplotlib):

from pylab import *
from random import choice
numwalk = 8
length = 100
data = zeros((numwalk, length), int)
for n in range(numwalk):
	for x in range(1, length):
		step = choice([-1, 1])
		data[n,x] = data[n,x-1] + step
	plot(range(length), data[n,:])
xlabel('t')
axis ((0,100, -20, 20))
savefig('Random_Walk_example.svg')
show()
wikipedia user Morn, the copyright holder of this work, hereby publishes it under the following license:
GNU head 根據自由軟體基金會發佈嘅無固定段落、封面文字同封底文字GNU自由文件授權條款第1.2或打後嘅版本,你獲授權可以重製、散佈同埋修改爾份文件。授權條款嘅副本喺章節GNU自由文件授權條款

Original upload log

The original description page was here. All following user names refer to en.wikipedia.
  • 2008-10-14 18:20 Morn 720×540× (30897 bytes) {{Information |Description= |Source=I created this work entirely by myself. |Date=2008-10-14 |Author=~~~ |other_versions= }} Made with the following Python script: <code> from pylab import * from random import choice numwalk = 8 length = 100 data = z

The following is the similar code in MATLAB and Octave

function RandomWalk () hold off; x = 1:100; color = ['y' 'g' 'b' 'k' 'r', 'm' 'c']; y(1)= 0; for m = 1:7 for n = 2:100 y(n) = y(n-1) + 2*floor(rand()*2)-1; end plot(x, y, color(m), 'LineWidth',2); hold on axis([0 100, -20 20]) end end

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

圖中顯示嘅係

14 10 2008

檔案歷史

撳個日期/時間去睇響嗰個時間出現過嘅檔案。

日期/時間縮圖尺寸用戶註解
現時2010年2月5號 (五) 07:28響2010年2月5號 (五) 07:28嘅縮圖版本720 × 540(30 KB)Toobaz== Summary == This file was copied from en.wikipedia by Toobaz, what follows is its original description: {{Information |Description=Eight different random walks. |Source=I created this work entirely by myself. |Date=2008-10-14 |Au

以下嘅2版用到呢個檔:

全域檔案使用情況

下面嘅維基都用緊呢個檔案: