ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_distBern Module Reference

This module contains classes and procedures for generating Bernoulli-distributed random numbers.
More...

Data Types

type  distBern_type
 This is the derived type for signifying distributions that are of type Bernoulli as defined in the description of pm_distBern. More...
 
interface  getBernRand
 Generate and return a scalar or array of rank 1 of length size or the same rank and size as p of Bernoulli-distributed random values (0 or 1) with probability of getting 1 set by the input success probability p.
More...
 
interface  isHead
 Generate and return a scalar (or a vector of length size or an array of the same shape as the input p) containing the odds of getting a head in a single (or a series) of coin-flipping experiment(s).
More...
 
interface  setBernRand
 Return a scalar or array of arbitrary rank of Bernoulli-distributed random values (0 or 1), with the specified input success probability p. More...
 

Variables

character(*, SK), parameter MODULE_NAME = SK_"@pm_distBern"
 

Detailed Description

This module contains classes and procedures for generating Bernoulli-distributed random numbers.

The Bernoulli distribution, named after Swiss mathematician Jacob Bernoulli, is the discrete probability distribution of a random variable which takes the value \(1\) with probability \(p\) and the value \(0\) with probability \(q = 1-p\).

Less formally, it can be thought of as a model for the set of possible outcomes of any single experiment that asks a yes–no question.
The Bernoulli distribution is a special case of the Binomial distribution with \(n = 1\) (with \(n\) the number of trials).
It is also sometimes called the two-point distribution because of having only two possible outcomes.

Test:
test_pm_distBern


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Oct 16, 2009, 11:14 AM, Michigan

Variable Documentation

◆ MODULE_NAME

character(*, SK), parameter pm_distBern::MODULE_NAME = SK_"@pm_distBern"

Definition at line 45 of file pm_distBern.F90.