Credit Trader Suite Samples

 

DRIP Samples Implementation consists of the following 8 packages:

 

1.      DRIP MATH Samples: This illustrates some of the targeted math functionality exported in DRIP – integrand quadrature/algorithmic differentiation routines, non-linear fixed point searches, and linear algrbra modules.

 

2.      Spline Samples: The spline sample package contains samples that demonstrate the construction and usage of different basis splines and B Spline Sequences.

 

3.      Stretch Samples: The stretch sample package contains samples that demonstrate the construction, modification, and usage of stretches based off of different basis splines. They illustrate the computation of the curvature and the length penalties, and construction of best-fit regression spline samples. Finally they bring it all together in showing how to build latent state from measurements.

 

4.      Bond Samples: The bond sample package contains samples that demonstrate the API to access bond static/closing fields, bond single-field analytics, and RV measures. It also illustrates usage of the bond basket API.

 

5.      Credit Samples: The Credit Sample Package demonstrates the core credit analytics functionality – construction of credit curves, pricing of CDS and CDS basket, and retrieve the built-in pre-constructed CDX baskets and CDS closes.

 

6.      Rates Samples: The Rates Sample Package demonstrates the core rates analytics functionality – construction of rates and forward curves (shape preserving/smoothing/transition spline variants) and pricing of rates, treasury, and rates basket products.

 

7.      Miscellaneous Samples: Miscellaneous Samples demonstrates the set of samples not covered in the other sections – in particular the Day Count, the Calendar, and FXAPI samples.

 

8.      Bloomberg Samples: The Bloomberg Sample Package implements the Bloomberg’s calls CDSW, SWPM, and YAS.


DRIP MATH Samples

 

 

The DRIP MATH Sample functions are available in the package org.drip.sample.quant. This illustrates some of the targeted math functionality exported in DRIP – integrand quadrature/algorithmic differentiation routines, non-linear fixed point searches, and linear algrbra modules.

 

Functionality in this package is implemented over 3 classes - FixedPointSearch, IntegrandQuadrature, and LinearAlgebra.

 

 

FixedPointSearch

 

FixedPointSearch contains a sample illustration of usage of the Root Finder Library. It demonstrates the fixed-point extraction using the following techniques:

·        Newton-Raphson method

·        Bisection Method

·        False Position

·        Quadratic Interpolation

·        Inverse Quadratic Interpolation

·        Ridder's method

·        Brent's method

·        Zheng's method

 

 

IntegrandQuadrature

 

IntegrandQuadrature shows samples for the following routines for integrating the objective function:

·        Mid-Point Scheme

·        Trapezoidal Scheme

·        Simpson/Simpson38 schemes

·        Boole Scheme

 

 

LinearAlgebra

 

LinearAlgebra implements Samples for Linear Algebra and Matrix Manipulations. It demonstrates the following:

·        Compute the inverse of a matrix, and multiply with the original to recover the unit matrix

·        Solves system of linear equations using one the exposed techniques


DRIP Samples: Spline

 

 

The Spline Sample functions are available in the package org.drip.sample.spline. The spline sample package contains samples that demonstrate the construction and usage of different basis splines and B Spline Sequences.

 

Functionality in this package is implemented over 8 classes - BasisSplineSet, PolynomialBasisSpline, BasisTensionSplineSet, BasisBSplineSet, BasisMonicHatComparison, BasisMonicBSpline, BasisMulticBSpline, and BSplineSequence.

 

 

BasisSplineSet

 

BasisSplineSet implements Samples for the Construction and the usage of various basis spline functions. It demonstrates the following:

·        Construction of segment control parameters - polynomial (regular/Bernstein) segment control, exponential/hyperbolic tension segment control, Kaklis-Pandelis tension segment control, and  Hermite

·        Control the segment using the rational shape controller, and the appropriate

·        Estimate the node value and the node value Jacobian with the segment, as well as at the boundaries

·        Calculate the segment monotonicity

 

 

PolynomialBasisSpline

 

PolynomialBasisSpline implements Samples for the Construction and the usage of polynomial (both regular and Hermite) basis spline functions. It demonstrates the following:

