The mathematical model
describing the situation is shown below. Note that the trend
component is accumulated since the beginning of the simulation
with the sum term. The step component is a quantity added to
the base demand at each iteration.
The trend component is itself a random variable
described in the following.
At each iteration, the trend is the trend value
at the previous iteration plus a new trend added in the current
iteration. The addition is from a Normal distribution with
a specified standard deviation and a mean of 0. However, whether
the current value is added or not depends on a Bernoulli random
variable taking on the value 0 or 1. The Bernoulli distribution
has the probability parameter given as 0.1 specified on the
In practice, this represents a situation where
the series is affected by random influences that either causes
a trend change or not. The probability of the change is given
by the parameter of the Bernoulli distribution.
The step component is similarly affected by a
random variable with a Bernoulli distribution. It represents
some shock that affects the constant term added to the base
demand. The model for the step component is similar to the
trend component, but it is affected by different random variables.
Although this model seems complicated, it might
represent a situation where demand is not constant over time.
Such a model could be a useful start for a variety of situations
involving time series.