kacperkerszen / financial-funtions

This repository contains Python functions for financial analysis and loan management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

financial-funtions

This repository contains Python functions for financial analysis and loan management. The investment_assessment function evaluates the profitability of investments by computing metrics. Meanwhile, the annuity_installment function helps manage annuity loans by generating repayment schedules.

investment_assessment function

Function Explanation:

The investment_assessment function calculates the net present value (NPV), internal rate of return (IRR), and profitability index (PI) of an investment based on cash flows, bank interest rate, inflation rate, risk premium, and time period.

  • Net Present Value (NPV): NPV represents the difference between the present value of cash inflows and outflows over a period of time, discounted at a specified rate. It measures the profitability of an investment by considering the time value of money. Internal Rate of Return (IRR):
  • IRR is the discount rate at which the net present value of cash flows equals zero. It represents the effective annual rate of return generated by an investment.
  • Profitability Index (PI): PI is the ratio of the present value of future cash flows to the initial investment. It indicates the return per unit of investment and is used to evaluate the profitability of a project.

Instructions:

  • Define the cash flows for each period of the investment.
  • Enter the bank interest rate (as a decimal), inflation rate (as a decimal), and risk premium (as a decimal).
  • Run the code to calculate the investment assessment metrics.

annuity_installment function

Function Explanation:

The annuity_installment function calculates the installment repayment scheme for an annuity loan, considering various parameters such as the initial debt amount, interest rates, time splits, additional fees, fixed installment parts, and overpayments.

  • Debt Amount: The initial amount of debt that needs to be repaid.
  • Interest Rate: An interest rate or a list of interest rates for each time split (e.g., year). If a single interest rate is provided, it is assumed to be constant over time.
  • Time Splits: The number of time splits, representing the duration over which the debt will be repaid (e.g., years).
  • Fee: An additional fee as a percentage of the initial debt amount, if applicable.
  • Fixed Part: A boolean indicating whether there is a fixed part of the installment. If True, the installment includes both interest and a fixed capital part. If False, the installment is calculated using the standard annuity formula.
  • Overpay: An optional additional amount overpaid with each installment.

Instructions:

  • Enter the initial amount of debt, number of time splits, and any additional fee as a percentage of the initial debt amount (if applicable).
  • Specify whether there is a fixed part of the installment by entering y or n.
  • If there is a fixed part, provide the interest rates for each time split (e.g., for each year).
  • If there is no fixed part, enter the annual interest rate as a percentage.
  • Optionally, enter any additional amount overpaid with each installment.
  • Run the code to calculate the installment repayment scheme.

About

This repository contains Python functions for financial analysis and loan management.


Languages

Language:Jupyter Notebook 100.0%