·        Control the polynomial segment using the rational shape controller, the appropriate, and the basis function

·        Demonstrate the variational shape optimization behavior

·        Estimate the node value and the node value Jacobian with the segment, as well as at the boundaries

·        Calculate the segment monotonicity and the curvature penalty

 

 

BasisTensionSplineSet

 

BasisTensionSplineSet implements Samples for the Construction and the usage of various basis spline functions. It demonstrates the following:

·        Construction of Kocke-Lyche-Kvasov tension spline segment control parameters - using hyperbolic, exponential, rational linear, and rational quadratic primitives

·        Control the segment using the rational shape controller, and the appropriate

·        Estimate the node value and the node value Jacobian with the segment, as well as at the boundaries

·        Calculate the segment monotonicity

 

 

BasisBSplineSet

 

BasisBSplineSet implements Samples for the Construction and the usage of various basis B Spline functions.

 

 

BasisMonicHatComparison

 

BasisMonicHatComparison implements the comparison of the basis hat functions used in the construction of the monic basis B Splines. It demonstrates the following:

·        Construction of the Linear Cubic Rational Raw Hat Functions

·        Construction of the Quadratic Cubic Rational Raw Hat Functions

·        Construction of the Corresponding Processed Tension Basis Hat Functions

·        Construction of the Wrapping Monic Functions

·        Estimation and Comparison of the Ordered Derivatives

 

 

BasisMonicBSpline

 

BasisMonicBSpline implements Samples for the Construction and the usage of various monic basis B Splines. It demonstrates the following:

·        Construction of segment B Spline Hat Basis Functions

·        Estimation of the derivatives and the basis envelope cumulative integrands

·        Estimation of the normalizer and the basis envelope cumulative normalized integrand

 

 

BasisMulticBSpline

 

BasisMulticBSpline implements Samples for the Construction and the usage of various multic basis B Splines. It demonstrates the following:

·        Construction of segment higher order B Spline Hat Basis Functions

·        Estimation of the derivatives and the basis envelope cumulative integrands

·        Estimation of the normalizer and the basis envelope cumulative normalized integrand

 

 

BSplineSequence

 

BSplineSequence implements Samples for the Construction and the usage of various monic basis B Spline Sequences. It demonstrates the following:

·        Construction and Usage of segment Monic B Spline Sequence

·        Construction and Usage of segment Multic B Spline Sequence


DRIP Samples: Stretch

 

 

The Stretch Sample functions are available in the package org.drip.sample.stretch. The stretch sample package contains samples that demonstrate the construction, modification, and usage of stretches based off of different basis splines. They illustrate the computation of the curvature and the length penalties, and construction of best fit regression spline samples. Finally they bring it all together in showing how to build latent state from measurements.

 

Functionality in this package is implemented over 7 classes - StretchEstimation, TensionStretchEstimation, StretchAdjuster, RegressionSplineEstimator, PenalizedCurvatureFit, PenalizedCurvatureLengthFit, and CustomCurveBuilder.

 

 

StretchEstimation

 

StretchEstimation demonstrates the Stretch builder and usage API. It shows the following:

·        Construction of segment control parameters - polynomial (regular/Bernstein) segment control, exponential/hyperbolic tension segment control, Kaklis-Pandelis tension segment control

·        Perform the following sequence of tests for a given segment control for a predictor/response range

o       Assign the array of Segment Builder Parameters - one per segment

o       Construct the Stretch Instance

o       Estimate, compute the segment-by-segment monotonicity and the Stretch Jacobian

o       Construct a new Stretch instance by inserting a pair of predictor/response knots

o       Estimate, compute the segment-by-segment monotonicity and the Stretch Jacobian

·        Demonstrate the construction, the calibration, and the usage of Local Control Segment Spline

·        Demonstrate the construction, the calibration, and the usage of Lagrange Polynomial Stretch

·        Demonstrate the construction, the calibration, and the usage of C1 Stretch with the desired customization.

 

 

TensionStretchEstimation

 

TensionStretchEstimation demonstrates the Stretch builder and usage API. It shows the following:

·        Construction of segment control parameters - polynomial (regular/Bernstein) segment control, exponential/hyperbolic tension segment control, Kaklis-Pandelis tension segment control

·        Tension Basis Spline Test using the specified predictor/response set and the array of segment custom builder control parameters

·        Complete the full tension stretch estimation sample test

 

 

StretchAdjuster

 

StretchAdjuster demonstrates the Stretch Manipulation and Adjustment API. It shows the following:

·        Construct a simple Base Stretch

·        Clip a left Portion of the Stretch to construct a left-clipped Stretch

·        Clip a right Portion of the Stretch to construct a tight-clipped Stretch

·        Compare the values across all the stretches to establish a) the continuity in the base smoothness is, preserved, and b) Continuity across the predictor ordinate for the implied response value is also preserved

 

 

RegressionSplineEstimator

 

RegressionSplineEstimator shows the sample construction and usage of Regression Splines. It demonstrates the construction of the segment's predictor ordinate/response value combination, and eventual calibration.

 

 

PenalizedCurvatureFit

 

PenalizedCurvatureFit demonstrates the setting up and the usage of the curvature and closeness of fit penalizing spline. It illustrates in detail the following steps:

·        Set up the X Predictor Ordinate and the Y Response Value Set

·        Construct a set of Predictor Ordinates, their Responses, and corresponding Weights to serve as weighted closeness of fit

·        Construct a rational shape controller with the desired shape controller tension parameters and Global Scaling

·        Construct the segment inelastic parameter that is C2, with 2nd order roughness penalty derivative, and without constraint

·        Construct the base, the base + 1 degree segment builder control

·        Construct the base, the elevated, and the best fit basis spline stretches

·        Compute the segment-by-segment monotonicity for all the three stretches

·        Compute the Stretch Jacobian for all the three stretches

·        Compute the Base Stretch Curvature Penalty Estimate

·        Compute the Elevated Stretch Curvature Penalty Estimate

·        Compute the Best Fit Stretch Curvature Penalty Estimate

 

PenalizedCurvatureLengthFit

 

PenalizedCurvatureLengthFit demonstrates the setting up and the usage of the curvature, the length, and the closeness of fit penalizing spline. This sample shows the following:

·        Set up the X Predictor Ordinate and the Y Response Value Set

·        Construct a set of Predictor Ordinates, their Responses, and corresponding Weights to serve as weighted closeness of fit

·        Construct a rational shape controller with the desired shape controller tension parameters and Global Scaling

·        Construct the Segment Inelastic Parameter that is C2, with First Order Segment Length Penalty Derivative, Second Order Segment Curvature Penalty Derivative, their Amplitudes, and without Constraint

·        Construct the base, the base + 1 degree segment builder control

·        Construct the base, the elevated, and the best fit basis spline stretches

·        Compute the segment-by-segment monotonicity for all the three stretches

·        Compute the Stretch Jacobian for all the three stretches

·        Compute the Base Stretch Curvature, Length, and the Best Fit DPE

·        Compute the Elevated Stretch Curvature, Length, and the Best Fit DPE

·        Compute the Best Fit Stretch Curvature, Length, and the Best Fit DPE

 

 

CustomCurveBuilder

 

CustomCurveBuilder contains samples that demo how to build a discount curve from purely the cash flows. It provides for elaborate curve builder control, both at the segment level and at the Stretch level. In particular, it shows the following:

·        Construct a discount curve from the discount factors available purely from the cash and the euro-dollar instruments

·        Construct a discount curve from the cash flows available from the swap instruments

In addition, the sample demonstrates the following ways of controlling curve construction:

·        Control over the type of segment basis spline

·        Control over the polynomial basis spline order , and tension parameters

o       Provision of custom shape controllers (in this case rational shape controller)

·        Calculation of segment monotonicity and convexity


DRIP Samples: Bond

 

 

The Bond Sample functions are available in the package org.drip.sample.bond. The bond sample package contains samples that demonstrate the API to access bond static/closing fields, bond single-field analytics, and RV measures. It also illustrates usage of the bond basket API.

 

Functionality in this package is implemented over 5 classes - BondAnalyticsAPI, BondBasketAPI, BondLiveAndEODAPI, BondRVMeasuresAPI, and BondStaticAPI.

 

 

