Optionadjusted spread given yield
OAS = mbsyield2oas(ZeroCurve, Yield, Settle, Maturity, IssueDate,
GrossRate, CouponRate, Delay, Interpolation PrepaySpeed,
PrepayMatrix)
ZeroCurve  A matrix of three columns:

Yield  Mortgage yield, compounded monthly (in decimal). 
Settle  Settlement date (scalar only). A serial date number or
date string. Date when optionadjusted spread is calculated. 
Maturity  Maturity date. Scalar or vector in serial date number or date string format. 
IssueDate  Issue date. A serial date number or date string. 
GrossRate  Gross coupon rate (including fees), in decimal. 
 (Optional) Net coupon rate, in decimal. Default = 
Delay  (Optional) Delay (in days) between payment from homeowner and receipt by bondholder. Default = 0 (no delay between payment and receipt). 
Interpolation  Interpolation method. Computes the corresponding spot
rates for the bond's cash flow. Available methods are (0) nearest,
(1) linear, and (2) cubic spline. Default = 1. See 
 (Optional) Relation of the conditional payment rate (CPR)
to the benchmark model. Default = end of month's CPR. Set 
PrepayMatrix  (Optional) Customized prepayment matrix. A matrix of
size 
All inputs (except PrepayMatrix
) are number
of mortgagebacked securities (NMBS
) by 1
vectors.
OAS = mbsyield2oas(ZeroCurve, Yield, Settle, Maturity,
IssueDate, GrossRate, CouponRate, Delay, Interpolation, PrepaySpeed,
PrepayMatrix)
computes the optionadjusted spread in basis
points.