Compute the time factors, rates and discount factors for a
given cash flow pattern according to a given discount curve
and day count convention etc.
Pre-requirements:
- installed octave financial package
- custom functions timefactor, discount_factor, interpolate_curve,
and convert_curve_rates
Input and output variables:
- valuation_date: Structure with relevant information for
specification of the forward:
- cashflow_dates: cashflow_dates is a 1xN vector with all
timesteps of the cash flow pattern
- cashflow_values: cashflow_values is a MxN matrix with cash flow
pattern.
- spread_constant: a constant spread added to the total yield
extracted from discount curve and spread curve (can be used to spread over yield)
- discount_nodes: tmp_nodes is a 1xN vector with all timesteps of
the given curve
- discount_rates: tmp_rates is a MxN matrix with discount curve
rates defined in columns. Each row contains a specific scenario with different
curve structure
- basis: OPTIONAL: day-count convention of instrument (either
basis number between 1 and 11, or specified as string (act/365 etc.)
- comp_type: OPTIONAL: compounding type of instrument
(disc, cont, simple)
- comp_freq: OPTIONAL: compounding frequency of instrument
(1,2,3,4,6,12 payments per year)
- comp_type_curve: OPTIONAL: compounding type of curve
- basis_curve: OPTIONAL: day-count convention of curve
- comp_freq_curve: OPTIONAL: compounding frequency of curve
- interp_discount: OPTIONAL: interpolation method of discount curve
- sensi_flag: OPTIONAL: boolean variable (calculate sensitivities)
(default: linear)
- tf_vec: returns a Mx1 vector with time factors per cash flow date
- rate_vec: returns a Mx1 vector with rates per cf date
- df_vec: returns a Mx1 vector with discount factors per cf date
method)
See also: timefactor, discount_factor, interpolate_curve, convert_curve_rates.