BondAnalyticsAPI

 

BondAnalyticsAPI contains a demo of the bond analytics API Sample. It generates the value and the RV measures for essentially the same bond (with identical cash flows) constructed in 3 different ways:

·        As a fixed rate bond

·        As a floater

·        As a bond constructed from a set of custom coupon and principal flows

It shows these measures reconcile where they should.

 

 

BondBasketAPI

 

BondBasketAPI contains a demo of the bond basket API Sample. It shows the following:

·        Build the IR Curve from the Rates' instruments

·        Build the Component Credit Curve from the CDS instruments

·        Create the basket market parameters and add the named discount curve and the credit curves to it

·        Create the bond basket from the component bonds and their weights

·        Construct the Valuation and the Pricing Parameters

·        Generate the bond basket measures from the valuation, the pricer, and the market parameters

 

 

BondLiveAndEODAPI

 

BondLiveAndEODAPI contains the comprehensive sample class demonstrating the usage of the EOD and Live Curve Bond API functions.

 

 

BondRVMeasuresAPI

 

BondRVMeasuresAPI is a Simple Bond RV Measures API Sample demonstrating the invocation and usage of Bond RV Measures functionality. It shows the following:

·        Create the discount/treasury curve from rates/treasury instruments

·        Compute the work-out date given the price

·        Compute and display the base RV measures to the work-out date

·        Compute and display the bumped RV measures to the work-out date

 

 

BondStaticAPI

 

BondStaticAPI contains a demo of the bond static API Sample. The Sample demonstrates the retrieval of the bond's static fields.


DRIP Samples: Credit

 

 

The Credit Sample functions are available in the package org.drip.sample.credit. The Credit Sample Package demonstrates the core credit analytics functionality – construction of credit curves, pricing of CDS and CDS basket, and retrieve the built-in pre-constructed CDX baskets and CDS closes.

 

Functionality in this package is implemented over 4 classes - CreditAnalyticsAPI, CDSLiveAndEODAPI, StandardCDXAPI, and CDSBasketAPI.

 

 

CreditAnalyticsAPI

 

CreditAnalyticsAPI contains a demo of the CDS Analytics API Sample. It illustrates the following:

·        Credit Curve Creation: From flat Hazard Rate, and from an array of dates and their corresponding survival probabilities

·        Create Credit Curve from CDS instruments, and recover the input measure quotes

·        Create an SNAC CDS, price it, and display the coupon/loss cash flow

 

 

CDSLiveAndEODAPI

 

CDSLiveAndEODAPI is a fairly comprehensive sample demonstrating the usage of the EOD and Live CDS Curve API functions. It demonstrates the following:

·        Retrieves all the CDS curves available for the given EOD

·        Retrieves the calibrated credit curve from the CDS instruments for the given CDS curve name, IR curve name, and EOD. Also shows the 10Y survival probability and hazard rate

·        Displays the CDS quotes used to construct the closing credit curve

·        Loads all available credit curves for the given curve ID built from CDS instruments between 2 dates and displays the corresponding 5Y quote

·        Calculate and display the EOD CDS measures for a spot starting CDS based off of a specific credit curve

 

 

StandardCDXAPI

 

StandardCDXAPI contains a demo of the CDS basket API Sample. It shows the following:

·        Construct the CDX.NA.IG 5Y Series 17 index by name and series

·        Construct the on-the-run CDX.NA.IG 5Y Series index

·        List all the built-in CDX - their names and descriptions

·        Construct the on-the run CDX.EM 5Y corresponding to T - 1Y

·        Construct the on-the run ITRAXX.ENERGY 5Y corresponding to T - 7Y

·        Retrieve the full set of date/index series set for ITRAXX.ENERGY

 

 

CDSBasketAPI

 

CDSBasketAPI contains a demo of the CDS basket API Sample. It shows the following:

·        Build the IR Curve from the Rates' instruments

·        Build the Component Credit Curve from the CDS instruments

·        Create the basket market parameters and add the named discount curve and the credit curves to it

·        Create the CDS basket from the component CDS and their weights

·        Construct the Valuation and the Pricing Parameters

·        Generate the CDS basket measures from the valuation, the pricer, and the market parameters


DRIP Samples: Rates

 

 

The Rates Sample functions are available in the package org.drip.sample.rates. The Rates Sample Package demonstrates the core rates analytics functionality – construction of rates and forward curves (shape preserving/smoothing/transition spline variants) and pricing of rates, treasury, and rates basket products.

 

Functionality in this package is implemented over 12 classes - HaganWestForwardInterpolator, ShapeDFZeroLocalSmooth, ShapePreservingDFZeroSmooth, CustomDiscountCurveBuilder, CustomDiscountCurveReconciler, DiscountCurveQuoteSensitivity, TemplatedDiscountCurveBuilder, CustomForwardCurveBuilder, RatesAnalyticsAPI, TreasuryCurveAPI, RatesLiveAndEODAPI, and MultiLegSwapAPI.

 

 

HaganWestForwardInterpolator

 

This sample illustrates using the Hagan and West (2006) Estimator. It provides the following functionality:

·        Set up the Predictor ordinates and the response values

·        Construct the rational linear shape control with the specified tension

·        Create the Segment Inelastic design using the Ck and Curvature Penalty Derivatives

·        Build the Array of Segment Custom Builder Control Parameters of the KLK Hyperbolic Tension Basis Type, the tension, the segment inelastic design control, and the shape controller

·        Setup the monotone convex stretch using the above settings, and with no linear inference, no spurious extrema, or no monotone filtering applied

·        Setup the monotone convex stretch using the above settings, and with linear inference, no spurious extrema, or no monotone filtering applied

·        Compute and display the monotone convex output with the linear forward state

·        Compute and display the monotone convex output with the harmonic forward state

 

 

ShapeDFZeroLocalSmooth

 

ShapeDFZeroLocalSmooth demonstrates the usage of different local smoothing techniques involved in the discount curve creation. It shows the following:

·        Construct the Array of Cash/Swap Instruments and their Quotes from the given set of parameters

·        Construct the Cash/Swap Instrument Set Stretch Builder

·        Set up the Linear Curve Calibrator using the following parameters:

o       Cubic Exponential Mixture Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

·        Set up the Akima Local Curve Control parameters as follows:

o        Akima Monotone Smoothener with spurious extrema elimination and monotone filtering applied

o       Zero Rate Quantification Metric

o       Cubic Polynomial Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

·        Set up the Harmonic Local Curve Control parameters as follows:

o       * Harmonic Monotone Smoothener with spurious extrema elimination and monotone filtering applied

o       Zero Rate Quantification Metric

o       Cubic Polynomial Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

·        Set up the Hyman 1983 Local Curve Control parameters as follows:

o       *Hyman 1983 Monotone Smoothener with spurious extrema elimination and monotone filtering applied

o       Zero Rate Quantification Metric

o       Cubic Polynomial Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

·        Set up the Hyman 1989 Local Curve Control parameters as follows:

o       *Akima Monotone Smoothener with spurious extrema elimination and monotone filtering applied

o       Zero Rate Quantification Metric

o       Cubic Polynomial Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

·        Set up the Huynh-Le Floch Delimited Local Curve Control parameters as follows:

o       * Huynh-Le Floch Delimited Monotone Smoothener with spurious extrema elimination and monotone filtering applied

o       Zero Rate Quantification Metric

o       Cubic Polynomial Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

·        Set up the Kruger Local Curve Control parameters as follows:

o       * Kruger Monotone Smoothener with spurious extrema elimination and monotone filtering applied

o       Zero Rate Quantification Metric

o       Cubic Polynomial Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

·        Construct the Shape Preserving Discount Curve by applying the linear curve calibrator to the array of Cash and Swap Stretches

·        Construct the Akima Locally Smoothened Discount Curve by applying the linear curve calibrator and the Local Curve Control parameters to the array of Cash and Swap Stretches and the shape-preserving discount curve

·        Construct the Harmonic Locally Smoothened Discount Curve by applying the linear curve calibrator and the Local Curve Control parameters to the array of Cash and Swap Stretches and the shape preserving discount curve

