Futures, Inflation, Credit

Futures Term Structure

DiffFusion.FuturesTermstructureType
abstract type FuturesTermstructure <: Termstructure end

An abstract futures term structure that provides methods to calculate prices of futures. Such prices represent risk-neutral expectations of spot prices.

Call operator for FuturesTermstructure is defined as

(ts::FuturesTermstructure)(args...) = future_price(ts, args...)
DiffFusion.future_priceMethod
future_price(ts::FuturesTermstructure, t::ModelTime)

Return the price of a future with settlement time t.

Inflation Term Structure

DiffFusion.InflationTermstructureType
abstract type InflationTermstructure <: Termstructure end

An abstract inflation term structure that provides methods to calculate forward inflation index. Forward inflation index is a T-forward measure expectation of (spot) inflation index values.

Call operator for InflationTermstructure is defined as

(ts::InflationTermstructure)(args...) = inflation_index(ts, args...)
DiffFusion.inflation_indexMethod
inflation_index(ts::InflationTermstructure, t::ModelTime)

Return the forward inflation index with observation time t.

Credit Default Term Structures

DiffFusion.CreditDefaultTermstructureType
abstract type CreditDefaultTermstructure <: Termstructure end

An abstract credit default term structure that provides methods to calculate survival probabilities.

DiffFusion.FlatSpreadCurveType
struct FlatSpreadCurve <: CreditDefaultTermstructure
    alias::String
    spread::ModelValue
end

A flat credit spread curve.

DiffFusion.flat_spread_curveFunction
flat_spread_curve(alias::String, spread::ModelValue)

Create a FlatSpreadCurve.

flat_spread_curve(spread::ModelValue)

Create a FlatSpreadCurve without alias.

DiffFusion.LogSurvivalCurveType
struct LogSurvivalCurve <: CreditDefaultTermstructure
    alias::String
    times::AbstractVector
    values::AbstractVector
end

Log-interpolated survival probabilities.

DiffFusion.survival_curveFunction
survival_curve(
    alias::String,
    times::AbstractVector,
    survival_probs::AbstractVector,
    interp_method = (x,y) -> linear_interpolation(x, y, extrapolation_bc = Line()),
    )

Create a LogSurvivalCurve.

survival_curve(
    alias::String,
    times::AbstractVector,
    survival_probs::AbstractVector,
    method_alias::String,
    )

Create a LogSurvivalCurve for pre-defined interpolation methods.

Call operator for CreditDefaultTermstructure is defined as

(ts::CreditDefaultTermstructure)(args...) = survival(ts, args...)
DiffFusion.survivalFunction
survival(ts::CreditDefaultTermstructure, t::ModelTime)

Return the survival probability with observation time t.

survival(ts::FlatSpreadCurve, t::ModelTime)

Calculate survival probability.

survival(ts::LogSurvivalCurve, t::ModelTime)

Calculate survival probability.