functionDiscrete

Discrete

Information

Discrete

Empirical discrete probability distribution.

Syntax

Discrete(g,p[:],v[:])

Description

This function generates random variates following the Empirical Discrete distribution function described by the parameters p and v.
Parameter p represents the list of cummulative probabilities related with the values in v.
Length of p and v must be the same.

The following figure graphically shows the empirical discrete distribution.

discrete

Examples

 Discrete(g,{0.2,0.4,0.6,0.8,1},{1,2,3,4,5});

Inputs

TypeNameDefaultDescription
CMRG.RngStreamgRandom number generator
Real[:]pCummulative probabilities
Real[:]vValues related with the probabilities

Outputs

TypeNameDefaultDescription
RealvalueGenerated random variate
CMRG.RngStreamgoutUpdated random number generator