·        Construct the Hyman 1983 Locally Smoothened Discount Curve by applying the linear curve calibrator and the Local Curve Control parameters to the array of Cash and Swap Stretches and the shape preserving discount curve

·        Construct the Hyman 1989 Locally Smoothened Discount Curve by applying the linear curve calibrator and the Local Curve Control parameters to the array of Cash and Swap Stretches and the shape preserving discount curve

·        Construct the Huynh-Le Floch Delimiter Locally Smoothened Discount Curve by applying the linear curve calibrator and the Local Curve Control parameters to the array of Cash and Swap Stretches and the shape preserving discount curve

·        Construct the Kruger Locally Smoothened Discount Curve by applying the linear curve calibrator and the Local Curve Control parameters to the array of Cash and Swap Stretches and the shape preserving discount curve

·        Cross-Comparison of the Cash/Swap Calibration Instrument "Rate" metric across the different curve construction methodologies

·        Cross-Comparison of the Swap Calibration Instrument "Rate" metric across the different curve construction methodologies for a sequence of bespoke swap instruments

 

 

ShapePreservingDFZeroSmooth

 

ShapePreservingDFZeroSmooth demonstrates the usage of different shape preserving and smoothing techniques involved in the discount curve creation. It shows the following:

o       Construct the Array of Cash/Swap Instruments and their Quotes from the given set of parameters

o       Construct the Cash/Swap Instrument Set Stretch Builder

o       Set up the Linear Curve Calibrator using the following parameters:

o       Cubic Exponential Mixture Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

o       Set up the Global Curve Control parameters as follows:

o       Zero Rate Quantification Metric

o       Cubic Polynomial Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

o       Set up the Local Curve Control parameters as follows:

o       *Bessel Monotone Smoothener with no spurious extrema elimination and no monotone filter

o       Zero Rate Quantification Metric

o       Cubic Polynomial Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

o       Construct the Shape Preserving Discount Curve by applying the linear curve calibrator to the array of Cash and Swap Stretches

o       Construct the Globally Smoothened Discount Curve by applying the linear curve calibrator and the Global Curve Control parameters to the array of Cash and Swap Stretches and the shape preserving discount curve

o       Construct the Locally Smoothened Discount Curve by applying the linear curve calibrator and the Local Curve Control parameters to the array of Cash and Swap Stretches and the shape preserving discount curve

o       Cross-Comparison of the Cash/Swap Calibration Instrument "Rate" metric across the different curve construction methodologies

o       Cross-Comparison of the Swap Calibration Instrument "Rate" metric across the different curve construction methodologies for a sequence of bespoke swap instruments

 

 

CustomDiscountCurveBuilder

 

CustomDiscountCurveBuilder discount curve calibration and input instrument calibration quote recovery. It shows the following:

o       Construct the Array of Cash/Swap Instruments and their Quotes from the given set of parameters

o       Construct the Cash/Swap Instrument Set Stretch Builder

o       Set up the Linear Curve Calibrator using the following parameters:

o       Cubic Exponential Mixture Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

o       Construct the Shape Preserving Discount Curve by applying the linear curve calibrator to the array of Cash and Swap Stretches

o       Cross-Comparison of the Cash/Swap Calibration Instrument "Rate" metric across the different curve construction methodologies

 

 

CustomDiscountCurveReconciler

 

CustomDiscountCurveReconciler demonstrates the multi-stretch transition custom discount curve construction, turns application, discount factor extraction, and calibration quote recovery. It shows the following steps:

o       Setup the linear curve calibrator

o       Setup the cash instruments and their quotes for calibration

o       Setup the cash instruments stretch latent state representation - this uses the discount factor quantification metric and the "rate" manifest measure

o       Setup the swap instruments and their quotes for calibration

o       Setup the swap instruments stretch latent state representation - this uses the discount factor quantification metric and the "rate" manifest measure

o       Calibrate over the instrument set to generate a new overlapping latent state span instance

o       Retrieve the "cash" stretch from the span

o       Retrieve the "swap" stretch from the span

o       Create a discount curve instance by converting the overlapping stretch to an exclusive non-overlapping stretch

o       Compare the discount factors and their monotonicity emitted from the discount curve, the non-overlapping span, and the "swap" stretch across the range of tenor predictor ordinates

