mortgage
Mortgages.
Classes:
-
CommercialMortgage–Represents a commercial mortgage with a fixed interest rate.
-
Mortgage–Base class for mortgages with a fixed interest rate.
-
ResidentialMortgage–Represents a residential mortgage with a fixed interest rate.
CommercialMortgage
CommercialMortgage(
face_value: float,
interest_rate: float,
issue_date: Date,
maturity: Period,
frequency: Period = Semiannual,
settlement_days: int = 0,
calendar: Calendar = NullCalendar(),
day_count: DayCounter = Thirty360(BondBasis),
business_convention=Unadjusted,
book_type: Optional[BookType] = None,
credit_rating: Optional[CreditRating] = None,
issuer: Optional[Issuer] = None,
parent: Optional[Instrument] = None,
instrument_class: Optional[InstrumentClass] = None,
)
Bases: Mortgage
Represents a commercial mortgage with a fixed interest rate.
Parameters:
-
(face_valuefloat) –The face value of the instrument.
-
(interest_ratefloat) –The interest rate of the instrument.
-
(issue_dateDate) –The issue date of the instrument.
-
(maturityPeriod) –The maturity period of the instrument.
-
(frequencyPeriod, default:Semiannual) –The frequency of coupon payments. Defaults to ql.Semiannual.
-
(settlement_daysint, default:0) –The number of settlement days. Defaults to 0.
-
(calendarCalendar, default:NullCalendar()) –The calendar used for date calculations. Defaults to ql.NullCalendar().
-
(day_countDayCounter, default:Thirty360(BondBasis)) –The day count convention used for interest calculations. Defaults to ql.Thirty360(ql.Thirty360.BondBasis).
-
(business_conventionint, default:Unadjusted) –The business convention used for date adjustments. Defaults to ql.Unadjusted.
Methods:
-
accept–Accept a visitor.
-
is_composite–Check if the instrument is composite.
-
notional–Calculate the notional value of the loan on a given date.
-
payment_schedule–Calculate the payment schedule for the instrument.
-
set_pricing_engine–Set the pricing engine.
Attributes:
-
book_type(Optional[BookType]) –Get the book type of the instrument.
-
credit_rating(CreditRating) –Get the instrument's credit rating.
-
issuer(Issuer) –Get the instrument's issuer.
-
parent(Optional[Instrument]) –Get the parent instrument.
-
value(float) –Get the instrument's value.
value
property
writable
value: float
Get the instrument's value.
is_composite
is_composite() -> bool
Check if the instrument is composite.
notional
notional(date: date) -> float
Calculate the notional value of the loan on a given date.
Parameters:
-
(datedate) –The date for which to calculate the notional value.
Returns:
-
float(float) –The notional value of the bond on the given date.
payment_schedule
cached
payment_schedule() -> (
tuple[
list[tuple[date, float]],
list[tuple[date, float]],
list[tuple[date, float]],
]
)
Calculate the payment schedule for the instrument.
Returns:
-
Tuple(tuple[list[tuple[date, float]], list[tuple[date, float]], list[tuple[date, float]]]) –A tuple containing three lists: - interest_pmt: A list of tuples representing the date and amount of interest payments. - principal_pmt: A list of tuples representing the date and amount of principal payments. - outstanding: A list of tuples representing the date and outstanding balance after each payment.
set_pricing_engine
set_pricing_engine(engine: PricingEngine) -> None
Set the pricing engine.
Mortgage
Mortgage(
face_value: float,
interest_rate: float,
issue_date: Date,
maturity: Period,
frequency: Period = Semiannual,
settlement_days: int = 0,
calendar: Calendar = NullCalendar(),
day_count: DayCounter = Thirty360(BondBasis),
business_convention=Unadjusted,
book_type: Optional[BookType] = None,
credit_rating: Optional[CreditRating] = None,
issuer: Optional[Issuer] = None,
parent: Optional[Instrument] = None,
instrument_class: Optional[InstrumentClass] = None,
)
Bases: AmortizingFixedRateLoan
Base class for mortgages with a fixed interest rate.
Parameters:
-
(face_valuefloat) –The face value of the instrument.
-
(interest_ratefloat) –The interest rate of the instrument.
-
(issue_dateDate) –The issue date of the instrument.
-
(maturityPeriod) –The maturity period of the instrument.
-
(frequencyPeriod, default:Semiannual) –The frequency of coupon payments. Defaults to ql.Semiannual.
-
(settlement_daysint, default:0) –The number of settlement days. Defaults to 0.
-
(calendarCalendar, default:NullCalendar()) –The calendar used for date calculations. Defaults to ql.NullCalendar().
-
(day_countDayCounter, default:Thirty360(BondBasis)) –The day count convention used for interest calculations. Defaults to ql.Thirty360(ql.Thirty360.BondBasis).
-
(business_conventionint, default:Unadjusted) –The business convention used for date adjustments. Defaults to ql.Unadjusted.
Methods:
-
accept–Accept a visitor.
-
is_composite–Check if the instrument is composite.
-
notional–Calculate the notional value of the loan on a given date.
-
payment_schedule–Calculate the payment schedule for the instrument.
-
set_pricing_engine–Set the pricing engine.
Attributes:
-
book_type(Optional[BookType]) –Get the book type of the instrument.
-
credit_rating(CreditRating) –Get the instrument's credit rating.
-
issuer(Issuer) –Get the instrument's issuer.
-
parent(Optional[Instrument]) –Get the parent instrument.
-
value(float) –Get the instrument's value.
value
property
writable
value: float
Get the instrument's value.
is_composite
is_composite() -> bool
Check if the instrument is composite.
notional
notional(date: date) -> float
Calculate the notional value of the loan on a given date.
Parameters:
-
(datedate) –The date for which to calculate the notional value.
Returns:
-
float(float) –The notional value of the bond on the given date.
payment_schedule
cached
payment_schedule() -> (
tuple[
list[tuple[date, float]],
list[tuple[date, float]],
list[tuple[date, float]],
]
)
Calculate the payment schedule for the instrument.
Returns:
-
Tuple(tuple[list[tuple[date, float]], list[tuple[date, float]], list[tuple[date, float]]]) –A tuple containing three lists: - interest_pmt: A list of tuples representing the date and amount of interest payments. - principal_pmt: A list of tuples representing the date and amount of principal payments. - outstanding: A list of tuples representing the date and outstanding balance after each payment.
set_pricing_engine
set_pricing_engine(engine: PricingEngine) -> None
Set the pricing engine.
ResidentialMortgage
ResidentialMortgage(
face_value: float,
interest_rate: float,
issue_date: Date,
maturity: Period,
frequency: Period = Semiannual,
settlement_days: int = 0,
calendar: Calendar = NullCalendar(),
day_count: DayCounter = Thirty360(BondBasis),
business_convention=Unadjusted,
book_type: Optional[BookType] = None,
credit_rating: Optional[CreditRating] = None,
issuer: Optional[Issuer] = None,
parent: Optional[Instrument] = None,
instrument_class: Optional[InstrumentClass] = None,
)
Bases: Mortgage
Represents a residential mortgage with a fixed interest rate.
Parameters:
-
(face_valuefloat) –The face value of the instrument.
-
(interest_ratefloat) –The interest rate of the instrument.
-
(issue_dateDate) –The issue date of the instrument.
-
(maturityPeriod) –The maturity period of the instrument.
-
(frequencyPeriod, default:Semiannual) –The frequency of coupon payments. Defaults to ql.Semiannual.
-
(settlement_daysint, default:0) –The number of settlement days. Defaults to 0.
-
(calendarCalendar, default:NullCalendar()) –The calendar used for date calculations. Defaults to ql.NullCalendar().
-
(day_countDayCounter, default:Thirty360(BondBasis)) –The day count convention used for interest calculations. Defaults to ql.Thirty360(ql.Thirty360.BondBasis).
-
(business_conventionint, default:Unadjusted) –The business convention used for date adjustments. Defaults to ql.Unadjusted.
Methods:
-
accept–Accept a visitor.
-
is_composite–Check if the instrument is composite.
-
notional–Calculate the notional value of the loan on a given date.
-
payment_schedule–Calculate the payment schedule for the instrument.
-
set_pricing_engine–Set the pricing engine.
Attributes:
-
book_type(Optional[BookType]) –Get the book type of the instrument.
-
credit_rating(CreditRating) –Get the instrument's credit rating.
-
issuer(Issuer) –Get the instrument's issuer.
-
parent(Optional[Instrument]) –Get the parent instrument.
-
value(float) –Get the instrument's value.
value
property
writable
value: float
Get the instrument's value.
is_composite
is_composite() -> bool
Check if the instrument is composite.
notional
notional(date: date) -> float
Calculate the notional value of the loan on a given date.
Parameters:
-
(datedate) –The date for which to calculate the notional value.
Returns:
-
float(float) –The notional value of the bond on the given date.
payment_schedule
cached
payment_schedule() -> (
tuple[
list[tuple[date, float]],
list[tuple[date, float]],
list[tuple[date, float]],
]
)
Calculate the payment schedule for the instrument.
Returns:
-
Tuple(tuple[list[tuple[date, float]], list[tuple[date, float]], list[tuple[date, float]]]) –A tuple containing three lists: - interest_pmt: A list of tuples representing the date and amount of interest payments. - principal_pmt: A list of tuples representing the date and amount of principal payments. - outstanding: A list of tuples representing the date and outstanding balance after each payment.
set_pricing_engine
set_pricing_engine(engine: PricingEngine) -> None
Set the pricing engine.