gic_calculator.gic_difference

Module Contents

Functions

calculate_gic_difference(term_length_n1, ...[, ...])

Calculate and return the difference in total returns between two GIC (Guaranteed Investment Certificate) investment periods.

gic_calculator.gic_difference.calculate_gic_difference(term_length_n1, term_length_n2, principal, interest_rate1=None, interest_rate2=None)[source]

Calculate and return the difference in total returns between two GIC (Guaranteed Investment Certificate) investment periods.

This function computes the total returns (both interest and principal) for two distinct GIC investment periods, using different or identical annual interest rates for each period. It then calculates the difference in these total returns, effectively comparing the profitability of the two investment periods.

Parameters:

term_length_n1int

The duration in days or years of the first investment period. A list of the term length (duration) per each investment. To be one of the following standard options: 90, 180, 270, 1, 1.5, 2, 3, or 5 correspond to 90 days, 180 days, 270 days, 1 year, 1.5 years, 2 years, 3 years, 5 years.

term_length_n2int

The duration in days or years of the second investment period. A list of the term length (duration) per each investment. To be one of the following standard options: 90, 180, 270, 1, 1.5, 2, 3, or 5 correspond to 90 days, 180 days, 270 days, 1 year, 1.5 years, 2 years, 3 years, 5 years.

principalfloat

The initial amount of money invested in both periods.

interest_rate1float, optional

Annual interest rate (in percentage) for the first period. If not provided, a default value defined in interest_calc is used.

interest_rate2float, optional

Annual interest rate (in percentage) for the second period. If not provided, it assumes the same rate as interest_rate1 or the default from interest_calc.

Returns:

float :

The difference in the total returns (sum of interest and principal) between the two investment periods.

Example:

>>> difference = calculate_gic_difference(5, 10, 1000, 2.5, 3.0)
>>> print(f"Difference in GIC returns between 5 and 10 years: ${difference:.2f}")