Class ImpliedVarianceTenorCalculator

Inheritance Relationships

Base Type

Class Documentation

class ImpliedVarianceTenorCalculator : public otyca::TenorCalculator

A class that calculates implied variance time based on the original time calculator.

This class extends TimeCalculator and provides functionality to calculate the fraction of the year between two given times, as well as manage the reference expiration and valuation times. It also manages a variance schedule and its associated term structure.

Public Functions

inline ImpliedVarianceTenorCalculator()

Default constructor for ImpliedVarianceTimeCalculator.

inline virtual ~ImpliedVarianceTenorCalculator()

Destructor for ImpliedVarianceTimeCalculator.

virtual double tenor(const boost::posix_time::ptime &begin, const boost::posix_time::ptime &end) const

Calculates the year fraction between two given times.

This method calculates the fraction of a year between the begin and end times provided. It uses the underlying time calculator to compute this value.

Parameters:
  • begin – The start time.

  • end – The end time.

Returns:

The year fraction between begin and end.

inline void set_original_time_calculator(std::shared_ptr<TenorCalculator> original)

Sets the original time calculator used for time computations.

This method allows setting an original time calculator, which may be used for more accurate or base calculations of time-related values.

Parameters:

original – A shared pointer to the original TimeCalculator.

inline const boost::posix_time::ptime &get_reference_expiration() const

Gets the reference expiration time.

This method returns the reference expiration time, which is a key point in the time calculations for the implied variance.

Returns:

A reference to the reference expiration time.

inline void set_reference_expiration(const boost::posix_time::ptime &reference_expiration)

Sets the reference expiration time.

This method allows setting the reference expiration time, which is used in calculating implied variance.

Parameters:

reference_expiration – The reference expiration time to set.

inline const boost::posix_time::ptime &get_valuation_time() const

Gets the valuation time.

This method returns the valuation time used for variance calculations.

Returns:

A reference to the valuation time.

inline void set_valuation_time(const boost::posix_time::ptime &valuation_time)

Sets the valuation time.

This method allows setting the valuation time, which is used in variance-related calculations.

Parameters:

valuation_time – The valuation time to set.

inline const Schedule<Estimate> &get_variance_schedule() const

Gets the variance schedule.

This method returns the schedule of variance estimates, which is used in computing the implied variance.

Returns:

A reference to the variance schedule.

inline void set_variance_schedule(const Schedule<Estimate> &vars)

Sets the variance schedule.

This method allows setting the schedule of variance estimates used for implied variance calculations.

Parameters:

vars – The variance schedule to set.