# Case Study: Mortgage Pipeline Hedging

Back to main page

Case study background and problem formulations

Instructions for optimization with PSG Run-File, PSG MATLAB Toolbox, PSG MATLAB Subroutines and PSG R.

PROBLEM 1: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for Standard Deviation minimization

10-fold crossvalidation
Minimize St_dev (minimizing Standard Deviation)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 0.896692 0.01 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 1a: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for Standard Deviation minimization
10-fold crossvalidation
Minimize St_dev (minimizing Standard Deviation)
subject to
Avg = 0 (constraint on the expected losses)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 1.5632522 0.01 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 2: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for Mean Absolute Deviation minimization

10-fold crossvalidation
Minimize Meanabs_dev (minimizing Mean Absolute Deviation)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 0.362483 0.01 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 2a: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for Mean Absolute Deviation minimization

10-fold crossvalidation
Minimize Meanabs_dev (minimizing Mean Absolute Deviation)
subject to
Avg = 0 (constraint on the expected losses)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 0.5664454 0.01 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 3: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for CVaR Deviation minimization
10-fold crossvalidation
Minimize Cvar_dev (minimizing 90%-CvaR deviation)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 0.4125034 0.01 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 3a: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for CVaR Deviation minimization

10-fold crossvalidation
Minimize Cvar_dev (minimizing 90%-CvaR deviation)

subject to
Avg = 0 (constraint on the expected losses)

Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 1.563781 0.01 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 4: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for Two-Tailed VaR75 minimization

10-fold crossvalidation
Minimize Var_risk + Var_risk_g (minimizing Two-Tail 75% – VaR Deviation)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 0.023143 0.13 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 4a: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for Two-Tailed VaR75 minimization

10-fold crossvalidation
Minimize Var_risk + Var_risk_g (minimizing Two-Tail 75% – VaR Deviation)
subject to
Avg = 0 (constraint on the expected losses)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 0.0305308 0.21 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data
PROBLEM 4b: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for Two-Tailed VaR90 minimization
10-fold crossvalidation
Minimize Var_risk + Var_risk_g (minimizing Two-Tail 90% – VaR Deviation)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 0.200252 0.09 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 4c: 10-fold Cross-validation (10 in-sample data and 10 out-of-sample data) for Two-Tailed VaR90 minimization

10-fold crossvalidation
Minimize Var_risk + Var_risk_g (minimizing Two-Tail 90% – VaR Deviation)
subject to
Avg = 0 (constraint on the expected losses)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–

Dataset1 3 900 0.279519 0.14 # of Variables # of Scenarios Objective Value Solving Time, PC 3.14GHz (sec) Environments Run-File Cycle Statement Data Solution Matlab Toolbox Data Matlab Subroutines Matlab Code Data R R Code Data

PROBLEM 5: Two-Tailed VaR75 minimization

Minimize Var_risk + Var_risk_g (minimizing Two-Tail 75% – VaR Deviation)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–
Datasets in Run-File Environment.

Problem Datasets # of Variables # of Scenarios Objective Value Solving Time, PC 3.50 GHz (sec)
Heuristic Problem Statement Data Solution 3 1000 0.0247128 0.06
MILP1 Problem Statement Data Solution 3 1000 0.154766 360
MILP2 Problem Statement Data Solution 3 1000 0.210730 3600

PROBLEM 5a: Two-Tailed VaR75 minimization

Minimize Var_risk + Var_risk_g (minimizing Two-Tail 75% – VaR Deviation)
subject to
Avg = 0 (constraint on the expected losses)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–
Datasets in Run-File Environment.

Problem Datasets # of Variables # of Scenarios Objective Value Solving Time, PC 3.50 GHz (sec)
Heuristic Problem Statement Data Solution 3 1000 0.041439 0.07
MILP1 Problem Statement Data Solution 3 1000 0.108584 360
MILP2 Problem Statement Data Solution 3 1000 0.121993 3600

PROBLEM 5b: Two-Tailed VaR90 minimization

Minimize Var_risk + Var_risk_g (minimizing Two-Tail 90% – VaR Deviation)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–
Datasets in Run-File Environment.

Problem Datasets # of Variables # of Scenarios Objective Value Solving Time, PC 3.50 GHz (sec)
Heuristic Problem Statement Data Solution 3 1000 0.257440 0.07
MILP1 Problem Statement Data Solution 3 1000 0.594059 360
MILP2 Problem Statement Data Solution 3 1000 0.334520 3600

PROBLEM 5c: Two-Tailed VaR90 minimization

