File:Reciprocal Histogram.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 720 × 288 pixels, file size: 33 KB)

Captions

Captions

Histogram and log-histogram of random deviates from the reciprocal distribution

Summary[edit]

Description
English: Random draws from the reciprocal distribution plotted in a log-histogram shows that the distribution of the log(x) is uniform.
Date
Source Own work
Author Bscan

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public 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.

import numpy as np
import matplotlib.pyplot as plt
from scipy import stats

N = 1000000
orig = stats.reciprocal.rvs(a=0.1, b=100, size=N)

fig, ax  = plt.subplots(1,2, figsize=(8,3.2))
hist, bins, _ = plt.hist(orig, bins=8)
plt.cla()
ax[0].hist(orig, rwidth=0.8)
ax[0].set_xlabel("x")
ax[0].set_ylabel("C(x)")
ax[0].set_ylim(0, 1e6)

logbins = np.logspace(np.log10(bins[0]),np.log10(bins[-1]),len(bins))
ax[1].hist(orig, bins=logbins, rwidth=0.8)
ax[1].set_xscale('log')
ax[1].set_xlabel("x")
ax[1].set_ylabel("C(x)")
ax[1].set_ylim(0, 5e5)

plt.tight_layout()
plt.savefig("/dbfs/FileStore/Wikipedia/reciprocal_hist.svg")
display()

File history

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

Date/TimeThumbnailDimensionsUserComment
current15:02, 1 July 2019Thumbnail for version as of 15:02, 1 July 2019720 × 288 (33 KB)Bscan (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata