Movatterモバイル変換


[0]ホーム

URL:


Jump to content
Wikimedia Commons
Search

File:Dirichlet process draws.svg

From Wikimedia Commons, the free media repository
File:Dirichlet process draws.svg
Size of this PNG preview of this SVG file:600 × 600 pixels.Other resolutions:240 × 240 pixels |480 × 480 pixels |768 × 768 pixels |1,024 × 1,024 pixels |2,048 × 2,048 pixels |900 × 900 pixels.
Original file(SVG file, nominally 900 × 900 pixels, file size: 588 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
DescriptionDirichlet process draws.svg
English: Draws from the Dirichlet process DP(N(0,1), alpha). Each row uses a different alpha: 1, 10, 100 and 1000. A row contains 3 repetitions of the same experiment.

Python source code:

import matplotlib.pyplot as plt import numpy as npfrom scipy.stats import betafrom scipy.stats import norm   def draw_stick_breaking(ax, alpha, base_distribution):    beta_prime_ks = []    theta_ks = []        beta_distribution = beta(1, alpha)        rest = 1    for k in range(500):        theta_k = base_distribution.rvs()        beta_k = beta_distribution.rvs()                theta_ks.append(theta_k)        beta_prime_k = beta_k*rest        beta_prime_ks.append(beta_prime_k)                rest *= 1-beta_k        if rest < 1e-4:            break                    ax.stem(theta_ks, beta_prime_ks, markerfmt=' ')def main():    np.random.seed(1) #reproducibility        alphas = [1, 10, 100, 1000]    base_distribution = norm(0, 1)        n_rows = len(alphas)    n_cols = 3        fig, axarr = plt.subplots(n_rows,n_cols, sharex=True, sharey="row", figsize=(10,10))    for i_row in range(n_rows):        for i_col in range(n_cols):            draw_stick_breaking(axarr[i_row][i_col], alphas[i_row], base_distribution)            # set 3 ticks on each axis       axarr[0][0].xaxis.set_major_locator(plt.MaxNLocator(3))    for i_row in range(n_rows):        axarr[i_row][0].yaxis.set_major_locator(plt.MaxNLocator(3))    fig.tight_layout(pad=0.15)        fig.savefig('dirichlet.svg')        plt.show()if __name__ == '__main__':   main()
Date
SourceOwn work
AuthorQorilla

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-ZeroThis file is made available under theCreative CommonsCC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to thepublic domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse

File history

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

Date/TimeThumbnailDimensionsUserComment
current16:10, 20 October 2014Thumbnail for version as of 16:10, 20 October 2014900 × 900(588 KB)Qorilla(talk |contribs)User created page with UploadWizard

You cannot overwrite this file.

File usage on Commons

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata

This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.

Width720pt
Height720pt
Retrieved from "https://commons.wikimedia.org/w/index.php?title=File:Dirichlet_process_draws.svg&oldid=460144035"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp