Commercial Lending Portfolio Analysis

Diagnose Portfolio Yield Compression
Before It Erodes Your Margins

A data-driven yield decomposition framework that separates payoff selection effects from true pricing compression, revealing a 17 bps forward pipeline gap concentrated in CRE lending.

Yield Analytics Mix-Rate Decomposition Portfolio Strategy Interactive
0
Loans Analyzed
0 bps
Portfolio Weighted Spread
-0 bps
Pipeline Gap
$0B+
Total Portfolio Balance

The Problem

Leadership noticed portfolio yield appeared to be declining and asked: "Is our portfolio yield compressing, and if so, what's driving it?" The answer required separating genuine pricing pressure from compositional effects and natural portfolio turnover.

My Approach

Rather than accepting the premise at face value, I built a yield decomposition framework that isolates mix effects (changing segment weights) from rate effects (within-segment pricing changes), while accounting for payoff selection bias in the active portfolio.

Discovery Framework

Before touching data, I identified the key business questions that would shape the analysis.

Defining "Yield"

  • Is spread (bps) the primary yield metric?
  • How are origination fees factored into all-in yield?
  • Which benchmark index is referenced?

Understanding Growth

  • Is balance growth from new originations, drawdowns, or renewals?
  • Is growth concentrated in specific segments?
  • How does mix shift affect aggregate metrics?

Strategic Intent

  • Is the bank deliberately accepting lower spreads to grow?
  • Should success be measured differently for strategic segments?
  • Are there relationship pricing considerations?

Sustainability

  • What's the maturity schedule for high-spread legacy loans?
  • Are there prepayment patterns in specific segments?
  • Has credit quality shifted across vintages?

Analytical Approach

A structured five-step framework to diagnose yield dynamics.

01

Validate the Premise

Calculate portfolio-level spread (simple average vs balance-weighted) across all vintages to determine if yield is actually declining.

02

Segment & Decompose

Slice by segment, risk rating, and vintage. Decompose aggregate changes into mix effects vs within-segment rate effects.

03

Examine Payoff Patterns

Compare spread of paid-off loans to active portfolio to identify survivorship/selection bias in portfolio yield.

04

Assess Forward Pipeline

Benchmark pipeline spreads against existing portfolio by segment to quantify expected forward compression.

05

Synthesize & Recommend

Combine findings into actionable recommendations for portfolio management and pricing strategy.

Yield Decomposition Results

Interactive analysis of portfolio yield dynamics across segments, vintages, and cohorts.

Balance-Weighted Spread by Vintage

Comparing simple average vs balance-weighted average spread across origination years.

Spreads at origination remain stable (268-278 bps) across all vintages — there is no clear downward trend at the point of origination.

Spread Distribution by Segment

Box plots showing the spread range, median, and quartiles for each lending segment.

CRE shows the widest spread range and highest median, while "Other" has the tightest distribution at lower spreads.

Active vs Paid-Off Loan Comparison

Comparing average spread of loans that have paid off vs those still active in the portfolio.

Paid-off loans averaged ~278 bps vs ~268 bps for active — a ~10 bps payoff selection effect. Higher-spread loans are exiting the portfolio, mechanically dragging down the active portfolio average.

Portfolio Composition by Vintage

How segment mix has shifted across origination years (% of balance).

Segment mix varies across vintages, but no dramatic shift toward lower-spread segments — confirming that mix effects are modest.

Segment × Vintage Heatmap

Balance-weighted spread by segment and origination year. Darker green = higher spread.

Note: Small cell sizes (2-3 loans) in some segment-vintage combinations limit granular conclusions. Aggregate patterns are more reliable.

Pipeline vs Portfolio Gap by Segment

Side-by-side comparison of current portfolio spreads vs expected pipeline spreads.

CRE pipeline gap of -35 bps is the most significant concern. Healthcare is stable (-1 bps). Overall pipeline weighted spread of 260 bps is 17 bps below portfolio.

Mix Effect vs Rate Effect Decomposition

Breaking down the portfolio-to-pipeline spread change into compositional (mix) and pricing (rate) components.

The -17 bps total gap is dominated by rate effects (-15 bps) vs mix effects (-1 bps). The compression is primarily a pricing phenomenon, not a shift in segment allocation.

Spread by Risk Rating

How spreads vary across the internal risk rating scale (S200 = lowest risk, S400 = highest).

Clear positive relationship between risk rating and spread — higher risk grades command wider spreads, as expected for risk-appropriate pricing.

Pipeline Analysis by Stage

Pipeline deals grouped by stage (Early, Mid, Late) with spread and balance metrics.

18 of 40 pipeline deals are Early stage, introducing uncertainty. Outlier deal P004 (CRE, $18.1M, 70 bps) significantly impacts CRE pipeline averages.

Executive Summary

Key findings and actionable recommendations for portfolio management.

Segment Portfolio Spread Pipeline Spread Gap Portfolio Share

Key Findings

Recommendations

Yield Explorer

Filter the portfolio by segment, vintage, and risk rating. Explore what-if scenarios for pipeline impact.

Loans
--
Weighted Spread
--
Total Balance
--
Avg Spread
--
vs Pipeline
--

What-If Scenario

Adjust sliders to see how portfolio yield changes under different assumptions.

Projected Portfolio Spread
--
Change from Current
--
Projected Balance
--

Data Limitations & Methodology

Intellectual honesty about what the data can and cannot tell us.

Small Sample Size

120 loans across 5 vintages and 4 segments means some segment-vintage cells contain only 2-3 loans. Aggregate patterns are more reliable than granular cuts.

Point-in-Time Snapshot

Current balance only — no time-series of how balances evolved. Cannot track drawdown patterns or amortization schedules over time.

Missing Rate Type

No fixed vs variable rate indicator. Spread dynamics may differ significantly between fixed and floating-rate facilities.

Pipeline Uncertainty

18 of 40 pipeline deals are Early stage. Historical close rates by stage would significantly improve forward yield projections.

Outlier Impact

Deal P004 (CRE, $18.1M, 70 bps) is 150+ bps below the next CRE pipeline deal. This single deal materially impacts CRE pipeline averages and needs validation.

Balance Weighting

All portfolio-level metrics use current balance weighting. Simple averages are shown alongside for comparison. Decomposition uses standard shift-share methodology.

Technical Stack

Tools and frameworks powering this analysis.

Data & Features

120-loan portfolio dataset with 40-deal pipeline across 4 segments, 6 risk grades, and 5 vintage years.

Python Pandas NumPy OpenPyXL

Analysis Framework

Balance-weighted yield decomposition using shift-share methodology. Mix-vs-rate attribution across segments.

Yield Decomposition Shift-Share Cohort Analysis

Visualization & Engineering

Interactive Plotly.js charts with custom dark theme. Static site with pre-generated JSON data pipeline.

Plotly.js HTML/CSS/JS Responsive Design

About This Project

The goal was not just to analyze yield, but to tell a clear credit risk story — separating noise from signal in portfolio performance data and providing actionable recommendations backed by rigorous decomposition analysis.

This project demonstrates the ability to take an ambiguous business question ("Is our yield declining?"), structure an analytical framework, perform rigorous quantitative analysis, and deliver actionable insights — exactly the kind of thinking commercial lending teams need.

This analysis uses an anonymized sample dataset for demonstration purposes. All company-identifying information has been removed. Results are directional given the sample size.

YieldLens AI Assistant

Hi! I can answer questions about this yield decomposition analysis, commercial lending concepts, or portfolio analytics. What would you like to know?

Enter your Gemini API key in the settings to enable AI responses

AI Assistant Settings