pymbs.tranche module

PyMBS is a Python library for use in modeling Mortgage-Backed Securities.

Copyright (C) 2019 Brian Farrell

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Contact: brian.farrell@me.com

class pymbs.tranche.IndexRate(name, benchmark, fred_ticker, initial_rate)[source]

Bases: object

Create and Index rate object for each Benchmark Index used in the deal.

Traditionally, the most popular index for Mortgage-Backed Securites has been 1-Month LIBOR (The London Inter-bank Offered Rate). However, in light of recent revelations reagrding LIBOR-fixing by market makers, it is being phased-out, in favor of SOFR - the Secured Overnight Financing Rate.

Other Index Rate Benchmarks may be used as well.

property benchmark
property fred_ticker
property initial_rate
property name
class pymbs.tranche.Tranche(*args, **kwargs)[source]

Bases: object

The Tranche object represents a tranche in the deal. It is used to store all pertinent information about the tranche, including any cash flows calculated for it.

The current design of this object provides an experimental ‘child tranche’ option, which allows for the creation of pseudo tranches, to enable a true tree-like representation of the cash flow structure and the payment waterfall.

Generally speaking, when reversing a deal, the cash flow structure is flattened so that only the tranches disclosed in the Prospectus Supplement are included in the model.

The tree representation with its attending pseudo tranches offeres a truer rendition of the model, but may not be necessary and requires a greater understanding of structured cash flow models. This functionality may be deprecated and removed in future releases.

property assumed_price
property cash_flows
property child_tranches
property coupon
property cusip
property dated_date
property delay
end_periodic_cf()[source]
property final_payment_date
property floater_cap
property floater_floor
property floater_formula
property group_id
property id
property int_type
property macr
new_child_tranche(group_id, id, upb, coupon, floater_formula, floater_cap, floater_floor, prin_type, int_type, notional_with, delay, retail, macr, final_payment_date, cusip, schedule, dated_date=None, next_payment_date=None)[source]
new_periodic_cf(prepay_scenario, period, payment_date)[source]
property next_payment_date
property notional_with
property original_upb
pay_accrue()[source]
pay_interest(collat_net_interest)[source]
pay_principal(principal_payment)[source]
property periodic_cf
property periodic_prepay_scenario
property price_at_issuance
property prin_type
property pro_rated_ratio
reduce_notional_balance()[source]
property retail
property schedule
property strips

This is a list of Notional tranches, whose interest was stripped from this tranche. It is the corollary to the ‘notional_with’ attribute.

TODO: Need to actually populate this list during the loading of the model!

tabulate_cf()[source]
property upb