Monte Carlo Interest Rates and OAS for Mortgage-Backed Securities
Summary
The question outlines a Monte Carlo approach to option-adjusted spread (OAS) for a mortgage-backed security: simulate interest rates, derive mortgage rates along each path, project cash flows, discount them, average the resulting values, and find the spread that matches the market price. It asks whether this approach is necessary for MBS valuation and how to interpret a QuantLib callable-bond OAS routine that appears to solve for a spread without visibly simulating rates.
The document provides the question and a code excerpt, but no answer resolving the apparent discrepancy. The excerpt shows a numerical root solver applied to a pricing helper and a conversion of the solved spread; it does not reveal how the helper or pricing engine values the instrument. Thus, it cannot establish whether the calculation uses Monte Carlo, another interest-rate model, or a simpler deterministic setup. The key lesson is to distinguish the outer spread-solving procedure from the underlying pricing engine, and to inspect that engine before concluding that an OAS method omits rate simulation. No implementation guidance or validation results are supplied.
Key ideas
- An MBS OAS workflow can simulate rates, project cash flows, average values, and solve for the spread matching price.
- The code excerpt uses a root solver to find a spread through a pricing helper.
- The spread solver alone does not reveal how the security’s cash flows are valued.
- The underlying pricing engine must be examined to determine whether rate simulation is used.
- The discussion supplies no answer or evidence validating a particular implementation.
Tags
Full text
# Option Adjusted Spread - Monte Carlo
# Option Adjusted Spread - Monte Carlo
It's my understanding that in order to calculate the option adjusted spread on a mortgage backed-security, the following steps are required:
- Run a Monte Carlo simulation of interest rates
- Project mortgage rates along each simulation
- Compute cashflows and get NPV
- Average NPV and compute spread that solves for the number added to zero curve
I have been looking everywhere online for python or C++ or C# code to implement this form of calculating OAS, but alas I cannot find anything. The closest thing I found was C++ in QuantLib
However the code below does not do any monte carlo interest rate simulation, it appears to be simply solving for a spread, similar to zspread
Would this OAS method not work for an MBS given that there isn't a monte carlo of rates?
Is my understanding of how to calculate OAS correct, or incorrect?
Likewise if you can help point me in the direction of a code base that implements OAS on an MBS it would be much appreciated.
```
Spread CallableBond::OAS(Real cleanPrice,
const Handle<YieldTermStructure>& engineTS,
const DayCounter& dayCounter,
Compounding compounding,
Frequency frequency,
Date settlement,
Real accuracy,
Size maxIterations,
Spread guess)
{
if (settlement == Date())
settlement = settlementDate();
Real dirtyPrice = cleanPrice + accruedAmount(settlement);
ext::function<Real(Real)> f = NPVSpreadHelper(*this);
OASHelper obj(f, dirtyPrice);
Brent solver;
solver.setMaxEvaluations(maxIterations);
Real step = 0.001;
Spread oas=solver.solve(obj, accuracy, guess, step);
return continuousToConv(oas, *this, engineTS, dayCounter, compounding, frequency);
}
```Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.