Skip to content

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 the outputSeries.

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:

  1. 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 and stdev, respectively, and N is the number of periods in the range.

  2. Replace the first random number in the series with Initial, and calculate the cumulative sum of these random numbers.

  3. When Exponentiate=true, exponentiate the cumulated series.

Example

x = Series.randomlyGrowing(qq(2020,1):qq(2030,4), [0.01, 0.02])