Main Content

AssetTree

Create AssetTree pricer object for Vanilla, Barrier, Asian, or Lookback instrument

Since R2021a

Description

Create and price a Vanilla, Barrier, Asian, or Lookback instrument object with a BlackScholes model and an AssetTree pricing method using this workflow:

  1. Use fininstrument to create a Vanilla, Lookback, Barrier, or Asian instrument object.

  2. Use finmodel to specify a BlackScholes model for the Vanilla, Barrier, Asian, or Lookback instrument object.

  3. Use finpricer to specify an AssetTree pricer object for a Cox-Ross-Rubinstein (CRR), equal-probability (EQP), Leisen-Reimer (LR), or Standard Trinomial (ST) lattice tree model for the Vanilla, Barrier, Asian, or Lookback instrument object.

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 Vanilla, Barrier, Asian, or Lookback instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

example

AssetTreePricerObj = finpricer(PricerType,'Model',model_type,'DiscountCurve',ratecurve_obj,'SpotPrice',spot_price) creates an AssetTree pricer object by specifying PricerType and the required name-value pair arguments for Model, DiscountCurve, and SpotPrice.

example

AssetTreePricerObj = finpricer(___,Name,Value) sets optional properties using additional name-value pair arguments in addition to the required arguments in the previous syntax. For example, AssetTreePricerObj = finpricer("AssetTree",'Model',BlackScholes,'DiscountCurve',ratecure_obj,'SpotPrice',1000) creates an AssetTree pricer object.

Input Arguments

expand all

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

Data Types: char | string

Name-Value Arguments

Specify required and optional 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: AssetTreePricerObj = finpricer("AssetTree",'Model',BlackScholes,'DiscountCurve',ratecure_obj,'SpotPrice',1000)

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

Data Types: object

This property is read-only.

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

Data Types: object

Underlying spot price, specified as the comma-separated pair consisting of 'SpotPrice' and a scalar numeric.

Data Types: double

Optional AssetTree Name-Value Pair Arguments

expand all

Asset pricing method, specified as the comma-separated pair consisting of 'PricingMethod' and a string or character vector.

Data Types: char | string

Maturity date, specified as the comma-separated pair consisting of 'Maturity' and a scalar datetime, string, or date character vector.

To support existing code, AssetTree also accepts serial date numbers as inputs, but they are not recommended.

If you use a date character vector or string, the format must be recognizable by datetime because the Maturity property is stored as a datetime.

Number of levels or time steps of the tree, specified as the comma-separated pair consisting of 'NumPeriods' and a scalar.

Data Types: double

Stock dividend type, specified as the comma-separated pair consisting of 'DividendType' and a string or character vector. DividendType must be "cash" for actual dollar dividends or "continuous" for a continuous dividend yield.

Data Types: char | string

Dividend amount or dividend schedule for the underlying stock, specified as the comma-separated pair consisting of 'DividendValue' and a scalar numeric for a dividend amount or a timetable for a dividend schedule.

Note

DividendValue must be a scalar for a "continuous" DividendType or a timetable for "cash" DividendType.

Data Types: double | timetable

Option strike used with the Leisen-Reimer pricing method, specified as the comma-separated pair consisting of 'Strike' and a scalar nonnegative numeric.

Data Types: double

Inversion method for the Leisen-Reimer pricing method, specified as the comma-separated pair consisting of 'InversionMethod' and a string or character vector.

  • 'PP1' — Peizer-Pratt method 1 inversion

  • 'PP2' — Peizer-Pratt method 2 inversion

Data Types: string | char

Properties

expand all

Inversion method for the Leisen-Reimer pricing method, returned as a string.

Data Types: string

Option strike used with the Leisen-Reimer pricing method, returned as a nonnegative numeric.

Data Types: double

CRR, EQP, LR binomial tree or STT trinomial tree, returned as a structure with the following properties:

  • Probs contains a 2-by-NumLevels numeric array with the up and down probabilities that apply to each level of the tree except for the last one. All nodes in a given level share the same up and down probabilities. The columns of the Probs array are ordered from the root node. The first row of the array corresponds to the probability of an up move, while the second row corresponds to a down move.

  • ATree contains the price tree for the underlying asset.

  • dObs contains the date of each level of the tree.

  • tObs contains the time factor of each level of the tree.

Data Types: struct

Number of levels or time steps of the tree, returned as a numeric.

Data Types: datetime

Model type, returned as an object.

Data Types: object

This property is read-only.

ratecurve object for creating the AssetTree object and discounting cash flows, returned as a ratecurve object.

Data Types: object

Current price of the underlying asset, returned as a scalar nonnegative numeric.

Data Types: double

This property is read-only.

Stock dividend type, returned as a string. DividendType is either "cash" for actual dollar dividends or "continuous" for a continuous dividend yield.

Data Types: string

Dividend amount or dividend schedule for the underlying stock, returned as a scalar nonnegative numeric for a dividend yield or a timetable for a dividend schedule.

Data Types: double | timetable

Tree dates, returned as a scalar datetime or datetime array.

Data Types: datetime

Object Functions

priceCompute price for equity instrument with AssetTree pricer

Examples

collapse all

This example shows the workflow to price a Vanilla instrument when you use a BlackScholes model and an AssetTree pricing method.

Create Vanilla Instrument Object

Use fininstrument to create a Vanilla instrument object.

