All Projects → SciML → PoissonRandom.jl

SciML / PoissonRandom.jl

Licence: other
Fast Poisson Random Numbers in pure Julia for scientific machine learning (SciML)

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to PoissonRandom.jl

AutoOptimize.jl
Automatic optimization and parallelization for Scientific Machine Learning (SciML)
Stars: ✭ 77 (+492.31%)
Mutual labels:  high-performance-computing, scientific-machine-learning, sciml
DiffEqDevTools.jl
Benchmarking, testing, and development tools for differential equations and scientific machine learning (SciML)
Stars: ✭ 37 (+184.62%)
Mutual labels:  scientific-machine-learning, sciml
SciMLBenchmarks.jl
Benchmarks for scientific machine learning (SciML) software and differential equation solvers
Stars: ✭ 195 (+1400%)
Mutual labels:  scientific-machine-learning, sciml
MuladdMacro.jl
This package contains a macro for converting expressions to use muladd calls and fused-multiply-add (FMA) operations for high-performance in the SciML scientific machine learning ecosystem
Stars: ✭ 32 (+146.15%)
Mutual labels:  scientific-machine-learning, sciml
RootedTrees.jl
A collection of functionality around rooted trees to generate order conditions for Runge-Kutta methods in Julia for differential equations and scientific machine learning (SciML)
Stars: ✭ 24 (+84.62%)
Mutual labels:  scientific-machine-learning, sciml
Quadrature.jl
A common interface for quadrature and numerical integration for the SciML scientific machine learning organization
Stars: ✭ 83 (+538.46%)
Mutual labels:  scientific-machine-learning, sciml
posts
Pieces of code that have appeared on my blog with a focus on stochastic simulations.
Stars: ✭ 31 (+138.46%)
Mutual labels:  poisson, poisson-distribution
DiffEqCallbacks.jl
A library of useful callbacks for hybrid scientific machine learning (SciML) with augmented differential equation solvers
Stars: ✭ 43 (+230.77%)
Mutual labels:  scientific-machine-learning, sciml
QuasiMonteCarlo.jl
Lightweight and easy generation of quasi-Monte Carlo sequences with a ton of different methods on one API for easy parameter exploration in scientific machine learning (SciML)
Stars: ✭ 47 (+261.54%)
Mutual labels:  scientific-machine-learning, sciml
DiffEqNoiseProcess.jl
A library of noise processes for stochastic systems like stochastic differential equations (SDEs) and other systems that are present in scientific machine learning (SciML)
Stars: ✭ 34 (+161.54%)
Mutual labels:  scientific-machine-learning, sciml
DiffEqGPU.jl
GPU-acceleration routines for DifferentialEquations.jl and the broader SciML scientific machine learning ecosystem
Stars: ✭ 131 (+907.69%)
Mutual labels:  scientific-machine-learning, sciml
HelicopterSciML.jl
Helicopter Scientific Machine Learning (SciML) Challenge Problem
Stars: ✭ 35 (+169.23%)
Mutual labels:  scientific-machine-learning, sciml
BoundaryValueDiffEq.jl
Boundary value problem (BVP) solvers for scientific machine learning (SciML)
Stars: ✭ 23 (+76.92%)
Mutual labels:  scientific-machine-learning, sciml
LatentDiffEq.jl
Latent Differential Equations models in Julia.
Stars: ✭ 34 (+161.54%)
Mutual labels:  scientific-machine-learning, sciml
Kinetic.jl
Universal modeling and simulation of fluid dynamics upon machine learning
Stars: ✭ 82 (+530.77%)
Mutual labels:  scientific-machine-learning, sciml
ExponentialUtilities.jl
Utility functions for exponential integrators for the SciML scientific machine learning ecosystem
Stars: ✭ 59 (+353.85%)
Mutual labels:  scientific-machine-learning, sciml
CellMLToolkit.jl
CellMLToolkit.jl is a Julia library that connects CellML models to the Scientific Julia ecosystem.
Stars: ✭ 50 (+284.62%)
Mutual labels:  scientific-machine-learning, sciml
Sundials.jl
Julia interface to Sundials, including a nonlinear solver (KINSOL), ODE's (CVODE and ARKODE), and DAE's (IDA) in a SciML scientific machine learning enabled manner
Stars: ✭ 167 (+1184.62%)
Mutual labels:  scientific-machine-learning, sciml
ArrayInterface.jl
Designs for new Base array interface primitives, used widely through scientific machine learning (SciML) and other organizations
Stars: ✭ 111 (+753.85%)
Mutual labels:  scientific-machine-learning, sciml
DiffEqSensitivity.jl
A component of the DiffEq ecosystem for enabling sensitivity analysis for scientific machine learning (SciML). Optimize-then-discretize, discretize-then-optimize, and more for ODEs, SDEs, DDEs, DAEs, etc.
Stars: ✭ 186 (+1330.77%)
Mutual labels:  scientific-machine-learning, sciml

PoissonRandom

Build Status

Usage

Pkg.add("PoissonRandom")

# Simple Poisson random
pois_rand(λ)

# Using another RNG
using RandomNumbers
rng = Xorshifts.Xoroshiro128Plus()
pois_rand(rng,λ)

Implementation

It mixes two methods. A simple count method and a method from a normal approximation. See this blog post for details.

Benchmark

using RandomNumbers, Distributions, BenchmarkTools, StaticArrays,
      RecursiveArrayTools, Plots, PoissonRandom
labels = ["count_rand","ad_rand","pois_rand","Distributions.jl"]
rng = Xorshifts.Xoroshiro128Plus()

function n_count(rng,λ,n)
  tmp = 0
  for i in 1:n
    tmp += PoissonRandom.count_rand(rng,λ)
  end
end

function n_pois(rng,λ,n)
  tmp = 0
  for i in 1:n
    tmp += pois_rand(rng,λ)
  end
end

function n_ad(rng,λ,n)
  tmp = 0
  for i in 1:n
    tmp += PoissonRandom.ad_rand(rng,λ)
  end
end

function n_dist(λ,n)
  tmp = 0
  for i in 1:n
    tmp += rand(Poisson(λ))
  end
end

function time_λ(rng,λ,n)
  t1 = @elapsed n_count(rng,λ,n)
  t2 = @elapsed n_ad(rng,λ,n)
  t3 = @elapsed n_pois(rng,λ,n)
  t4 = @elapsed n_dist(λ,n)
  @SArray [t1,t2,t3,t4]
end

# Compile
time_λ(rng,5,5000000)
# Run with a bunch of λ
times = VectorOfArray([time_λ(rng,n,5000000) for n in 1:20])'
plot(times,labels = labels, lw = 3)

benchmark result

So this package ends up about 30% or so faster than Distributions.jl (the method at the far edge is λ-independent so that goes on forever).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].