Per-period rate changes, for on-leveling period-based models.
Each entry is the change factor for a period (e.g. 1.05 for +5%), counted from period 0 (current) backwards. The cumulative factor which on-levels a value from a historical period to the current period is the product of the factors in between.
Value parameters
- factors
-
Array of change factors where factors(0) is the current period (period 0) and factors(n) is n periods back.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Calculate cumulative on-leveling factors for all periods up to a given period.
Calculate cumulative on-leveling factors for all periods up to a given period.
Value parameters
- upToPeriod
-
The maximum period to calculate (exclusive)
Attributes
- Returns
-
Array where result(i) is the cumulative factor from period i to current
Calculate the cumulative on-leveling factor from a historical period to the current period.
Calculate the cumulative on-leveling factor from a historical period to the current period.
This multiplies all factors from period 0 up to (but not including) the specified historical period. The result is the factor needed to bring a value from the historical period to current levels.
For example, if you have rate changes of 5% (1.05) each year for 3 years:
- factors = Array(1.05, 1.05, 1.05)
- cumulativeToCurrentFrom(0) = 1.0 (already current)
- cumulativeToCurrentFrom(1) = 1.05 (one period back, need to apply current period's change)
- cumulativeToCurrentFrom(2) = 1.05 * 1.05 = 1.1025
- cumulativeToCurrentFrom(3) = 1.05 * 1.05 * 1.05 = 1.157625
Value parameters
- fromPeriod
-
The historical period number (0 = current, positive = periods back)
Attributes
- Returns
-
The cumulative factor to on-level from that period to current
Get the change factor for a specific period.
Get the change factor for a specific period.
Value parameters
- period
-
The period number (0 = current, 1 = one period back, etc.)
Attributes
- Returns
-
The change factor for that period
- Throws
-
IndexOutOfBoundsException
if period is outside the available range
Number of periods available
Number of periods available
Attributes
Apply on-leveling to an array of values, given their corresponding period labels.
Apply on-leveling to an array of values, given their corresponding period labels.
Value parameters
- periods
-
The period label for each value (same length as values)
- values
-
The historical values to on-level
Attributes
- Returns
-
Array of on-leveled values
Inherited methods
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product