RateChangesPerPeriod

vecxt_re.RateChangesPerPeriod
See theRateChangesPerPeriod companion object
case class RateChangesPerPeriod(factors: Array[Double])

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 Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

inline def cumulativeFactors(upToPeriod: Int): Array[Double]

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

inline def cumulativeToCurrentFrom(fromPeriod: Int): Double

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

inline def factorAt(period: Int): Double

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

inline def numPeriods: Int

Number of periods available

Number of periods available

Attributes

inline def onLevel(values: Array[Double], periods: Array[Int]): Array[Double]

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

def productElementNames: Iterator[String]

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
def productIterator: Iterator[Any]

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