Next: , Previous: , Up: Octave Functions and Scripts   [Contents][Index]


5.12 convert_curve_rates

Function File: [rate_target conversion_type] = convert_curve_rates (valuation_date, node, rate_origin, comp_type_origin, comp_freq_origin, dcc_basis_origin, comp_type_target, comp_freq_target, dcc_basis_target)

Convert a given interest rate from one compounding type, frequency and day count convention (dcc) into another type, frequency and dcc.

The following conversion formulas are applied: (the timefactor is depending on day count convention and days between valuation_date and valuation_date + node)). Convert

 from CONT ->   SMP:    (exp(rate_origin .* timefactor_origin) -1) ...
./ timefactor_target
 from SMP ->    CONT:   ln(1 + rate_origin .* timefactor_origin) ...
./ timefactor_target
 from DISC ->   CONT:   ln(1 + rate_origin./ comp_freq_origin) ...
.* (timefactor_origin .* comp_freq_origin) ./ timefactor_target
 from CONT ->   DISC:   (exp(rate_origin .* timefactor_origin ...
./ (comp_freq_target .* timefactor_target)) - 1 ) .* comp_freq_target
 from SMP ->    DISC:   ( (1 + rate_origin .* timefactor_origin) ...
.^(1./( comp_freq_target .* timefactor_target)) -1 ) .* comp_freq_target
 from DISC ->   SMP:    ( (1 + rate_origin ./ comp_freq_origin ) ...
.^(comp_freq_origin .* timefactor_origin) -1 ) ./ timefactor_target
 from CONT ->   CONT:   rate_origin .* timefactor_origin ./ timefactor_target 
 from SMP ->    SMP:    rate_origin .* timefactor_origin ./ timefactor_target 
 from DISC ->   DISC:   ( (1 + rate_origin ./ comp_freq_origin) ...
.^((comp_freq_origin .* timefactor_origin) ./ ( comp_freq_target ...
.* timefactor_target)) -1 ) .* comp_freq_target
 

Please note: compounding_freq is only relevant for compounding type DISCRETE. Otherwise it will be neglected. During object invocation, a default value for compounding_freq is set, even it is not required. Example call:

 0.006084365 = convert_curve_rates(datenum('31-Dec-2015'),643,0.0060519888,'cont','daily',3,'simple','daily',3)
 

Input and output variables:

See also: timefactor.


Next: , Previous: , Up: Octave Functions and Scripts   [Contents][Index]