587 research outputs found

    Parallel Weighted Random Sampling

    Get PDF
    Data structures for efficient sampling from a set of weighted items are an important building block of many applications. However, few parallel solutions are known. We close many of these gaps both for shared-memory and distributed-memory machines. We give efficient, fast, and practicable algorithms for sampling single items, k items with/without replacement, permutations, subsets, and reservoirs. We also give improved sequential algorithms for alias table construction and for sampling with replacement. Experiments on shared-memory parallel machines with up to 158 threads show near linear speedups both for construction and queries

    Methods for generating variates from probability distributions

    Get PDF
    This thesis was submitted for the degree of Doctor of Philosophy and awarded by Brunel University.Diverse probabilistic results are used in the design of random univariate generators. General methods based on these are classified and relevant theoretical properties derived. This is followed by a comparative review of specific algorithms currently available for continuous and discrete univariate distributions. A need for a Zeta generator is established, and two new methods, based on inversion and rejection with a truncated Pareto envelope respectively are developed and compared. The paucity of algorithms for multivariate generation motivates a classification of general methods, and in particular, a new method involving envelope rejection with a novel target distribution is proposed. A new method for generating first passage times in a Wiener Process is constructed. This is based on the ratio of two random numbers, and its performance is compared to an existing method for generating inverse Gaussian variates. New "hybrid" algorithms for Poisson and Negative Binomial distributions are constructed, using an Alias implementation, together with a Geometric tail procedure. These are shown to be robust, exact and fast for a wide range of parameter values. Significant modifications are made to Atkinson's Poisson generator (PA), and the resulting algorithm shown to be complementary to the hybrid method. A new method for Von Mises generation via a comparison of random numbers follows, and its performance compared to that of Best and Fisher's Wrapped Cauchy rejection method. Finally new methods are proposed for sampling from distribution tails, using optimally designed Exponential envelopes. Timings are given for Gamma and Normal tails, and in the latter case the performance is shown to be significantly better than Marsaglia's tail generation procedure.Governors of Dundee College of Technolog

    Optimal Discrete Uniform Generation from Coin Flips, and Applications

    Full text link
    This article introduces an algorithm to draw random discrete uniform variables within a given range of size n from a source of random bits. The algorithm aims to be simple to implement and optimal both with regards to the amount of random bits consumed, and from a computational perspective---allowing for faster and more efficient Monte-Carlo simulations in computational physics and biology. I also provide a detailed analysis of the number of bits that are spent per variate, and offer some extensions and applications, in particular to the optimal random generation of permutations.Comment: first draft, 22 pages, 5 figures, C code implementation of algorith

    Fast Algorithms for Generating Discrete Random Variates With Changing Distributions

    Get PDF
    One of the most fundamental and frequently used operations in the process of simulating a stochastic discrete event system is the generation of a nonuniform discrete random variate. The simplest form of this operation can be stated as follows: Generate a random variable X which is distributed over the integers 1,2,...,n such that P(X = i) = pi. A more difficult problem is to generate X when the pi\u27s change with time. For this case, there is a well-known algorithm which takes O(log n) time to generate each variate. Recently Fox [4] presented an algorithm that takes an expected o(log n) time to generate each variate under assumptions restricting the way the pi\u27s can change. In this paper we present algorithm for discrete random variate generation that take an expected O(1) time to generate each variate. Furthermore, our assumptions on how the pi\u27s change are less restrictive than those of Fox. The algorithms are quite simple and can be fine-tuned to suit a wide variety of application. The application to the simulation of queueing networks is discussed in some detail

    Simulating Population Protocols in Sub-Constant Time per Interaction

    Get PDF
    We consider the efficient simulation of population protocols. In the population model, we are given a system of n agents modeled as identical finite-state machines. In each step, two agents are selected uniformly at random to interact by updating their states according to a common transition function. We empirically and analytically analyze two classes of simulators for this model. First, we consider sequential simulators executing one interaction after the other. Key to the performance of these simulators is the data structure storing the agents\u27 states. For our analysis, we consider plain arrays, binary search trees, and a novel Dynamic Alias Table data structure. Secondly, we consider batch processing to efficiently update the states of multiple independent agents in one step. For many protocols considered in literature, our simulator requires amortized sub-constant time per interaction and is fast in practice: given a fixed time budget, the implementation of our batched simulator is able to simulate population protocols several orders of magnitude larger compared to the sequential competitors, and can carry out 2^50 interactions among the same number of agents in less than 400s

    Parallel Weighted Random Sampling

    Get PDF
    Data structures for efficient sampling from a set of weighted items are an important building block of many applications. However, few parallel solutions are known. We close many of these gaps both for shared-memory and distributed-memory machines. We give efficient, fast, and practicable algorithms for sampling single items, k items with/without replacement, permutations, subsets, and reservoirs. We also give improved sequential algorithms for alias table construction and for sampling with replacement. Experiments on shared-memory parallel machines with up to 158 threads show near linear speedups both for construction and queries

    Clock Factorized Quantum Monte Carlo Method for Long-range Interacting Systems

    Full text link
    Simulating long-range interacting systems is a challenging task due to its computational complexity that the computational effort for each local update is of order O\cal{O}(N)(N), where NN is the size of system. Recently, a technique, called hereby the clock factorized quantum Monte Carlo method, was developed on the basis of the so-called factorized Metropolis filter [Phys. Rev. E 99 010105 (2019)]. In this work, we first explain step by step how the clock factorized quantum Monte Carlo method is implemented to reduce the computational overhead from O\cal{O}(N)(N) to O\cal{O}(1). In particular, the core ingredients, including the concepts of bound probabilities and bound rejection events, the tree-like data structure, and the fast algorithms for sampling an extensive set of discrete and small probabilities, are elaborated. Next, we show how the clock factorized quantum Monte Carlo method can be flexibly implemented in various update strategies, like the Metropolis and worm-type algorithms, and can be generalized to simulate quantum systems. Finally, we demonstrate the high efficiency of the clock factorized quantum Monte Carlo algorithms in the examples of the quantum Ising model and the Bose-Hubbard model with long-range interactions and/or long-range hopping amplitudes. We expect that the clock factorized quantum Monte Carlo algorithms would find broad applications in statistical and condensed-matter physics
    • …
    corecore