actionrwd.demand
actionrwd.demand, function
def process actionrwd.demand(
timeIndex: number,
baseline: number,
dispersion: number,
alpha: number,
samples?: number,
seed?: number) : ranvar
Returns the cumulative demand ranvar driven by the ISSM model, ordered by
timeIndex, with per-period mean baseline and variability tuned by
dispersion and alpha.
timeIndex: ordering of periods within each item.baseline: expected demand per period.dispersion: variance divided by mean for the demand model.alpha: update speed of the hidden level in the ISSM model.samples: number of simulated trajectories (default is 2500).seed: optional random seed for reproducibility.
Examples
table P = extend.range(5)
P.D = actionrwd.demand(
TimeIndex: P.N,
Baseline: 10,
Dispersion: 1.0,
Alpha: 0.3)
show table "Demand" with
P.N
mean(P.D) as "Mean"
This produces the following table:
| N | Mean |
|---|---|
| 1 | 9.934401 |
| 2 | 19.9096 |
| 3 | 29.89678 |
| 4 | 39.90157 |
| 5 | 49.86077 |
Remarks
actionrwd.demand is intended for diagnostics alongside
actionrwd.reward, as it exposes the same internal
trajectory model in cumulative form.