# FFT

Create `FFT` pricer object for `Vanilla` instrument using `Merton`, `Heston`, or `Bates` model

## Description

Create and price a `Vanilla` instrument object with a `Heston`, `Bates`, or `Merton` model and an `FFT` pricing method using this workflow:

1. Use `fininstrument` to create a `Vanilla` instrument object.

2. Use `finmodel` to specify a `Heston`, `Bates`, or `Merton` model for the `Vanilla` instrument.

3. Use `finpricer` to specify an `FFT` pricer object for the `Vanilla` 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` instrument, see Choose Instruments, Models, and Pricers.

## Creation

### Syntax

``FFTPricerObj = finpricer(PricerType,'Model',model,'DiscountCurve',ratecurve_obj)``
``FFTPricerObj = finpricer(___,Name,Value)``

### Description

example

````FFTPricerObj = finpricer(PricerType,'Model',model,'DiscountCurve',ratecurve_obj)` creates an `FFT` pricer object by specifying `PricerType` and sets the properties for the required name-value pair arguments `Model` and `DiscountCurve`.```

example

````FFTPricerObj = finpricer(___,Name,Value)` sets optional properties using additional name-value pairs in addition to the required arguments in the previous syntax. For example, ```FFTPricerObj = finpricer("FFT",'Model',FFTModel, 'DiscountCurve',ratecurve_obj,'SpotPrice',1000,'DividendValue',0.01,'VolRiskPremium',0.9)``` creates an `FFT` pricer object. You can specify multiple name-value pair arguments.```

### Input Arguments

expand all

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

Data Types: `char` | `string`

`FFT` 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: ```FFTPricerObj = finpricer("FFT",'Model',FFTModel, 'DiscountCurve',ratecurve_obj,'SpotPrice',1000,'DividendValue',0.01,'VolRiskPremium',0.9)```
Required `FFT` Name-Value Pair Arguments

expand all

Model, specified as the comma-separated pair consisting of `'Model'` and the name of the previously created `Merton`, `Bates`, or `Heston` 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 the `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`

Optional `FFT` Name-Value Pair Arguments

expand all

Dividend yield, specified as the comma-separated pair consisting of `'DividendValue'` and a scalar nonnegative numeric in decimals.

Data Types: `double`

Volatility risk premium, specified as the comma-separated pair consisting of `'VolRiskPremium'` and a scalar numeric value.

Data Types: `double`

Flag indicating Little Heston Trap formulation by Albrecher et al., specified as the comma-separated pair consisting of `'LittleTrap'` and a logical:

Note

`LittleTrap` is supported only for `Heston` and `Bates` models.

Data Types: `logical`

Number of grid points in the characteristic function variable and in each column of the log-strike grid, specified as the comma-separated pair consisting of `'NumFFT'` and a scalar numeric value.

Data Types: `double`

Characteristic function variable grid spacing, specified as the comma-separated pair consisting of `'CharacteristicFcnStep'` and a scalar numeric value.

Data Types: `double`

Log-strike grid spacing, specified as the comma-separated pair consisting of `'LogStrikeStep'` and a scalar numeric value.

Note

If (`LogStrikeStep`*`CharacteristicFcnStep`) is `2*pi`/`NumFFT`, FFT is used. Otherwise, FRFT is used.

Data Types: `double`

Damping factor for the Carr-Madan formulation, specified as the comma-separated pair consisting of `'DampingFactor'` and a scalar numeric value.

Data Types: `double`

Type of quadrature, specified as the comma-separated pair consisting of `'Quadrature'` and a scalar string or character vector.

Data Types: `char` | `string`

## Properties

expand all

Model, returned as a model object.

Data Types: `object`

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

Data Types: `double`

Dividend yield, returned as a scalar nonnegative numeric in decimals.

Data Types: `double`

Volatility risk premium, returned as a scalar numeric value.

Data Types: `double`

Flag indicating Little Heston Trap formulation by Albrecher et al., returned as a logical.

Data Types: `logical`

Number of grid points in the characteristic function variable and in each column of the log-strike grid, returned as a scalar numeric value.

Data Types: `double`

Characteristic function variable grid spacing, returned as a scalar numeric value.

Data Types: `double`

Log-strike grid spacing, returned as a scalar numeric value.

Data Types: `double`

Damping factor for the Carr-Madan formulation, returned as a scalar numeric value.

Data Types: `double`

Type of quadrature, returned as a string.

Data Types: `string`

## Object Functions

 `price` Compute price for equity instrument with `FFT` pricer

## 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 ```

expand all

## References

[1] Albrecher, H., P. Mayer, W. Schoutens, and J. Tistaert. “The Little Heston Trap.” Working Paper, Linz and Graz University of Technology, K.U. Leuven, ING Financial Markets, 2006.