Main Content

AssetMonteCarlo

Create AssetMonteCarlo pricer object for equity instruments using BlackScholes, Merton, Heston, or Bates model

Description

Create and price a Vanilla, Barrier, Lookback, Asian, Spread, DoubleBarrier, Touch, DoubleTouch, Binary instrument object with a BlackScholes, Merton, Heston, or Bates model and a AssetMonteCarlo pricing method using this workflow:

  1. Use fininstrument to create a Vanilla, Barrier, Lookback, Asian, Spread, DoubleBarrier, Binary, Touch, or DoubleTouch instrument object.

  2. Use finmodel to specify a BlackScholes model for the Vanilla, Barrier, Lookback, Asian, Spread, DoubleBarrier, Touch, DoubleTouch, or Binary instrument.

    Use finmodel to specify a Merton, Bates, or Heston model for the Vanilla, Barrier, Lookback, Asian, DoubleBarrier, Touch, DoubleTouch, or Binary instrument.

  3. Use finpricer to specify a AssetMonteCarlo pricer object for the Vanilla, Barrier, Lookback, Asian, Spread, DoubleBarrier, Touch, DoubleTouch, or Binary instrument.

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 Vanilla, Barrier, Lookback, Asian, Spread, DoubleBarrier, Touch, DoubleTouch, or Binary instruments, see Choose Instruments, Models, and Pricers.

Creation

Description

example

AssetMonteCarloPricerObj = finpricer(PricerType,'Model',model,'DiscountCurve',ratecurve_obj,'SpotPrice',spotprice_value,'SimulationDates',simulation_dates,) creates a AssetMonteCarlo pricer object by specifying PricerType and sets the properties using the required name-value pair arguments Model, DiscountCurve, SpotPrice, and SimulationDates.

example

AssetMonteCarloPricerObj = finpricer(___,Name,Value) sets optional properties using additional name-value pairs in addition to the required arguments in the previous syntax. For example, AssetMonteCarloPricerObj = finpricer("assetmontecarlo",'Model',BSModel,'DiscountCurve',ratecurve_obj,'SpotPrice',1000,'SimulationDates',[datetime(2018,1,30); datetime(2019,1,30)],'NumTrails',500,'DividendType','continuous','DividendValue',0.3) creates an AssetMonteCarlo pricer object using a BlackScholes model. You can specify multiple name-value pair arguments.

Input Arguments

expand all

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

Data Types: char | string

AssetMonteCarlo Name-Value Pair Arguments

Specify required and optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: AssetMonteCarloPricerObj = finpricer("assetmontecarlo",'Model',BSModel,'DiscountCurve',ratecurve_obj,'SpotPrice',1000,'SimulationDates',[datetime(2018,1,30); datetime(2019,1,30)],'NumTrails',500,'DividendType','continuous','DividendValue',0.3)
Required AssetMonteCarlo Name-Value Pair Arguments

expand all

Model object, specified as the comma-separated pair consisting of 'Model' and a scalar character vector or string containing the name of a previously created BlackScholes, Merton, Bates, or Heston model object. Create the model object using finmodel.

Data Types: object

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

Note

Specify a flat ratecurve object for DiscountCurve. If you use a nonflat ratecurve object, the software uses the rate in the ratecurve object at Maturity and assumes that the value is constant for the life of the equity option.

Data Types: object

Current price of the underlying asset, specified as the comma-separated pair consisting of 'SpotPrice' and a scalar nonnegative numeric.

Data Types: double

Simulation dates, specified as the comma-separated pair consisting of 'SimulationDates' and a scalar serial date number, date character vector, or datetime or a vector of serial date numbers, cell array of character vectors, string array, or datetime array.

Data Types: double | char | string | cell | datetime

Optional AssetMonteCarlo Name-Value Pair Arguments

expand all

Simulation trials, specified as the comma-separated pair consisting of 'NumTrials' and a scalar number of independent sample paths.

Data Types: double

Dependent random variates, specified as the comma-separated pair consisting of 'RandomNumbers' and an NSimulationDates-by-NBrownians-by-NTrials 3D time series array. The 3D time series array has the following fields:

  • ZNSimulationDates-by-NBrownians-by-NTrials 3D time series array of dependent random variates used to generate the Brownian motion vector (that is, Wiener processes) that drive the simulation.

  • NNSimulationDates-by-NBrownians-by-NTrials 3D time series array of dependent random variates used as the number of jumps.

  • SizeJNSimulationDates-by-NBrownians-by-NTrials 3D time series array of dependent random variates used as the jump sizes.

Note

BlackScholes and Heston models only require Z field.

Data Types: struct

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

Data Types: char | string

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

Note

Specify a scalar if DividendType is "continuous" and a timetable if DividendType is "cash".

Data Types: double | timetable

Properties

expand all

Model object, returned as an object.

Data Types: object

This property is read-only.

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

