All Projects → SciML → QuasiMonteCarlo.jl

SciML / QuasiMonteCarlo.jl

Licence: MIT license
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)

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to QuasiMonteCarlo.jl

sciml.ai
The SciML Scientific Machine Learning Software Organization Website
Stars: ✭ 38 (-19.15%)
Mutual labels:  scientific-machine-learning, sciml, physics-informed-learning
Differentialequations.jl
Multi-language suite for high-performance solvers of differential equations and scientific machine learning (SciML) components
Stars: ✭ 2,023 (+4204.26%)
Mutual labels:  scientific-machine-learning, sciml
Kinetic.jl
Universal modeling and simulation of fluid dynamics upon machine learning
Stars: ✭ 82 (+74.47%)
Mutual labels:  scientific-machine-learning, sciml
AutoOptimize.jl
Automatic optimization and parallelization for Scientific Machine Learning (SciML)
Stars: ✭ 77 (+63.83%)
Mutual labels:  scientific-machine-learning, sciml
MultiScaleArrays.jl
A framework for developing multi-scale arrays for use in scientific machine learning (SciML) simulations
Stars: ✭ 63 (+34.04%)
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 (-31.91%)
Mutual labels:  scientific-machine-learning, sciml
DiffEqOnlineServer
Backend for DiffEqOnline, a webapp for scientific machine learning (SciML)
Stars: ✭ 24 (-48.94%)
Mutual labels:  scientific-machine-learning, sciml
PoissonRandom.jl
Fast Poisson Random Numbers in pure Julia for scientific machine learning (SciML)
Stars: ✭ 13 (-72.34%)
Mutual labels:  scientific-machine-learning, sciml
DiffEqDevTools.jl
Benchmarking, testing, and development tools for differential equations and scientific machine learning (SciML)
Stars: ✭ 37 (-21.28%)
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 (+255.32%)
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 (+6.38%)
Mutual labels:  scientific-machine-learning, sciml
DiffEqUncertainty.jl
Fast uncertainty quantification for scientific machine learning (SciML) and differential equations
Stars: ✭ 61 (+29.79%)
Mutual labels:  scientific-machine-learning, sciml
BoundaryValueDiffEq.jl
Boundary value problem (BVP) solvers for scientific machine learning (SciML)
Stars: ✭ 23 (-51.06%)
Mutual labels:  scientific-machine-learning, sciml
SciPyDiffEq.jl
Wrappers for the SciPy differential equation solvers for the SciML Scientific Machine Learning organization
Stars: ✭ 19 (-59.57%)
Mutual labels:  scientific-machine-learning, sciml
diffeqr
Solving differential equations in R using DifferentialEquations.jl and the SciML Scientific Machine Learning ecosystem
Stars: ✭ 118 (+151.06%)
Mutual labels:  scientific-machine-learning, sciml
GlobalSensitivity.jl
Robust, Fast, and Parallel Global Sensitivity Analysis (GSA) in Julia
Stars: ✭ 30 (-36.17%)
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 (-48.94%)
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 (+76.6%)
Mutual labels:  scientific-machine-learning, sciml
DiffEqCallbacks.jl
A library of useful callbacks for hybrid scientific machine learning (SciML) with augmented differential equation solvers
Stars: ✭ 43 (-8.51%)
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 (+136.17%)
Mutual labels:  scientific-machine-learning, sciml

QuasiMonteCarlo.jl

Build Status

This is a lightweight package for generating Quasi-Monte Carlo (QMC) samples using various different methods.

Tutorials and Documentation

For information on using the package, see the stable documentation. Use the in-development documentation for the version of the documentation, which contains the unreleased features.

Example

using QuasiMonteCarlo, Distributions
lb = [0.1,-0.5]
ub = [1.0,20.0]
n = 5
d = 2

s = QuasiMonteCarlo.sample(n,lb,ub,GridSample([0.1,0.5]))
s = QuasiMonteCarlo.sample(n,lb,ub,UniformSample())
s = QuasiMonteCarlo.sample(n,lb,ub,SobolSample())
s = QuasiMonteCarlo.sample(n,lb,ub,LatinHypercubeSample())
s = QuasiMonteCarlo.sample(n,lb,ub,LatticeRuleSample())
s = QuasiMonteCarlo.sample(n,lb,ub,LowDiscrepancySample([10,3], false))

The output s is a matrix, so one can use things like @uview from UnsafeArrays.jl for a stack-allocated view of the ith point:

using UnsafeArrays
@uview s[:,i]

API

Everything has the same interface:

A = QuasiMonteCarlo.sample(n,lb,ub,sample_method)

where:

  • n is the number of points to sample.
  • lb is the lower bound for each variable. The length determines the dimensionality.
  • ub is the upper bound.
  • sample_method is the quasi-Monte Carlo sampling strategy.

Additionally, there is a helper function for generating design matrices:

k=2
As = QuasiMonteCarlo.generate_design_matrices(n,lb,ub,sample_method,k)

which returns As which is an array of k design matrices A[i] that are all sampled from the same low-discrepancy sequence.

Available Sampling Methods

  • GridSample(dx) where the grid is given by lb:dx[i]:ub in the ith direction.
  • UniformSample for uniformly distributed random numbers.
  • SobolSample for the Sobol sequence.
  • LatinHypercubeSample for a Latin Hypercube.
  • LatticeRuleSample for a randomly-shifted rank-1 lattice rule.
  • LowDiscrepancySample(base) where base[i] is the base in the ith direction.
  • GoldenSample for a Golden Ratio sequence.
  • KroneckerSample(alpha, s0) for a Kronecker sequence, where alpha is an length-d vector of irrational numbers (often sqrt(d)) and s0 is a length-d seed vector (often 0).
  • SectionSample(x0, sampler) where sampler is any sampler above and x0 is a vector of either NaN for a free dimension or some scalar for a constrained dimension.
  • Additionally, any Distribution can be used, and it will be sampled from.

Adding a new sampling method

Adding a new sampling method is a two-step process:

  1. Add a new SamplingAlgorithm type.
  2. Overload the sample function with the new type.

All sampling methods are expected to return a matrix with dimension d by n, where d is the dimension of the sample space and n is the number of samples.

Example

struct NewAmazingSamplingAlgorithm{OPTIONAL} <: SamplingAlgorithm end

function sample(n,lb,ub,::NewAmazingSamplingAlgorithm)
    if lb isa Number
        ...
        return x
    else
        ...
        return reduce(hcat, x)
    end
end
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].