VanillaOpt = fininstrument("Vanilla",'ExerciseDate',datetime(2019,5,1),'Strike',29,'OptionType',"put",'ExerciseStyle',"european",'Name',"vanilla_option")
VanillaOpt = 
  Vanilla with properties:

       OptionType: "put"
    ExerciseStyle: "european"
     ExerciseDate: 01-May-2019
           Strike: 29
             Name: "vanilla_option"

Create BlackScholes Model Object

Use finmodel to create a BlackScholes model object.

BlackScholesModel = finmodel("BlackScholes",'Volatility',0.25)
BlackScholesModel = 
  BlackScholes with properties:

     Volatility: 0.2500
    Correlation: 1

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

Settle = datetime(2018,1,1);
Maturity = datetime(2020,1,1);
Rate = 0.035;
myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',1)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 1
                Dates: 01-Jan-2020
                Rates: 0.0350
               Settle: 01-Jan-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create AssetTree Pricer Object

Use finpricer to create an AssetTree pricer object for an LR equity tree and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

LRPricer = finpricer("AssetTree",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',30,'PricingMethod',"LeisenReimer",'Maturity',datetime(2019,5,1),'NumPeriods',15)
LRPricer = 
  LRTree with properties:

    InversionMethod: PP1
             Strike: 30
               Tree: [1x1 struct]
         NumPeriods: 15
              Model: [1x1 finmodel.BlackScholes]
      DiscountCurve: [1x1 ratecurve]
          SpotPrice: 30
       DividendType: "continuous"
      DividendValue: 0
          TreeDates: [02-Feb-2018 08:00:00    06-Mar-2018 16:00:00    08-Apr-2018 00:00:00    10-May-2018 08:00:00    11-Jun-2018 16:00:00    14-Jul-2018 00:00:00    15-Aug-2018 08:00:00    16-Sep-2018 16:00:00    ...    ] (1x15 datetime)

Price Vanilla Instrument

Use price to compute the price and sensitivities for the Vanilla instrument.

[Price, outPR] = price(LRPricer,VanillaOpt,"all")
Price = 2.2542
outPR = 
  priceresult with properties:

       Results: [1x7 table]
    PricerData: [1x1 struct]

outPR.Results
ans=1×7 table
    Price      Delta       Gamma       Vega     Lambda      Rho       Theta  
    ______    ________    ________    ______    ______    _______    ________

    2.2542    -0.33628    0.044039    12.724    -4.469    -16.433    -0.76073

This example shows the workflow to price a Vanilla instrument when you use a BlackScholes model and an AssetTree pricing method for a Standard Trinomial (STT) tree.

Create Vanilla Instrument Object

Use fininstrument to create a Vanilla instrument object.

VanillaOpt = fininstrument("Vanilla",'ExerciseDate',datetime(2019,5,1),'Strike',29,'OptionType',"put",'ExerciseStyle',"european",'Name',"vanilla_option")
VanillaOpt = 
  Vanilla with properties:

       OptionType: "put"
    ExerciseStyle: "european"
     ExerciseDate: 01-May-2019
           Strike: 29
             Name: "vanilla_option"

Create BlackScholes Model Object

Use finmodel to create a BlackScholes model object.

BlackScholesModel = finmodel("BlackScholes",'Volatility',0.25)
BlackScholesModel = 
  BlackScholes with properties:

     Volatility: 0.2500
    Correlation: 1

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

Settle = datetime(2018,1,1);
Maturity = datetime(2020,1,1);
Rate = 0.035;
myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',1)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 1
                Dates: 01-Jan-2020
                Rates: 0.0350
               Settle: 01-Jan-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create AssetTree Pricer Object

Use finpricer to create an AssetTree pricer object for an Standard Trinomial equity tree and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

STTPricer = finpricer("AssetTree",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',30,'PricingMethod',"StandardTrinomial",'Maturity',datetime(2019,5,1),'NumPeriods',15)
STTPricer = 
  STTree with properties:

             Tree: [1x1 struct]
       NumPeriods: 15
            Model: [1x1 finmodel.BlackScholes]
    DiscountCurve: [1x1 ratecurve]
        SpotPrice: 30
     DividendType: "continuous"
    DividendValue: 0
        TreeDates: [02-Feb-2018 08:00:00    06-Mar-2018 16:00:00    08-Apr-2018 00:00:00    10-May-2018 08:00:00    11-Jun-2018 16:00:00    14-Jul-2018 00:00:00    15-Aug-2018 08:00:00    16-Sep-2018 16:00:00    ...    ] (1x15 datetime)

Price Vanilla Instrument

Use price to compute the price and sensitivities for the Vanilla instrument.

[Price, outPR] = price(STTPricer,VanillaOpt,"all")
Price = 2.2826
outPR = 
  priceresult with properties:

       Results: [1x7 table]
    PricerData: [1x1 struct]

outPR.Results
ans=1×7 table
    Price      Delta      Gamma      Vega     Lambda       Rho       Theta  
    ______    _______    ________    _____    _______    _______    ________

    2.2826    -0.2592    0.030949    12.51    -3.8981    -16.516    -0.73845

References

[1] Hull, John, and Alan White. “The General Hull–White Model and Supercalibration.” Financial Analysts Journal, 57, no. 6, (November 2001): 34–43.

Version History

Introduced in R2021a

expand all