Example: Simulating a Loan Using a Fund Element

In addition to modeling interest-bearing securities and accounts, Fund elements can be used to model loans.  This can be done in one of two ways: with the loan amount as a positive fund balance or with the loan amount as a negative fund balance.

GoldSim automatically applies the specified interest rate as a credit to a positive balance and as a debit to a negative balance.  In both cases, the nominal interest rate is specified as a positive value.

The Loan.gsm example model can be found in the can be found in the Financial Examples folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).  It demonstrates how a loan can be simulated.  The file illustrates both methods for representing a loan (modeling the loan amount as a positive fund balance and modeling the loan amount as a negative fund balance).

In this model, payments are applied as discrete monthly events (using a Discrete Change element).  The value of each payment is calculated using GoldSim’s built in "ptoa" function, which converts a present value (in this case a loan amount) to an annuity with equal monthly payments over the duration of the loan:

The payment is applied as a withdrawal if the loan is modeled as a positive balance:

and a deposit if the loan is modeled as a negative balance:

The cumulative amount of payments is tracked in the Cumulative_Payments integrator.  Cumulative interest payments are equal to the interest applied to the loan.  The principal payment is equal to the payments made less the interest paid.   The value of the loan along with cumulative interest and principal payments can then be plotted over the course of the simulation:

A close up of a map

Description automatically generated

Related Topics…

Learn more about: