Class DividendTable

Inheritance Relationships

Base Type

Class Documentation

class DividendTable : public otyca::Scatter<Dividend>

A class representing a table of Dividends indexed by time to Dividend, inheriting from Scatter<Dividend>.

The DividendTable class is used to handle and process dividend data in pricing. It supports functions for calculating fixed present value, yields, adapting to given time grid, and checking equality between tables, etc.

Public Functions

double fixed_present_value(double countinous_compounding_rate, double reference_time, double timel, double timeu) const

< Inherit constructor from Scatter<Dividend>

Calculates the fixed present value of dividends over a specific time interval.

Parameters:
  • countinous_compounding_rate – The countinous compounding interest rate.

  • reference_time – The reference time to which the values are discounted to.

  • timel – The lower bound of the time interval.

  • timeu – The upper bound of the time interval.

Returns:

The present value of all fixed dividends between timel and timeu.

double yield(double timel, double timeu) const

Calculates the total yield of proportional dividends over a specific time interval.

Parameters:
  • timel – The lower bound of the time interval.

  • timeu – The upper bound of the time interval.

Returns:

The total yield of proportional dividends between timel and timeu.

void adapt_grid(int nt, const double *timegrid, double *fixed_grid, double *proportional_grid, double *divtgrid) const

Adapts to a given time grid.

Parameters:
  • nt – The number of time grid points.

  • timegrid – The input time grid.

  • fixed_grid – The output grid for fixed amount values.

  • proportional_grid – The output grid for proportional amount values.

  • divtgrid – The output grid for dividend time points.

void allocate_fixed(double countinous_compounding_rate, double far_time, double &neara, double &fara, double &nearat, double &farat) const

Allocates fixed values for all the dividends between near (time 0) and far.

Parameters:
  • countinous_compounding_rate – The continuous compounding rate.

  • far_time – The far time for the allocation.

  • neara – The total near allocation of all fixed dividends.

  • fara – The total far allocation of all fixed dividends.

  • nearat – The total near allocation of the products of fixed amount and dividend time.

  • farat – The total far allocation of the products of fixed amount and dividend time.

double fixed_present_value_t(double countinous_compounding_rate, double reference_time, double timel, double timeu) const

Calculates the present value of the products of fixed dividend amount and time over a specific time interval.

Parameters:
  • countinous_compounding_rate – The continuous compounding interest rate.

  • reference_time – The reference time to which the values are discounted to.

  • timel – The lower bound of the time interval.

  • timeu – The upper bound of the time interval.

Returns:

The total present value of the products of fixed dividends and dividend time between timel and timeu.

bool finite() const

Checks if the dividend table is finite.

Returns:

True if the entire table is finite, false otherwise.

bool equal(const DividendTable &other, double epsilon = std::numeric_limits<double>::epsilon()) const

Checks if the current dividend table is equal to another one, within an optional epsilon tolerance.

Parameters:
  • other – The other dividend table to compare against.

  • epsilon – The tolerance for equality comparison (default is std::numeric_limits<double>::epsilon()).

Returns:

True if the tables are equal within the given epsilon, false otherwise.