The accumulator returns the empirical distribution of the sampled values. The
target may be a scalar or a vector. In the vector case, one empirical ranvar is
accumulated per line. With n Monte Carlo iterations, each observed path
contributes 1 / n of probability mass. See
How to choose a Monte Carlo sample count
for guidance on selecting and validating the count.
r = poisson(3)
montecarlo 1000 with
dev = random.ranvar(r)
sample r2 = ranvar(dev)
show summary "Empirical ranvar" with
mean(r2) as "Mean"
dispersion(r2) as "Dispersion"
This outputs the following summary:
Mean
Dispersion
2.928
0.9975465
table T = extend.range(3)
montecarlo 100 with
sample T.R = ranvar(random.normal(T.N, 0.1))
show table "Vector empirical ranvars" with
T.N
mean(T.R) as "Mean"
dispersion(T.R) as "Dispersion"