Data Types: object

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

Data Types: double

Simulation dates, returned as a datetime array.

Data Types: datetime

Simulation trials, returned as a scalar number of independent sample paths.

Data Types: double

Dependent random variates, returned as an NSimulationDates-by-NBrownians-by-NTrials 3D time series array.

Data Types: struct

Calculation for the early exercise premium, returned as a scalar function handle. The default @longstaffschwartz_cubic uses the Longstaff-Schwartz least squares method.

Data Types: function_handle

This property is read-only.

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 yield or dividend schedule for the underlying stock, returned as a scalar numeric for a dividend yield or a timetable for a dividend schedule.

Data Types: double | timetable

Object Functions

priceCompute price for Vanilla, Barrier, Lookback, Asian, Spread, DoubleBarrier, Touch, DoubleTouch, or Binary instrument with AssetMonteCarlo pricer

Examples

collapse all

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

Create DoubleBarrier Instrument Object

Use fininstrument to create a DoubleBarrier instrument object.

DoubleBarrierOpt = fininstrument("DoubleBarrier",'Strike',100,'ExerciseDate',datetime(2020,8,15),'OptionType',"call",'ExerciseStyle',"american",'BarrierType',"DKO",'BarrierValue',[110 80],'Name',"doublebarrier_option")
DoubleBarrierOpt = 
  DoubleBarrier with properties:

       OptionType: "call"
           Strike: 100
     BarrierValue: [110 80]
    ExerciseStyle: "american"
     ExerciseDate: 15-Aug-2020
      BarrierType: "dko"
           Rebate: [0 0]
             Name: "doublebarrier_option"

Create BlackScholes Model Object

Use finmodel to create a BlackScholes model object.

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

     Volatility: 0.3000
    Correlation: 1

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

Settle = datetime(2017,9,15);
Maturity = datetime(2023,9,15);
Rate = 0.035;
myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',12)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 12
                Dates: 15-Sep-2023
                Rates: 0.0350
               Settle: 15-Sep-2017
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create AssetMonteCarlo Pricer Object

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

ExerciseDate = datetime(2020,08,15);
Settle = datetime(2017,9,15);
outPricer = finpricer("AssetMonteCarlo","DiscountCurve",myRC,"Model",BlackScholesModel,'SpotPrice',100,'simulationDates', Settle+days(1):days(1):ExerciseDate);

Price DoubleBarrier Instrument

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

[Price, outPR] = price(outPricer,DoubleBarrierOpt,"all")
Price = 6.9563
outPR = 
  priceresult with properties:

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

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

    6.9563    0.23644    -0.11701    3.399     0.14976    -99.727    -8.344

This example shows the workflow to price a fixed-strike Asian instrument when you use a Heston model and an AssetMonteCarlo pricing method.

Create Asian Instrument Object

Use fininstrument to create an Asian instrument object.

AsianOpt = fininstrument("Asian",'ExerciseDate',datetime(2022,9,15),'Strike',100,'OptionType',"put",'Name',"asian_option")
AsianOpt = 
  Asian with properties:

          OptionType: "put"
              Strike: 100
         AverageType: "arithmetic"
        AveragePrice: 0
    AverageStartDate: NaT
       ExerciseStyle: "european"
        ExerciseDate: 15-Sep-2022
                Name: "asian_option"

Create Heston Model Object

Use finmodel to create a Heston model object.

HestonModel = finmodel("Heston",'V0',0.032,'ThetaV',0.1,'Kappa',0.003,'SigmaV',0.02,'RhoSV',0.9)
HestonModel = 
  Heston with properties:

        V0: 0.0320
    ThetaV: 0.1000
     Kappa: 0.0030
    SigmaV: 0.0200
     RhoSV: 0.9000

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

Settle = datetime(2018,9,15);
Maturity = datetime(2023,9,15);
Rate = 0.035;
myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',12)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 12
                Dates: 15-Sep-2023
                Rates: 0.0350
               Settle: 15-Sep-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create AssetMonteCarlo Pricer Object

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

outPricer = finpricer("AssetMonteCarlo",'DiscountCurve',myRC,"Model",HestonModel,'SpotPrice',80,'simulationDates',Settle+calmonths(1):calmonths(1):datetime(2022,9,15))
outPricer = 
  HestonMonteCarlo with properties:

      DiscountCurve: [1x1 ratecurve]
          SpotPrice: 80
    SimulationDates: [1x48 datetime]
          NumTrials: 1000
      RandomNumbers: []
              Model: [1x1 finmodel.Heston]
       DividendType: "continuous"
      DividendValue: 0

Price Asian Instrument

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

[Price, outPR] = price(outPricer,AsianOpt,"all")
Price = 14.7999
outPR = 
  priceresult with properties:

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

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

    14.8     -0.71073    0.023453    -3.8418    -173.12    0.61794    27.992    0.15319

Introduced in R2020b