File:Geometric pmf.svg

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

原本檔案(SVG檔案,表面大細: 675 × 288 像素,檔案大細:52 KB)

摘要

描述
English: Plot of the probability mass functions of several members of the family of geometric distributions.
日期
來源 自己作品
作者 Skbkekas
SVG genesis
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
原始碼
InfoField

Python code

import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp

col = {0.2: 'orange', 0.5: 'purple', 0.8: 'lightblue'}

plt.clf()
plt.figure(figsize=(7.5,3.2))
ax1 = plt.axes([0.08,0.13,0.4,0.8])
ax2 = plt.axes([0.57,0.13,0.4,0.8])
plt.hold(True)

X1 = np.arange(1,11)
X2 = np.arange(0,11)

A1,A2 = [],[]
for p in 0.2,0.5,0.8:
    Y1 = (X1-1)*np.log(1-p) + np.log(p)
    Y1 = np.exp(Y1)
    Y2 = X2*np.log(1-p) + np.log(p)
    Y2 = np.exp(Y2)
    ax1.plot(X1, Y1, '-', color='grey', lw=1)
    ax2.plot(X2, Y2, '-', color='grey', lw=1)
    a1 = ax1.plot(X1, Y1, 'o', color=col[p], lw=3)
    a2 = ax2.plot(X2, Y2, 'o', color=col[p], lw=3)
    A1.append(a1)
    A2.append(a2)

ax1.set_xlabel("x")
ax1.set_ylabel("P(X=x)")
ax2.set_xlabel("x")
ax2.set_ylabel("P(X=x)")

bx1 = ax1.legend(A1, ("p=0.2", "p=0.5", "p=0.8"),\
                 numpoints=1, handletextpad=0, loc="upper right")
bx2 = ax2.legend(A2, ("p=0.2", "p=0.5", "p=0.8"),\
                numpoints=1, handletextpad=0, loc="upper right")
bx1.draw_frame(False)
bx2.draw_frame(False)
ax1.set_xlim(-0.2,10.2)
ax2.set_xlim(-0.2,10.2)
ax1.set_ylim(-0.05,1.05)
ax2.set_ylim(-0.05,1.05)

plt.savefig("geometric_pmf.pdf")
plt.savefig("geometric_pmf.svg")

協議

我,呢份作品嘅作者,決定用以下許可發佈呢件作品:
w:en:Creative Commons
署名
Ĉi tiu dosiero estas disponebla laŭ la permesilo Krea Komunaĵo Atribuite 3.0 Neadaptita.
你可以:
  • 去分享 – 複製、發佈同傳播呢個作品
  • 再改 – 創作演繹作品
要遵照下面嘅條件:
  • 署名 – 你一定要畀合適嘅表彰、畀返指向呢個授權條款嘅連結,同埋寫明有無改過嚟。你可以用任何合理方式去做,但唔可以用任何方式暗示授權人認可咗你或者你嘅使用方式。

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

圖中顯示嘅係

26 2 2010

檔案歷史

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

日期/時間縮圖尺寸用戶註解
現時2010年2月26號 (五) 23:30響2010年2月26號 (五) 23:30嘅縮圖版本675 × 288(52 KB)Skbkekas{{Information |Description={{en|1=Plot of the probability mass functions of several members of the family of geometric distributions.}} |Source={{own}} |Author=Skbkekas |Date=2010-02-26 |Permission= |other_versions= }} [[Category:Statis

以下嘅2版用到呢個檔:

全域檔案使用情況

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