Minimize Var_risk + Var_risk_g (minimizing Two-Tail 90% – VaR Deviation)
subject to
Avg = 0 (constraint on the expected losses)
Value:
L_num(matrix_fact_out)
L_num(matrix_fact_in)
Cvar_dev(0.9, matrix_fact_in)
Meanabs_dev(matrix_fact_in)
St_dev(matrix_fact_in)
Var_risk(0.75, matrix_fact_in)
Var_risk_g(0.75, matrix_fact_in)
Var_risk(0.9, matrix_fact_in)
Var_risk_g(0.9, matrix_fact_in)
——————————————————————–
crossvalidation(N,Matrix) = matrix operation splits input Matrix into N pairs of complementary sub-matrices
Cvar_dev = CVaR Deviation for Loss
Meanabs_dev = Mean Absolute Deviation
St_dev = Standard Deviation
Var_risk = VaR Risk for Loss
Var_risk_g = VaR Risk for Gain
——————————————————————–
Datasets in Run-File Environment.

Problem Datasets # of Variables # of Scenarios Objective Value Solving Time, PC 3.50 GHz (sec)
Heuristic Problem Statement Data Solution 3 1000 0.377803 0.06
MILP1 Problem Statement Data Solution 3 1000 0.466112 360
MILP2 Problem Statement Data Solution 3 1000 0.636026 3600

CASE STUDY SUMMARY

This case study investigates the optimal pipeline hedging strategy with five different deviation measures: Standard Deviation, Mean Absolute Deviation, CVaR Deviation, two-tailed VaR75, and two-tailed VaR90. We test in-sample and out-of-sample performance of these five deviation measures.
Mortgage lenders usually originate mortgages by selling them in the secondary market. Alternatively, the funding can be obtained by mortgage lenders through securitizing the mortgages in exchange for mortgage backed securities (MBS) and then selling MBS to investors in the secondary market. This case study considers hedging the risk- in the mortgage underwriting process known as “pipeline”. Mortgage lenders commit to a mortgage interest rate while the loan is in process, typically for a period of 30-60 days. If the rate rises before the loan goes to closing, the value of the loan declines and the lender sells the loan at a lower price. The risk that mortgages in process will fall in value prior to their sale is known as mortgage pipeline risk. Lenders often hedge this exposure by selling forward their expected closing volume or by shorting U.S. Treasury notes, or futures contracts. Fallout refers to the percentage of loan commitments that do not go to closing. The mortgage pipeline risk is affected by fallout. As interest rates fall, the fallout rises because borrowers locked in a mortgage rate are more likely to find better rates with another lender. Conversely, as rates rise the percentage of loans that close increases. The fallout affects the required size of the hedging instrument because it affects the size of the pipeline position to be hedged. At lower rates, fewer rate loans will close and a smaller position in the hedging instrument is needed. Lenders often use options on U.S. Treasury note futures to hedge against the fallout risk (Cusatis and Thomas, 2005).

This case study uses three hedging instruments for hedging the pipeline risk: 5% MBS forward, 5.5% MBS forward, and call options on 10-year Treasury note futures. We ignore transaction costs and allow short sales. To investigate the impact of different risk measurement practices on the optimal hedging strategies, we consider five deviation measures: standard deviation, mean absolute deviation, CVaR deviation, two-tailed VaR75, and two-tailed VaR90 as the objective function in the minimum risk hedging model. For the out-of-sample testing, we partition the 1,000 scenarios into 10 groups with 100 scenarios in each group. Each time we select one group for the out-of-sample test and we calculate optimal hedging positions based on the remaining 9 groups containing 900 scenarios. For each group of 100 scenarios we calculate the ex-ante losses (i.e., underperformances of hedging portfolio versus target) with the optimal hedging positions obtained from 900 scenarios. To estimate the out-of-sample performance, we aggregate the out-of-sample losses from the 10 runs to obtain a combined set including 1,000 out-of-sample losses. Then, we calculated five deviation measures on the out-of-sample 1,000 losses: Standard Deviation, Mean Absolute Deviation, CVaR Deviation, Two-Tail 75%-VaR Deviation, and Two-Tail 90%-VaR Deviation. In addition, we calculated three downside risk measures: 90%-CVaR, 90%-VaR, and Max Loss on the out-of-sample losses. By minimizing the Two-Tail 90%-VaR Deviation, we obtained the best values for all three considered downside risk measures. Minimization of CVaR deviation leads to good results, whereas minimization of standard deviation gives the worst level for three downside risk measures.

References
• Cusatis, P.J. and M.R. Thomas (2005): Hedging Instruments and Risk Management, McGraw-Hill.
• Taglia, P. (2003): Risk Management Case Study: How Mortgage Lenders Use Futures to Hedge Pipeline Risk. Futures Industry Magazine, September/October.
• Lederman, J. (1997): Handbook of Secondary Marketing, Mortgage Bankers Association of America.
• Hakim, S., Rashidian, M., and E. Rosenblatt (1999): Measuring the Fallout Risk in the Mortgage Pipeline. The Journal of Fixed Income, 9, 62–75.