extend.ranvar
extend.ranvar, function
def table extend.ranvar(r: ranvar): table
def table extend.ranvar(r: ranvar, gap: number): table
def table extend.ranvar(r: ranvar, gap: number, multiplier: number): table
def table extend.ranvar(r: ranvar, gap: number, multiplier: number, reach: number): table
Creates a table of contiguous buckets for the ranvar r, with Min and Max
boundaries for each bucket.
r: input distribution.gap: forces initial buckets[0,0]and[1,gap].multiplier: bucket size aftergap.reach: ensures the last bucket reaches at least this value.
Examples
r = poisson(2)
table G max 1000 = extend.ranvar(r)
G.P = int(r, G.Min, G.Max)
show table "Buckets" with
G.Min
G.Max
G.P as "Probability"
This produces the following table:
| Min | Max | Probability |
|---|---|---|
| 0 | 0 | 0.1353364 |
| 1 | 1 | 0.2706728 |
| 2 | 2 | 0.2706728 |
| 3 | 3 | 0.1804485 |
| 4 | 4 | 0.09022427 |
| 5 | 5 | 0.03608971 |
| 6 | 6 | 0.0120299 |
| 7 | 7 | 0.003437115 |
| 8 | 8 | 0.0008592788 |
| 9 | 9 | 0.0001909508 |
| 10 | 10 | 0.0000381902 |
Remarks
The optional overloads are useful to align buckets with reorder gaps, lot-size
constraints, or MOQ targets.
Tables produced by extend.ranvar default to a maximum size of 100m lines
unless an explicit max constraint is provided.