random.ranvar

random.ranvar, function

def pure random.ranvar(r: ranvar): number

Draws a deviate from the distribution represented by r.

Example

montecarlo 10000 with
  x = random.ranvar(poisson(2))
  sample avgX = avg(x)

show scalar "Average sample" with avgX

This outputs the following scalar:

Average sample
1.9854
User Contributed Notes
0 notes + add a note