diff --git a/docs/glossary.rst b/docs/glossary.rst index dba95a2..7905bf7 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -1,3 +1,43 @@ ======================== Glossary -======================== \ No newline at end of file +======================== + +.. glossary:: + + accumulation function + A function that describes how much as single unit of currency grows over time. It is a special case of the amount function, where the amount invested is restricted to be one unit of currency. + + amount function + A function that describes how much an invested amount of money grows over time. + + compound interest + A geometric pattern of money growth in which interest earned is reinvested at the rate of interest. + + discount + The amount of money that must be paid up front on a loan. + + effective rate of interest + A measurement of money growth equal to the percentage change in the value of an investment between two time periods: + + .. math:: + + i_{[t_1, t_2]} = \frac{a(t_2) - a(t_1)}{a(t_1)} + + growth + The change in the value of money over time. + + interest earned + A measurement of money growth equal to the change in the value of an investment between two time periods: + + .. math:: + + A_K(t_2) - A_K(t_1). + + principal + (1) An initial investment of money. + (2) The original amount of a loan that must be paid back. + + simple interest + A linear pattern of money growth in which interest earned is a fixed amount per time period. + + diff --git a/docs/usage/growth/accumulation.rst b/docs/usage/growth/accumulation.rst index 1851086..ae726d8 100644 --- a/docs/usage/growth/accumulation.rst +++ b/docs/usage/growth/accumulation.rst @@ -2,7 +2,7 @@ Accumulation Functions ======================== -The accumulation function is a special case of the amount function where :math:`K=1`: +The :term:`accumulation function` is a special case of the amount function where :math:`K=1`: .. math:: a(t) = A_1(t) @@ -18,14 +18,14 @@ The amount and accumulation functions are often related by the following express Examples ======================== -TmVal's **Accumulation** class models accumulation functions. +TmVal's ``Accumulation`` class models accumulation functions. Suppose money exhibits a quadratic growth pattern, specified by the amount function: .. math:: a(t) = .05t^2 + .05t + 1 -How much does $1 invested at time 0 grow to at time 5? To solve this problem, we import the Accumulation class, supply the growth function in a similar manner as we had done with the Amount class, except we do not need to supply a value for :math:`K`. +How much does $1 invested at time 0 grow to at time 5? To solve this problem, we import the ``Accumulation class``, supply the growth function in a similar manner as we had done with the ``Amount`` class, except we do not need to supply a value for :math:`K`. .. ipython:: python @@ -38,7 +38,7 @@ How much does $1 invested at time 0 grow to at time 5? To solve this problem, we print(my_acc.val(5)) -Note that we could have also solved this problem with the Amount class, by setting :math:`K=1`. +Note that we could have also solved this problem with the ``Amount`` class, by setting :math:`K=1`. .. ipython:: python @@ -51,7 +51,7 @@ Note that we could have also solved this problem with the Amount class, by setti print(my_amt.val(5)) -If the amount and accumulation functions are proportionally related, we can extract the accumulation function from the Amount class by calling the **get_accumulation()** method, which returns an Accumulation class derived from the Amount class: +If the amount and accumulation functions are proportionally related, we can extract the accumulation function from the ``Amount`` class by calling the ``get_accumulation()`` method, which returns an ``Accumulation`` class derived from the ``Amount`` class: .. ipython:: python diff --git a/docs/usage/growth/amount.rst b/docs/usage/growth/amount.rst index 534aadc..2173738 100644 --- a/docs/usage/growth/amount.rst +++ b/docs/usage/growth/amount.rst @@ -4,7 +4,7 @@ Amount Functions Although we have introduced the familiar cases of simple and compound interest, not all growth patterns are linear or geometric. Sometimes a growth pattern might be geometric, cubic, or some arbitrary user-defined pattern. -To accommodate these new patterns, we can define an **amount function**, which specifies how money grows for an arbitrary growth pattern: +To accommodate these new patterns, we can define an :term:`amount function`, which specifies how money grows for an arbitrary growth pattern: .. math:: A_K(t) @@ -21,7 +21,7 @@ Suppose money exhibits a quadratic growth pattern, specified by the amount funct If we invest :math:`K=5` at time 0, how much does it grow to at time 5? -TmVal's *Amount* class allows us to model this behavior. To solve the above problem, simply call the class and supply the growth function and principal. First, define the growth function as a Python function that takes the time and principal as arguments: +TmVal's ``Amount`` class allows us to model this behavior. To solve the above problem, simply call the class and supply the growth function and principal. First, define the growth function as a Python function that takes the time and principal as arguments: .. ipython:: python @@ -30,7 +30,7 @@ TmVal's *Amount* class allows us to model this behavior. To solve the above prob def f(t, k): return k * (.05 * (t **2) + .05 * t + 1) -Now supply the growth_function to the Amount class, and call :code:`my_amt.val(5)` to get the answer: +Now supply the growth function to the ``Amount`` class, and call :code:`my_amt.val(5)` to get the answer: .. ipython:: python diff --git a/docs/usage/growth/compound.rst b/docs/usage/growth/compound.rst index 687027b..6171878 100644 --- a/docs/usage/growth/compound.rst +++ b/docs/usage/growth/compound.rst @@ -2,7 +2,7 @@ Compound Interest ======================== -Compound interest is a pattern of money growth in which the value of money increases at a geometric rate: +:term:`Compound interest` is a pattern of money growth in which the value of money increases at a geometric rate: .. math:: @@ -20,7 +20,7 @@ For quantities of money larger than dollar, we can express growth as: A_K(t) = K(1 + i)^t -Where :math:`K` refers to the initial amount, or **principal**. For example, if we start with $5 and an interest rate of 5%, it should grow to $5.5125 after two years: +Where :math:`K` refers to the initial amount, or :term:`principal`. For example, if we start with $5 and an interest rate of 5%, it should grow to $5.5125 after two years: .. math:: @@ -29,7 +29,7 @@ Where :math:`K` refers to the initial amount, or **principal**. For example, if Examples ======================== -Let's repeat the above examples using the TmVal package. Let's start by importing CompoundAmt, which is a class that can be used for compound interest calculations: +Let's repeat the above examples using the TmVal package. Let's start by importing ``CompoundAmt``, which is a class that can be used for compound interest calculations: .. ipython:: python @@ -52,7 +52,7 @@ Now, let's change the principal to $5: The output is 5.5125, the same as above. -TmVal also comes with a compound interest solver that can be used to solve for missing inputs. For example, what rate of interest would give us $5.5125, if we held $5 for two years? +TmVal also comes with a compound interest solver, ``compound_solver()``, that can be used to solve for missing inputs. For example, what rate of interest would give us $5.5125, if we held $5 for two years? .. ipython:: python diff --git a/docs/usage/growth/interest.rst b/docs/usage/growth/interest.rst index 90c1e9a..aaa868c 100644 --- a/docs/usage/growth/interest.rst +++ b/docs/usage/growth/interest.rst @@ -2,13 +2,13 @@ Interest ======================== -Suppose we invest :math:`K` at time 0. We define the amount of interest earned between times :math:`t_1` and :math:`t_2` as: +Suppose we invest :math:`K` at time 0. We define the amount of :term:`interest earned` between times :math:`t_1` and :math:`t_2` as: .. math:: A_K(t_2) - A_K(t_1). -We define the effective rate of interest for the interval as: +We define the :term:`effective rate of interest` for the interval as: .. math:: @@ -28,14 +28,14 @@ To examine the effective interest rate for a single time period, the :math:`n`-t Examples ======================== -We can use the **Amount** class to make various interest calculations. For example, assume the following amount function: +We can use the ``Amount`` class to make various interest calculations. For example, assume the following amount function: .. math:: A_K(t) = K(.02t^2 + .02t + 1) If we invest $5 at time 0, What is the interest earned during the 5th time period? -First lets set up our Amount instance: +First lets set up our ``Amount`` instance: .. ipython:: python @@ -46,7 +46,7 @@ First lets set up our Amount instance: my_amt = Amount(f=f, k=5) -We can use the Amount class's **interest_earned()** method to get the answer: +We can use the ``Amount`` class's ``interest_earned()`` method to get the answer: .. ipython:: python @@ -54,7 +54,7 @@ We can use the Amount class's **interest_earned()** method to get the answer: print(interest) -What is the effective interest rate during the 5th time period? We can use the Amount class's **effective_rate()** method to get the answer: +What is the effective interest rate during the 5th time period? We can use the ``Amount`` class's ``effective_rate()`` method to get the answer: .. ipython:: python @@ -62,7 +62,7 @@ What is the effective interest rate during the 5th time period? We can use the A print(eff_interest_rate_amt) -We can also use the **effective_interval()** method to find the effective rate over a longer interval, say from times 1 to 5: +We can also use the ``effective_interval()`` method to find the effective rate over a longer interval, say from times 1 to 5: .. ipython:: python @@ -70,7 +70,7 @@ We can also use the **effective_interval()** method to find the effective rate o print(eff_interval_rate_amt) -TmVal's **Accumulation** class is a subclass of the **Amount** class. This means that many of the methods that can be used from the Amount class can also be used by the Accumulation class. +TmVal's ``Accumulation`` class is a subclass of the ``Amount`` class. This means that many of the methods that can be used from the ``Amount`` class can also be used by the ``Accumulation`` class. Assuming proportionality, we can define an amount function from an accumulation function and then get the effective interest rate for the 5th interval. It should be the same answer as that achieved from the amount function: @@ -86,4 +86,4 @@ Assuming proportionality, we can define an amount function from an accumulation print(math.isclose(eff_interest_rate_acc, eff_interest_rate_amt, rel_tol=.0001)) -Note that there is some loss of precision due to floating point operations, so we use **isclose()** from the **math** library for the comparison. \ No newline at end of file +Note that there is some loss of precision due to floating point operations, so we use ``isclose()`` from the ``math`` library for the comparison. \ No newline at end of file diff --git a/docs/usage/growth/reminder.rst b/docs/usage/growth/reminder.rst index 1eebd46..86c31a4 100644 --- a/docs/usage/growth/reminder.rst +++ b/docs/usage/growth/reminder.rst @@ -2,9 +2,9 @@ A Friendly Reminder ======================== -If you have read the last couple sections on accumulation and amount functions, you may wonder why we have to define a growth function prior to defining an Amount or Accumulation class. After all, this seems cumbersome and it would be more convenient to simply create an Amount or Accumulation class by specifying an interest rate. +If you have read the last couple sections on accumulation and amount functions, you may wonder why we have to define a growth function prior to defining an ``Amount`` or ``Accumulation`` class. After all, this seems cumbersome and it would be more convenient to simply create an ``Amount`` or ``Accumulation`` class by specifying an interest rate. -The good news is, we can actually do this! If you recall at the beginning of the tutorial, TmVal provided a pair of classes called :code:`CompoundAmt` and :code:`CompoundAcc`. These are subclasses of the Amount and Accumulation classes, respectively, and can be called without having to specify a separate growth function, and have access to the methods in their parent classes. +The good news is, we can actually do this! If you recall at the beginning of the tutorial, TmVal provided a pair of classes called ``CompoundAmt`` and ``CompoundAcc``. These are subclasses of the Amount and Accumulation classes, respectively, and can be called without having to specify a separate growth function, and have access to the methods in their parent classes. For example, if money grows at a compound rate of 5%, we can define an accumulation class with a single argument, and see what value it accumulates to after 5 years: @@ -16,6 +16,6 @@ For example, if money grows at a compound rate of 5%, we can define an accumulat print(my_acc.val(5)) -In the case of simple interest, TmVal offers the companion classes, :code:`SimpleAmt` and :code:`SimpleAcc`. +In the case of simple interest, TmVal offers the companion classes, ``SimpleAmt`` and ``SimpleAcc``. -The :code:`Amount` and :code:`Accumulation` classes are for generalized cases that cannot be handled by the compound and simple classes. In these cases, you can define your own growth pattern. \ No newline at end of file +The ``Amount`` and ``Accumulation`` classes are for generalized cases that cannot be handled by the compound and simple classes. In these cases, you can define your own growth pattern. \ No newline at end of file diff --git a/docs/usage/growth/simple.rst b/docs/usage/growth/simple.rst index 2519f77..207ba27 100644 --- a/docs/usage/growth/simple.rst +++ b/docs/usage/growth/simple.rst @@ -1,7 +1,7 @@ ======================== Simple Interest ======================== -Simple interest is a pattern of money growth in which the value of money increases at a linear rate: +:term:`Simple interest` is a pattern of money growth in which the value of money increases at a linear rate: .. math:: @@ -19,7 +19,7 @@ For quantities of money larger than dollar, we can express growth as: A_K(t) = K(1 + st) -Where :math:`K` refers to the initial amount, or **principal**. For example, if we start with $5 and an interest rate of 5%, it should grow to $5.25 after one year: +Where :math:`K` refers to the initial amount, or :term:`principal`. For example, if we start with $5 and an interest rate of 5%, it should grow to $5.25 after one year: .. math:: @@ -28,7 +28,7 @@ Where :math:`K` refers to the initial amount, or **principal**. For example, if Examples ======================== -Let's repeat the above examples using the TmVal package. Let's start by importing SimpleAmt, which is a class that can be used for simple interest calculations: +Let's repeat the above examples using the TmVal package. Let's start by importing ``SimpleAmt``, which is a class that can be used for simple interest calculations: .. ipython:: python @@ -51,7 +51,7 @@ Now, let's change the principal to $5: The output is 5.25, the same as above. -TmVal also comes with a simple interest solver that can be used to solve for missing inputs. For example, what rate of interest would give us $5.25, if we held $5 for a year? +TmVal also comes with a simple interest solver, ``get_simple_amt()`` that can be used to solve for missing inputs. For example, what rate of interest would give us $5.25, if we held $5 for a year? .. ipython:: python diff --git a/docs/usage/growth/tiered.rst b/docs/usage/growth/tiered.rst index 17a393a..799bc8d 100644 --- a/docs/usage/growth/tiered.rst +++ b/docs/usage/growth/tiered.rst @@ -39,7 +39,7 @@ TmVal's :code:`TieredBal` class offers a way to model this type of account. You rates=[.01, .02, .03] ) -:code:`TieredBal` is a growth pattern that can be supplied to the :code:`Amouunt` class, which you can then use to access its methods. If we invest 18000 today, to what value does it grow after 10 years? +:code:`TieredBal` is a growth pattern that can be supplied to the :code:`Amount` class, which you can then use to access its methods. If we invest 18000 today, to what value does it grow after 10 years? .. ipython:: python