actionrwd.segment
actionrwd.segment, function
def process actionrwd.segment(
timeIndex: number,
baseline: number,
dispersion: number,
alpha: number,
start: ranvar,
duration: ranvar,
samples?: number,
seed?: number,
fixedStart?: number) : ranvar
Returns the demand ranvar integrated over a segment defined by start and
duration, using the same ISSM model as actionrwd.reward.
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.start: segment start as a ranvar, zero-indexed.duration: segment length as a ranvar, in periods.samples: number of simulated trajectories (default is 2500).seed: optional random seed for reproducibility.fixedStart: if provided, interpretstartas a variation around this value.
Examples
table P = extend.range(5)
table S = extend.range(2)
S.Start = dirac(2)
S.Duration = dirac(2)
S.D = actionrwd.segment(
TimeIndex: P.N,
Baseline: 10,
Dispersion: 1.0,
Alpha: 0.3,
Start: S.Start,
Duration: S.Duration)
show table "Segments" with
S.N
mean(S.D) as "Mean"
This produces the following table:
| N | Mean |
|---|---|
| 1 | 19.99038 |
| 2 | 19.99038 |
Remarks
Use actionrwd.segment to inspect demand over sub-horizons while keeping the
trajectory model aligned with actionrwd.reward.