o       Cross-Recovery of the Cash Calibration Instrument "Rate" metric across the different curve construction methodologies

o       Cross-Recovery of the Swap Calibration Instrument "Rate" metric across the different curve construction methodologies

o       Create a turn list instance and add new turn instances

o       Update the discount curve with the turn list

o       Compare the discount factor implied the discount curve with and without applying the turns adjustment

 

 

DiscountCurveQuoteSensitivity

 

DiscountCurveQuoteSensitivity demonstrates the calculation of the discount curve sensitivity to the calibration instrument quotes. It does the following:

o       Construct the Array of Cash/Swap Instruments and their Quotes from the given set of parameters

o       Construct the Cash/Swap Instrument Set Stretch Builder.

o       Set up the Linear Curve Calibrator using the following parameters:

o       Cubic Exponential Mixture Basis Spline Set

o       , Segment Curvature Penalty = 2

o       Quadratic Rational Shape Controller

o       Natural Boundary Setting

o       Construct the Shape Preserving Discount Curve by applying the linear curve calibrator to the array of Cash and Swap Stretches

o       Cross-Comparison of the Cash/Swap Calibration Instrument "Rate" metric across the different curve construction methodologies

o       Display of the Cash Instrument Discount Factor Quote Jacobian Sensitivities

o       Display of the Swap Instrument Discount Factor Quote Jacobian Sensitivities

 

 

TemplatedDiscountCurveBuilder

 

TemplatedDiscountCurveBuilder sample demonstrates the usage of the different pre-built Discount Curve Builders. It shows the following:

·        Construct the Array of Cash Instruments and their Quotes from the given set of parameters

·        Construct the Array of Swap Instruments and their Quotes from the given set of parameters

·        Construct the Cubic Tension KLK Hyperbolic Discount Factor Shape Preserver

·        Construct the Cubic Tension KLK Hyperbolic Discount Factor Shape Preserver with Zero Rate Smoothening applied

·        Construct the Cubic Polynomial Discount Factor Shape Preserver

·        Construct the Cubic Polynomial Discount Factor Shape Preserver with Zero Rate Smoothening applied

·        Construct the Discount Curve using the Bear Sterns' DENSE Methodology

·        Construct the Discount Curve using the Bear Sterns' DUALDENSE Methodology

·        Cross-Comparison of the Cash Calibration Instrument "Rate" metric across the different curve construction methodologies

·        Cross-Comparison of the Swap Calibration Instrument "Rate" metric across the different curve construction methodologies

·        Cross-Comparison of the generated Discount Factor across the different curve construction Methodologies for different node points

 

 

CustomForwardCurveBuilder

 

CustomForwardCurveBuilder contains the sample demonstrating the full functionality behind creating highly customized spline based forward curves.

The first sample illustrates the creation and usage of the xM-6M Tenor Basis Swap:

·        Construct the 6M-xM float-float basis swap

·        Calculate the corresponding starting forward rate off of the discount curve

·        Construct the shape preserving forward curve off of Cubic Polynomial Basis Spline

·        Construct the shape preserving forward curve off of Quartic Polynomial Basis Spline

·        Construct the shape preserving forward curve off of Hyperbolic Tension Based Basis Spline

·        Set the discount curve based component market parameters

·        Set the discount curve + cubic polynomial forward curve based component market parameters

·        Set the discount curve + quartic polynomial forward curve based component market parameters

·        Set the discount curve + hyperbolic tension forward curve based component market parameters

·        Compute the following forward curve metrics for each of cubic polynomial forward, quartic polynomial forward, and KLK Hyperbolic tension forward curves:

o       Reference Basis Par Spread

o       Derived Basis Par Spread

·        Compare these with a) the forward rate off of the discount curve, b) The LIBOR rate, and c) The Input Basis Swap Quote

The second sample illustrates how to build and test the forward curves across various tenor basis. It shows the following steps:

·        Construct the Discount Curve using its instruments and quotes

·        Build and run the sampling for the 1M-6M Tenor Basis Swap from its instruments and quotes

