Year-on-year rate changes by calendar year, for on-leveling historical data.
Each entry is the change factor for a year (e.g. 1.05 for +5%), not an index level. For an index level series (TIV, CPI, ...) use CalendarYearLevels instead.
The factor labelled with year Y is the change from year Y - 1 to year Y. Hence a value from year Y is on-levelled to the current year by multiplying the factors of years Y + 1 to currentYear inclusive, and the earliest year that can be fully on-levelled is earliestYear - 1.
Value parameters
- currentYear
-
The current/reference year (period 0). Must equal
years.head. - factors
-
Array of change factors corresponding to each year. All factors must be strictly positive. The constructor is private: the companion
applymethods defensively copy the input arrays, so mutating the arrays passed in cannot bypass validation or desynchronise the cached cumulative factors. - years
-
Array of contiguous years in descending order (most recent first), i.e.
years(i) == currentYear - i. Use the companionapply(years, factors)to construct from years in any order.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Calculate the cumulative on-leveling factor from a historical year to the current year.
Calculate the cumulative on-leveling factor from a historical year to the current year.
Years after currentYear return 1.0.
Value parameters
- fromYear
-
The historical year
Attributes
- Returns
-
The cumulative factor to on-level from that year to current
- Throws
-
IllegalArgumentException
if
fromYearis earlier than earliestOnLevelYear - the index does not cover it. Use the overload with afallbackFactorto extrapolate.
Calculate the cumulative on-leveling factor from a historical year to the current year, extrapolating with a constant fallbackFactor per year for any years before those covered by the index.
Calculate the cumulative on-leveling factor from a historical year to the current year, extrapolating with a constant fallbackFactor per year for any years before those covered by the index.
Value parameters
- fallbackFactor
-
The factor applied for each year earlier than earliestOnLevelYear (e.g. 1.05 for 5% per year)
- fromYear
-
The historical year
Attributes
The earliest data year which can be on-levelled using only the factors in this index.
The earliest data year which can be on-levelled using only the factors in this index.
Attributes
The earliest year covered
The earliest year covered
Attributes
Checks whether this instance is equal to that. This universal equality method is defined in AnyRef.
Checks whether this instance is equal to that. This universal equality method is defined in AnyRef.
Attributes
- Definition Classes
-
Equals -> Any
Get the change factor for a specific year.
Get the change factor for a specific year.
Value parameters
- year
-
The calendar year
Attributes
- Returns
-
The change factor for that year
- Throws
-
NoSuchElementException
if year is not in the index
Calculates a hash code value for the object.
Calculates a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.
Attributes
- Returns
-
the hash code value for this object.
- Definition Classes
-
Any
The latest year covered (always equals currentYear)
The latest year covered (always equals currentYear)
Attributes
Number of years covered by this index
Number of years covered by this index
Attributes
On-level a single value from fromYear to the current year.
On-level a single value from fromYear to the current year.
Prefer named arguments - an Int value silently widens to Double, so swapping the arguments compiles:
idx.onLevel(value = 1.0, fromYear = 2023)
Value parameters
- fromYear
-
The calendar year of the value
- value
-
The historical value, in
fromYearterms
Attributes
- Returns
-
The value in current-year terms
- Throws
-
IllegalArgumentException
if
fromYearis earlier than earliestOnLevelYear
On-level a single value from fromYear to the current year, extrapolating with fallbackFactor per year if fromYear is earlier than the index covers.
On-level a single value from fromYear to the current year, extrapolating with fallbackFactor per year if fromYear is earlier than the index covers.
idx.onLevel(value = 1.0, fromYear = 2015, fallbackFactor = 1.09)
Attributes
Apply on-leveling to an array of values, given their corresponding years.
Apply on-leveling to an array of values, given their corresponding years.
Value parameters
- fromYears
-
The calendar year for each value (same length as values)
- values
-
The historical values to on-level
Attributes
- Returns
-
Array of on-leveled values
- Throws
-
IllegalArgumentException
if any year in
fromYearsis earlier than earliestOnLevelYear
Apply on-leveling to an array of values, extrapolating with fallbackFactor per year for data years earlier than the index covers.
Apply on-leveling to an array of values, extrapolating with fallbackFactor per year for data years earlier than the index covers.
Attributes
The reporting threshold in current-year terms, for a threshold that was set in thresholdYear.
The reporting threshold in current-year terms, for a threshold that was set in thresholdYear.
Value parameters
- reportThreshold
-
The threshold, in
thresholdYearmoney - thresholdYear
-
The year the threshold was set
Attributes
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Any
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