Series.randomlyGrowing
(Series)
Create randomly growing time series
Syntax
outputSeries = Series.randomlyGrowing(range)
outputSeries = Series.randomlyGrowing(range, [mean, stdev], ...)
Input Arguments
range
[ Dater ]
Date range on which the randomly growing time series will be created.
[mean=0, stdev=1]
[ numeric ]
The mean and std deviation of the Normal distribution from which the log-growth rate or the difference will be drawn; see Description.
Output Arguments
outputSeries
[ Series ]
Output time series.
Options
Comment=""
[ string ]
Comment, or an array of comments (depending on the
Dimensions
option) that will be assigned to theoutputSeries
.
Dimensions=1
[ numeric ]
The size of the
outputSeries
in 2nd and higher dimensions.
Exponentiate=true
[ true
| false
]
Exponentiate the cumulative sum of random numbers to create the
outputSeries
.
Initial=0
[ numeric ]
Initial value for the cumulative sum of random numbers (before exponentiation when
Exponentiate=true
.
Description
The output series is created as follows:
-
Generate a series of a total of N random numbers from \(N(\mu, \sigma)\), where the mean \(\mu\) and the std deviation \(\sigma\) are determined by the input arguments
mean
andstdev
, respectively, and N is the number of periods in therange
. -
Replace the first random number in the series with
Initial
, and calculate the cumulative sum of these random numbers. -
When
Exponentiate=true
, exponentiate the cumulated series.
Example
x = Series.randomlyGrowing(qq(2020,1):qq(2030,4), [0.01, 0.02])