Class FinancialMath
java.lang.Object
org.episteme.social.economics.FinancialMath
Utility class for financial mathematics.
Includes Net Present Value (NPV), Future Value (FV), and Amortization
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionstatic MoneycalculateFutureValue(Money presentValue, Real rate, int periods) Calculates the Future Value (FV) of an investment.static MoneycalculateMonthlyPayment(Money principal, Real annualRate, int years) Calculates monthly mortgage payment (Amortization).static MoneycalculateNPV(Real rate, Money... cashFlows) Calculates the Net Present Value (NPV) of a series of cash flows.
-
Method Details
-
calculateFutureValue
Calculates the Future Value (FV) of an investment. FV = PV * (1 + r)^n- Parameters:
presentValue- The current value (PV).rate- The interest rate per period (r) as a decimal (e.g. 0.05 for 5%).periods- The number of periods (n).- Returns:
- The future value.
-
calculateNPV
-
calculateMonthlyPayment
Calculates monthly mortgage payment (Amortization). M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]- Parameters:
principal- The loan amount (P).annualRate- The annual interest rate.years- The loan term in years.- Returns:
- The monthly payment.
-