Pythagon

Constructions with Python

Monday, August 20, 2018

Fast inverse transform sampling for an arbitrary probability distribution

This is a fast Python implementation of Inverse Transform Sampling for an arbitrary probability distribution. Generating 106 random numbers with this crazy probability density function takes ~150 ms on a i5-3320M CPU @ 2.6 GHz, most of it from scipy.interpolate.interp1d.
Posted by Amar
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Why

This blog started as a repository for useful Python tricks and code snippets. Feel free to borrow and use these in your projects!

Search blog

Popular Posts

  • Smith chart tuner
  • Animated stripchart
  • SR850 lock-in amplifier, with PyVISA
  • PSI4: quantum chemistry calculations
  • Slicing and histogramming
  • Animated plots of log files
  • Bloch sphere utility
  • Spectrum analyzer with a Rigol scope
  • RLC circuit tuner
  • Filtering signals

Blog Archive

  • ▼  2018 (1)
    • ▼  Aug (1)
      • Fast inverse transform sampling for an arbitrary p...
  • ►  2015 (1)
    • ►  Jul (1)
  • ►  2014 (10)
    • ►  Jul (2)
    • ►  Jun (1)
    • ►  May (1)
    • ►  Apr (3)
    • ►  Feb (1)
    • ►  Jan (2)
  • ►  2013 (16)
    • ►  Dec (1)
    • ►  Nov (4)
    • ►  Oct (1)
    • ►  Sep (3)
    • ►  Aug (3)
    • ►  May (3)
    • ►  Apr (1)

Power source

Power source

Links

  • StackOverflow / Python
  • Github Gists
  • IPython Notebook Viewer
Simple theme. Powered by Blogger.