[][src]Module finance_solution::present_value

Present value calculations. Given a final amount, a number of periods such as years, and fixed or varying interest rates, what is the current value?

For most common usages, we recommend the present_value_solution function to provide a better debugging experience and additional features.

If you have a more complicated use case which has varying rates per period, use the present_value_schedule_solution function.

Formulas

Simple Compounding

With simple compound interest, the present value is calculated with:

Or using some more usual variable names:

n is often used for the number of periods, though it may be t for time if each period is assumed to be one year as in continuous compounding. r is the periodic rate, though this may appear as i for interest.

Throughout this crate we use pv for present value and fv for future value. You may see these values called P for principal in some references.

Within the TvmSolution struct we record the formula used for the particular calculation using both concrete values and symbols. For example if we calculated the present value of an investment that grows by 1.5% per month for 48 months using simple compounding and reaches a future value of $50,000 the solution struct would contain these fields:

formula: "24468.0848 = 50000.0000 / (1.015000 ^ 48)",
symbolic_formula: "pv = fv / (1 + r)^n",

Continuous Compounding

With continuous compounding the formula is:

or:

With continuous compounding the period is assumed to be years and t (time) is often used as the variable name. Within this crate we stick with n for the number of periods so that it's easier to compare formulas when they're printed as simple text as part of the TvmSolution struct. Taking the example above but switching to continuous compounding the struct would contain these fields:

formula: "24337.6128 = 50000.0000 / 2.718282^(0.015000 * 48)",
symbolic_formula: "pv = fv / e^(rt)",

Functions

present_value

Returns the current value of a future amount using a fixed rate.

present_value_schedule

Calculates a present value based on rates that change for each period.

present_value_schedule_solution

Calculates a present value based on rates that change for each period and returns a struct with the inputs and the calculated value.

present_value_solution

Calculates the current value of a future amount using a fixed rate and returns a struct with the inputs and the calculated value. This is used for keeping track of a collection of financial scenarios so that they can be examined later.