(Optional) Relation of the conditional payment rate (CPR)
to the benchmark model. Default = end of month's CPR. Set PrepaySpeed to [] if
you input a customized prepayment matrix.

PrepayMatrix

(Optional) Customized prepayment matrix. A matrix of
size max(TermRemaining)-by-NMBS.
Missing values are padded with NaNs. Each column
corresponds to a mortgage-backed security, and each row corresponds
to each month after settlement.

All inputs (except PrepayMatrix) are number
of mortgage-backed securities (NMBS) by 1 vectors.

Examples

Calculate the option-adjusted spread of a 30-year fixed-rate mortgage with about a 28-year weighted average maturity remaining, given assumptions of 0, 50, and 100 PSA prepayments. First, create the bonds matrix: