Next: correct_correlation_matrix, Previous: compile_oct_files, Up: Octave Functions and Scripts [Contents][Index]
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: correct_correlation_matrix, Previous: compile_oct_files, Up: Octave Functions and Scripts [Contents][Index]