Main Content

Heston

Create Heston model object for Vanilla, Asian, Barrier, DoubleBarrier, Lookback, VarianceSwap, Touch, DoubleTouch, or Binary instrument

Description

Create and price a Vanilla, Asian, Barrier, DoubleBarrier, Lookback, VarianceSwap, Touch, DoubleTouch, or Binary instrument object with a Heston model using this workflow:

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

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

  3. Use finpricer to specify a FiniteDifference, NumericalIntegration, or FFT pricing method for the Vanilla instrument.

    Use finpricer to specify an AssetMonteCarlo pricing method for the Vanilla, Asian, BarrierDoubleBarrier, Lookback, VarianceSwap, 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 pricing methods for a Vanilla, AsianBarrier, DoubleBarrier, Lookback, VarianceSwap, Touch, DoubleTouch, or Binary instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

example

HestonModelObj = finmodel(ModelType,'V0'v0_value,'ThetaV',thetav_value,'Kappa',kappa_value,'SigmaV',sigmav_value,'RhoSV',rhosv_value) creates a Black model object by specifying ModelType and the required name-value pair arguments V0, ThetaV, Kappa, SigmaV, and RhoSV to set properties using required name-value pair arguments. For example, HestonModelObj = finmodel("Heston",'V0',0.032,'ThetaV',0.1,'Kappa',0.003,'SigmaV',0.2,'RhoSV',0.9) creates a Heston model object.

Input Arguments

expand all

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

Data Types: char | string

Heston Name-Value Pair Arguments

Specify required 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: HestonModelObj = finmodel("Heston",'V0',0.032,'ThetaV',0.1,'Kappa',0.003,'SigmaV',0.2,'RhoSV',0.9)

Initial variance of the underlying asset, specified as the comma-separated pair consisting of 'V0' and a scalar numeric value.

Data Types: double

Long-term variance of the underlying asset, specified as the comma-separated pair consisting of 'ThetaV' and a scalar numeric value.

Data Types: double

Mean revision speed for the underlying asset, specified as the comma-separated pair consisting of 'Kappa' and a scalar numeric value.

Data Types: double

Volatility of the variance of the underlying asset, specified as the comma-separated pair consisting of 'SigmaV' and a scalar numeric value.

Data Types: double

Correlation between the Weiner processes for the underlying asset and its variance, specified as the comma-separated pair consisting of 'RhoSV' and a scalar numeric value.

Data Types: double

Properties

expand all

Initial variance of the underlying asset, returned as a scalar numeric value.

Data Types: double

Long-term variance of the underlying asset, returned as a scalar numeric value.

Data Types: double

Mean revision speed for the underlying asset, returned as a scalar numeric value.

Data Types: double

Volatility of the variance of the underlying asset, returned as a scalar numeric value.

Data Types: double

Correlation between the Weiner processes for the underlying asset and its variance, returned as a scalar numeric value.

Data Types: double

Examples

collapse all

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

Create Vanilla Instrument Object

Use fininstrument to create a Vanilla instrument object.

VanillaOpt = fininstrument("Vanilla",'ExerciseDate',datetime(2022,9,15),'Strike',105,'ExerciseStyle',"european",'Name',"vanilla_option")
VanillaOpt = 
  Vanilla with properties:

       OptionType: "call"
    ExerciseStyle: "european"
     ExerciseDate: 15-Sep-2022
           Strike: 105
             Name: "vanilla_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.2,'RhoSV',0.9)
HestonModel = 
  Heston with properties:

        V0: 0.0320
    ThetaV: 0.1000
     Kappa: 0.0030
    SigmaV: 0.2000
     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 FFT Pricer Object

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

outPricer = finpricer("FFT",'DiscountCurve',myRC,'Model',HestonModel,'SpotPrice',100,'CharacteristicFcnStep', 0.2,'NumFFT',2^13)
outPricer = 
  FFT with properties:

                    Model: [1x1 finmodel.Heston]
            DiscountCurve: [1x1 ratecurve]
                SpotPrice: 100
             DividendType: "continuous"
            DividendValue: 0
                   NumFFT: 8192
    CharacteristicFcnStep: 0.2000
            LogStrikeStep: 0.0038
        CharacteristicFcn: @characteristicFcnHeston
            DampingFactor: 1.5000
               Quadrature: "simpson"
           VolRiskPremium: 0
               LittleTrap: 1

Price Vanilla Instrument

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

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

       Results: [1x7 table]
    PricerData: []

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

    14.754    0.44868    0.021649    -0.20891    120.45    88.192    1.3248

This example shows the workflow to price a LookBack instrument when you use a Heston model and an AssetMonetCarlo pricing method.

Create Lookback Instrument Object

Use fininstrument to create a Lookback instrument object.

LookbackOpt = fininstrument("Lookback",'Strike',105,'ExerciseDate',datetime(2022,9,15),'OptionType',"put",'ExerciseStyle',"american",'Name',"lookback_option")
LookbackOpt = 
  Lookback with properties:

       OptionType: "put"
           Strike: 105
      AssetMinMax: NaN
    ExerciseStyle: "american"
     ExerciseDate: 15-Sep-2022
             Name: "lookback_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.08,'RhoSV',0.9)
HestonModel = 
  Heston with properties:

        V0: 0.0320
    ThetaV: 0.1000
     Kappa: 0.0030
    SigmaV: 0.0800
     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',90,'simulationDates',datetime(2022,9,15))
outPricer = 
  HestonMonteCarlo with properties:

      DiscountCurve: [1x1 ratecurve]
          SpotPrice: 90
    SimulationDates: 15-Sep-2022
          NumTrials: 1000
      RandomNumbers: []
              Model: [1x1 finmodel.Heston]
       DividendType: "continuous"
      DividendValue: 0

Price Lookback Instrument

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

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

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

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

    21.973    -0.7701      0      -3.1542    -215.94    0.28812    99.825    1.447 

Introduced in R2020a