Main Content

Heston

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

Description

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

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

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

  3. Choose a pricing method.

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, PartialLookback, VarianceSwap, Touch, DoubleTouch, Cliquet, or Binary instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

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.

example

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

Name-Value Arguments

expand all

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: 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 Wiener 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

Output Arguments

expand all

Heston model, returned as a Heston object.

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 Wiener 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: [1×1 finmodel.Heston]
            DiscountCurve: [1×1 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: [1×7 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: [1×1 ratecurve]
               SpotPrice: 90
         SimulationDates: 15-Sep-2022
               NumTrials: 1000
           RandomNumbers: []
                   Model: [1×1 finmodel.Heston]
            DividendType: "continuous"
           DividendValue: 0
        MonteCarloMethod: "standard"
    BrownianMotionMethod: "standard"

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: [1×8 table]
    PricerData: [1×1 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 

Since R2026a

This example shows the workflow to price a Vanilla instrument when using a Heston model and an AssetReinforcementLearning pricing method. Note, to use this functionality, you must have Reinforcement Learning Toolbox™ installed.

Create Vanilla Instrument Object

Use fininstrument to create a Vanilla instrument object.

VanillaOpt = fininstrument("Vanilla",ExerciseDate=datetime(2021,8,15),Strike=110,OptionType="put",ExerciseStyle="american",Name="vanilla_option")
VanillaOpt = 
  Vanilla with properties:

       OptionType: "put"
    ExerciseStyle: "american"
     ExerciseDate: 15-Aug-2021
           Strike: 110
             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.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 ratecurve object using ratecurve.

Settle = datetime(2019,1,1);
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: [10×1 datetime]
                Rates: [10×1 double]
               Settle: 01-Jan-2019
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create AssetReinforcementLearning Pricer Object

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

SpotPrice = 100;
SimDates = [Settle+days(1):days(2):Settle+years(2)];

outPricer = finpricer("AssetReinforcementLearning",DiscountCurve=myRC,Model=HestonModel,SpotPrice=SpotPrice,SimulationDates=SimDates)
outPricer = 
  AssetReinforcementLearning with properties:

      DiscountCurve: [1×1 ratecurve]
          SpotPrice: 100
    SimulationDates: [02-Jan-2019    04-Jan-2019    06-Jan-2019    08-Jan-2019    10-Jan-2019    12-Jan-2019    14-Jan-2019    16-Jan-2019    18-Jan-2019    20-Jan-2019    22-Jan-2019    24-Jan-2019    26-Jan-2019    28-Jan-2019    …    ] (1×365 datetime)
          NumTrials: 1000
              Model: [1×1 finmodel.Heston]
       DividendType: "continuous"
      DividendValue: 0

Price Vanilla Instrument

Use price to compute the price for the Vanilla instrument.

[Price,priceResultData] = price(outPricer,VanillaOpt)
Price = 
15.5194
priceResultData = 
  priceresult with properties:

       Results: [1×1 table]
    PricerData: [1×1 struct]

priceResultData.PricerData
ans = struct with fields:
    SimulationTimes: [366×1 timetable]
              Paths: [366×2×1000 double]
      TrainingStats: [1×1 rl.train.result.rlTrainingResult]
              Agent: [1×1 rl.agent.rlLSPIAmericanOptionAgent]

More About

expand all

References

[1] Heston, S. L. “A Closed-Form Solution for Options with Stochastic Volatility with Applications to Bond and Currency Options.” The Review of Financial Studies. Vol 6, Number 2, 1993.

Version History

Introduced in R2020a

expand all