·        Build and run the sampling for the 3M-6M Tenor Basis Swap from its instruments and quotes

·        Build and run the sampling for the 6M-6M Tenor Basis Swap from its instruments and quotes

·        Build and run the sampling for the 12M-6M Tenor Basis Swap from its instruments and quotes

 

 

RatesAnalyticsAPI

 

RatesAnalyticsAPI contains a demo of the Rates Analytics API Usage. It shows the following:

·        Build a discount curve using: cash instruments only, EDF instruments only, IRS instruments only, or all of them strung together

·        Re-calculate the component input measure quotes from the calibrated discount curve object

·        Compute the PVDF Wengert Jacobian across all the instruments used in the curve construction

 

 

TreasuryCurveAPI

 

TreasuryCurveAPI contains a demo of construction and usage of the treasury discount curve from government bond inputs. It shows the following:

·        Create on-the-run TSY bond set

·        Calibrate a discount curve off of the on-the-run yields and calculate the implied zeroes and DF's

·        Price an off-the-run TSY

 

 

RatesLiveAndEODAPI

 

RatesLiveAndEODAPI contains the sample API demonstrating the usage of the Rates Live and EOD functions. It does the following:

·        Pulls all the closing rates curve names (of any type, incl. TSY) that exist for a given date

·        Load the full IR curve created from all the single currency rate quotes (except TSY) for the given currency and date

·        Calculate the discount factor to an arbitrary date using the constructed curve

·        Retrieve the components and their quotes that went into constructing the curve, and display them

·        Load all the rates curves available between the dates for the currency specified, and step through

·        Load all the Cash quotes available between the dates for the currency specified, and step through

·        Load all the EDF quotes available between the dates for the currency specified, and step through

·        Load all the IRS quotes available between the dates for the currency specified, and step through

·        Load all the TSY quotes available between the dates for the currency specified, and step through

 

 

MultiLegSwapAPI

 

MultiLegSwapAPI illustrates the creation, invocation, and usage of the MultiLegSwap. It shows how to:

·        Create the Discount Curve from the rates instruments

·        Set up the valuation and the market parameters

·        Create the Rates Basket from the fixed/float streams

·        Value the Rates Basket


DRIP Samples: Miscellaneous

 

 

The Miscellaneous Sample functions are available in the package org.drip.sample.misc. Miscellaneous Samples demonstrates the set of samples not covered in the other sections – in particular the Day Count, the Calendar, and FXAPI samples.

 

Functionality in this package is implemented over 2 classes - DayCountAndCalendarAPI and FXAPI.

 

 

DayCountAndCalendarAPI

 

DayCountAndCalendarAPI demonstrates Day-count and Calendar API FUnctionality. It does the following:

·        Get all the holiday locations in CreditAnalytics, and all the holidays in the year according the calendar set

·        Get all the week day/weekend holidays in the year according the calendar set

·        Calculate year fraction between 2 dates according to semi-annual, Act/360, and USD calendar

·        Adjust the date FORWARD according to the USD calendar

·        Roll to the PREVIOUS date according to the USD calendar

 

 

FXAPI

 

FXAPI contains a demo of the FX API Sample. It shows the following:

·        Create a currency pair, FX SPot, and FX Forward

·        Calculate the FX forward PIP/outright

·        Calculate the DC Basis on the domestic and the foreign curves

·        Create an FX curve from the spot, and the array of nodes, FX forward, as well as the PIP indicator

·        Calculate the array of the domestic/foreign basis

·        Calculate the array of bootstrapped domestic/foreign basis

·        Re-imply the array of FX Forward from domestic/foreign Basis Curve


DRIP Samples: Bloomberg

 

 

The Bloomberg Sample functions are available in the package org.drip.sample.bloomberg. The Bloomberg Sample Package implements the Bloomberg’s calls CDSW, SWPM, and YAS.

 

Functionality in this package is implemented over 3 classes - CDSW, SWPM, and YAS.

 

 

CDSW

 

CDSW replicates Bloomberg’s CDSW functionality.

 

 

SWPM

 

SWPM replicates Bloomberg’s SWPM functionality.

 

 

YAS

 

YAS replicates Bloomberg’s YAS functionality.