lookbacksensbyls

Calculate prices and sensitivities of lookback options using Longstaff-Schwartz model

Syntax

• ```[PriceSens,Paths,Times,Z] = lookbacksensbyls(RateSpec,StockSpec,OptSpec,Strike,Settle,ExerciseDates)``` example
• ```[PriceSens,Paths,Times,Z] = lookbacksensbyls(___,Name,Value)```

Description

example

``````[PriceSens,Paths,Times,Z] = lookbacksensbyls(RateSpec,StockSpec,OptSpec,Strike,Settle,ExerciseDates)``` returns prices and sensitivities of lookback options using the Longstaff-Schwartz model for Monte Carlo simulations. `lookbacksensbyls` computes prices of European and American lookback options. For American options, the Longstaff-Schwartz least squares method calculates the early exercise premium. `lookbacksensbyls` calculates values of fixed- and floating-strike lookback options. To compute the value of a floating-strike lookback option, `Strike` must be specified as `NaN`. ```
``````[PriceSens,Paths,Times,Z] = lookbacksensbyls(___,Name,Value)``` returns prices and sensitivities of lookback options using the Longstaff-Schwartz model for Monte Carlo simulations with optional name-value pair arguments. `lookbacksensbyls` computes prices of European and American lookback options. For American options, the Longstaff-Schwartz least squares method calculates the early exercise premium. `lookbacksensbyls` calculates values of fixed- and floating-strike lookback options. To compute the value of a floating-strike lookback option, `Strike` must be specified as `NaN`.```

Examples

collapse all

Compute the Price and Delta of a European Floating Lookback Option Using Monte Carlo Simulation

Define the `RateSpec`.

```StartDates = 'Jan-1-2013'; EndDates = 'Jan-1-2014'; Rates = 0.41; Compounding = -1; RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates,... 'EndDates', EndDates, 'Rates', Rates,'Compounding', Compounding) ```
```RateSpec = FinObj: 'RateSpec' Compounding: -1 Disc: 0.6637 Rates: 0.4100 EndTimes: 1 StartTimes: 0 EndDates: 735600 StartDates: 735235 ValuationDate: 735235 Basis: 0 EndMonthRule: 1 ```

Define the `StockSpec` with continuous dividend yield.

```AssetPrice = 120; Sigma = 0.3; Yield = 0.045; StockSpec = stockspec(Sigma, AssetPrice, 'Continuous', Yield) ```
```StockSpec = FinObj: 'StockSpec' Sigma: 0.3000 AssetPrice: 120 DividendType: {'continuous'} DividendAmounts: 0.0450 ExDividendDates: [] ```

Define the floating lookback option.

```Settle = 'Jan-1-2013'; Maturity = 'July-1-2013'; OptSpec = 'call'; Strike = NaN; ```

Compute the price and delta of the European floating lookback option.

```OutSpec = {'price', 'delta'}; [Price, Delta] = lookbacksensbyls(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity,... 'OutSpec', OutSpec) ```
```Price = 27.4701 Delta = 0.2289 ```

Compute the Price and Delta of a European Fixed Lookback Option Using Monte Carlo Simulation

Define the `RateSpec`.

```StartDates = 'Jan-1-2013'; EndDates = 'Jan-1-2015'; Rates = 0.1; Compounding = -1; RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates,... 'EndDates', EndDates, 'Rates', Rates,'Compounding', Compounding) ```
```RateSpec = FinObj: 'RateSpec' Compounding: -1 Disc: 0.8187 Rates: 0.1000 EndTimes: 2 StartTimes: 0 EndDates: 735965 StartDates: 735235 ValuationDate: 735235 Basis: 0 EndMonthRule: 1 ```

Define the `StockSpec`.

```AssetPrice = 103; Sigma = 0.30; StockSpec = stockspec(Sigma, AssetPrice) ```
```StockSpec = FinObj: 'StockSpec' Sigma: 0.3000 AssetPrice: 103 DividendType: [] DividendAmounts: 0 ExDividendDates: [] ```

Define the fixed lookback option.

```Settle = 'Jan-1-2013'; Maturity = 'July-1-2013'; OptSpec = 'call'; Strike = 99; ```

Compute the price and delta of the European fixed lookback option.

```OutSpec = {'price', 'delta'}; [Price, Delta] = lookbacksensbyls(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity,... 'OutSpec', OutSpec) ```
```Price = 22.6783 Delta = 1.1345 ```

Input Arguments

collapse all

`RateSpec` — Interest-rate term structurestructure

Interest-rate term structure (annualized and continuously compounded), specified by the `RateSpec` obtained from `intenvset`. For information on the interest-rate specification, see `intenvset`.

Data Types: `struct`

`StockSpec` — Stock specification for underlying assetstructure

Stock specification for the underlying asset. For information on the stock specification, see `stockspec`.

`stockspec` can handle several types of underlying assets. For example, for physical commodities the price is represented by `StockSpec.Asset`, the volatility is represented by `StockSpec.Sigma`, and the convenience yield is represented by `StockSpec.DividendAmounts`.

Data Types: `struct`

