Financial Calculations & Valuation
Beginner
Retail Loan FOIR (Fixed Obligation to Income Ratio) & Max Loan Eligibility Calculator in Python
Calculate Fixed Obligation to Income Ratio (FOIR), maximum permissible EMI, and eligible Personal/Home Loan principal in Python based on net monthly salary.
#numpy
Problem Statement
Retail lending underwriting engines assess a borrower's repayment capacity using FOIR (typically 50% to 65% of net take-home salary) after deducting existing active EMIs shown on the credit bureau report.
Formula / Core Logic
Max_Allowable_EMI = (Net_Monthly_Income * Max_FOIR_Pct) - Existing_EMIs
Max_Loan_Principal = Max_Allowable_EMI * [((1 + r)^n - 1) / (r * (1 + r)^n)]
Installation
pip install numpy
retail-loan-foir-eligibility-underwriting-calculator-python.py
def calculate_foir_loan_eligibility(net_monthly_income, existing_emis, annual_interest_rate, tenure_months, max_foir_pct=0.55):
max_total_obligation = net_monthly_income * max_foir_pct
available_emi_capacity = max(0.0, max_total_obligation - existing_emis)
r = (annual_interest_rate / 100.0) / 12.0
if r > 0 and available_emi_capacity > 0:
pv_factor = (((1 + r) ** tenure_months) - 1) / (r * ((1 + r) ** tenure_months))
max_loan_amount = available_emi_capacity * pv_factor
else:
max_loan_amount = available_emi_capacity * tenure_months
current_foir = (existing_emis / net_monthly_income) * 100 if net_monthly_income > 0 else 100.0
return {
'Current_FOIR_Pct': round(current_foir, 2),
'Max_New_EMI_Capacity': round(available_emi_capacity, 2),
'Max_Eligible_Loan_Amount': round(max_loan_amount, 0)
}
Get the Complete 100+ Python Quant & Automation Bundle
Instant lifetime access to all production-ready scripts, valuation models, and trading bots ($19).
Buy Full Bundle on Gumroad ($19) →Frequently Asked Questions
Q: Are credit card minimum due amounts included in Existing Obligations?
Yes, credit underwriting policies typically include 5% of total revolving credit card outstanding as a monthly obligation.