Main Content

HullWhite

Create HullWhite pricer object for Cap, Floor, or Swaption instrument using HullWhite model

Since R2020a

Description

Create and price a Cap, Floor, or Swaption instrument object with a HullWhite model and a HullWhite pricing method using this workflow:

  1. Use fininstrument to create a Cap, Floor, or Swaption instrument object.

  2. Use finmodel to specify the HullWhite model for the Cap, Floor, or Swaption instrument object.

  3. Use finpricer to specify the HullWhite pricer object for the Cap, Floor, or Swaption instrument object.

    Note

    If you do not specify ProjectionCurve when you create a Cap, Floor, or Swaption instrument with the HullWhite pricer, the ProjectionCurve value defaults to the DiscountCurve value.

For more information on this workflow, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

For more information on the available instruments, models, and pricing methods for a Cap, Floor, or Swaption instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

HullWhitePricerObj = finpricer(PricerType,'DiscountCurve',ratecurve_obj,'Model',model) creates a HullWhite pricer object by specifying PricerType and the required name-value pair arguments DiscountCurve and Model to set properties using name-value pairs. For example, HullWhitePricerObj = finpricer("Analytic",'DiscountCurve',ratecurve_obj,'Model',HWModel) creates a HullWhite pricer object.

example

Input Arguments

expand all

Pricer type, specified as a string with the value of "Analytic" or a character vector with the value of 'Analytic'.

Data Types: char | string

Name-Value Arguments

Specify required pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: HullWhitePricerObj = finpricer("Analytic",'DiscountCurve',ratecurve_obj,'Model',HWModel)

ratecurve object for discounting cash flows, specified as the comma-separated pair consisting of 'DiscountCurve' and the name of a previously created ratecurve object.

Data Types: object

Model object, specified as the comma-separated pair consisting of 'Model' and the name of the previously created HullWhite model object using finmodel.

Data Types: object

Properties

expand all

ratecurve object for discounting cash flows, returned as a ratecurve object.

Data Types: object

Model, returned as a HullWhite model object.

Data Types: object

Object Functions

priceCompute price for interest-rate, equity, or credit derivative instrument with Analytic pricer

Examples

collapse all

This example shows the workflow to price a Floor instrument when you use a HullWhite model and a HullWhite pricing method.

Create Floor Instrument Object

Use fininstrument to create a Floor instrument object.

FloorOpt = fininstrument("Floor",'Strike',0.02,'Maturity',datetime(2019,1,30),'Reset',4,'Principal',100,'Basis',8,'Name',"floor_option")
FloorOpt = 
  Floor with properties:

                      Strike: 0.0200
                    Maturity: 30-Jan-2019
                 ResetOffset: 0
                       Reset: 4
                       Basis: 8
                   Principal: 100
             ProjectionCurve: [0x0 ratecurve]
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                        Name: "floor_option"

Create HullWhite Model Object

Use finmodel to create a HullWhite model object.

HullWhiteModel = finmodel("HullWhite",'Alpha',0.032,'Sigma',0.04)
HullWhiteModel = 
  HullWhite with properties:

    Alpha: 0.0320
    Sigma: 0.0400

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,9,15);
Type = "zero";
ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
 
myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 0
                Dates: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create HullWhite Pricer Object

Use finpricer to create a HullWhite pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

outPricer = finpricer("analytic",'Model',HullWhiteModel,'DiscountCurve',myRC)
outPricer = 
  HullWhite with properties:

    DiscountCurve: [1x1 ratecurve]
            Model: [1x1 finmodel.HullWhite]

Price Floor Instrument

Use price to compute the price for the Floor instrument.

Price = price(outPricer,FloorOpt)
Price = 
0.5809

Version History

Introduced in R2020a