`OptSpec` — Definition of option string with values `'call'` or `'put'` | cell array of strings

Definition of option as `'call'` or `'put'`, specified as a `NINST`-by-`1` cell array of strings.

Data Types: `char` | `cell`

`Strike` — Option strike price valuesinteger | vector of integers

Option strike price values, specified as an integer using a `NINST`-by-`1` vector of strike price values.

Data Types: `single` | `double`

`Settle` — Settlement or trade datenonnegative integer | vector of nonnegative integers | date string | cell array of date strings

Settlement or trade date for the lookback option, specified as a date string or as nonnegative integers using a `NINST`-by-`1` vector or cell array of dates.

Data Types: `char` | `cell`

`ExerciseDates` — Matrix of exercise callable or puttable dates for European or American optionsnonnegative integer | vector of nonnegative integers | date string | cell array of date strings

Matrix of exercise callable or puttable dates for European or American options, specified as a date string or as nonnegative integers as follows:

• European option — `NINST`-by-`1` vector of exercise dates. For a European option, there is only one exercise date which is the option expiry date.

• American option — `NINST`-by-`2` vector of exercise date boundaries. For each instrument, the option is exercised on any coupon date between or including the pair of dates on that row. If only one non-`NaN` date is listed, or if `ExerciseDates` is a `NINST`-by-`1` vector of serial date numbers or cell array of strings, the option is exercised between `Settle` and the single listed exercise date.

Data Types: `char` | `cell`

Name-Value Pair Arguments

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

Example: `PriceSens = lookbacksensbyls(RateSpec,StockSpec1,StockSpec2,Settle,Maturity,OptSpec,Strike,Corr,'AmericanOpt',1,'OutSpec',{'All'})`

`'AmericanOpt'` — Option type`0` European (default) | scalar with value `[0,1]`

Option type, specified as an integer scalar flag with these values:

• `0` — European

• `1` — American

For American options, the Longstaff-Schwartz least squares method calculates the early exercise premium.

Data Types: `single` | `double`

`'NumTrials'` — Scalar number of independent sample paths `1000` (default) | nonnegative scalar integer

Scalar number of independent sample paths (simulation trials), specified as a nonnegative integer.

Data Types: `single` | `double`

`'NumPeriods'` — Scalar number of simulation periods per trial`100` (default) | nonnegative scalar integer

Scalar number of simulation periods per trial, specified as a nonnegative integer. `NumPeriods` is considered only when pricing European lookback options. For American lookback options, `NumPeriod` is equal to the number of exercise days during the life of the option.

Data Types: `single` | `double`

`'Z'` — Time series array of dependent random variatesvector

Time series array of dependent random variates, specified as a `NumPeriods`-by-`1`-by-`NumTrials` 3-D array. The `Z` value generates the Brownian motion vector (that is, Wiener processes) that drives the simulation.

Data Types: `single` | `double`

`'Antithetic'` — Indicator for antithetic sampling`false` (default) | scalar logical flag with value `true` or `false`

Indicator for antithetic sampling, specified with a value of `true` or `false`.

Data Types: `logical`

`'OutSpec'` — Define outputs`{'Price'}` (default) | string with values `'Price'`, `'Delta'`, `'Gamma'`, `'Vega'`, `'Lambda'`, `'Rho'`, `'Theta'`, and `'All'` | cell array of strings with values `'Price'`, `'Delta'`, `'Gamma'`, `'Vega'`, `'Lambda'`, `'Rho'`, `'Theta'`, and `'All'`

Define outputs, specifying a `NOUT`- by-`1` or a `1`-by-`NOUT` cell array of strings with possible values of `'Price'`, `'Delta'`, `'Gamma'`, `'Vega'`, `'Lambda'`, `'Rho'`, `'Theta'`, and `'All'`.

`OutSpec = {'All'}` specifies that the output should be `Delta`, `Gamma`, `Vega`, `Lambda`, `Rho`, `Theta`, and `Price`, in that order. This is the same as specifying `OutSpec` to include each sensitivity.

Example: `OutSpec = {'delta','gamma','vega','lambda','rho','theta','price'}`

Data Types: `char` | `cell`

Output Arguments

collapse all

`PriceSens` — Expected price and sensitivities of lookback optionvector

Expected price and sensitivities of the lookback option, returned as a `NINST`-by-`1` vector.

`Paths` — Simulated paths of correlated state variablesvector

Simulated paths of correlated state variables, returned as a ```NumPeriods + 1```-by-`1`-by-`NumTrials` 3-D time series array. Each row of `Paths` is the transpose of the state vector X(t) at time t for a given trial.

`Times` — Observation times associated with simulated pathsvector

Observation times associated with simulated paths, returned as a `NumPeriods + 1`-by-`1` column vector of observation times associated with the simulated paths. Each element of `Times` is associated with the corresponding row of `Paths`.

`Z` — Time series array of dependent random variatesvector

Time series array of dependent random variates, returned as a `NumPeriods`-by-`1`-by-`NumTrials` 3-D array when `Z` is specified as an input argument. If the `Z` input argument is not specified, then the `Z` output argument contains the random variates generated internally.