Calculate price and sensitivities for European or American basket options using Monte Carlo simulations

`[`

calculates price and sensitivities for European or American basket options using the
Longstaff-Schwartz model. `PriceSens`

,`Paths`

,`Times`

,`Z`

] = basketsensbyls(`RateSpec`

,`BasketStockSpec`

,`OptSpec`

,`Strike`

,`Settle`

,`ExerciseDates`

)

For American options, the Longstaff-Schwartz least squares method is used to calculate the early exercise premium.

Find a European put basket option of two stocks. The basket contains 50% of each stock. The stocks are currently trading at $90 and $75, with annual volatilities of 15%. Assume that the correlation between the assets is zero. On May 1, 2009, an investor wants to buy a one-year put option with a strike price of $80. The current annualized, continuously compounded interest is 5%. Use this data to compute price and delta of the put basket option with the Longstaff-Schwartz approximation model.

Settle = 'May-1-2009'; Maturity = 'May-1-2010'; % Define RateSpec Rate = 0.05; Compounding = -1; RateSpec = intenvset('ValuationDate', Settle, 'StartDates',... Settle, 'EndDates', Maturity, 'Rates', Rate, 'Compounding', Compounding); % Define the Correlation matrix. Correlation matrices are symmetric, % and have ones along the main diagonal. NumInst = 2; InstIdx = ones(NumInst,1); Corr = diag(ones(NumInst,1), 0); % Define BasketStockSpec AssetPrice = [90; 75]; Volatility = 0.15; Quantity = [0.50; 0.50]; BasketStockSpec = basketstockspec(Volatility, AssetPrice, Quantity, Corr); % Compute the price of the put basket option. Calculate also the delta % of the first stock. OptSpec = {'put'}; Strike = 80; OutSpec = {'Price','Delta'}; UndIdx = 1; % First element in the basket [PriceSens, Delta] = basketsensbyls(RateSpec, BasketStockSpec, OptSpec,... Strike, Settle, Maturity,'OutSpec', OutSpec,'UndIdx', UndIdx)

PriceSens = 0.9822

Delta = -0.0995

Compute the `Price`

and `Delta`

of the basket with a correlation of -20%:

NewCorr = [1 -0.20; -0.20 1]; % Define the new BasketStockSpec. BasketStockSpec = basketstockspec(Volatility, AssetPrice, Quantity, NewCorr); % Compute the price and delta of the put basket option. [PriceSens, Delta] = basketsensbyls(RateSpec, BasketStockSpec, OptSpec,... Strike, Settle, Maturity,'OutSpec', OutSpec,'UndIdx', UndIdx)

PriceSens = 0.7814

Delta = -0.0961

`BasketStockSpec`

— `BasketStock`

specificationstructure

`BasketStock`

specification, specified using `basketstockspec`

.

**Data Types: **`struct`

`OptSpec`

— Definition of option character vector with values

`'call'`

or
`'put'`

| cell array of character vectors with values `'call'`

or
`'put'`

Definition of the option as `'call'`

or `'put'`

,
specified as a character vector or a `2`

-by-`1`

cell
array of character vectors.

**Data Types: **`char`

| `cell`

`Strike`

— Option strike price valuescalar numeric | vector

Option strike price value, specified as one of the following:

For a European or Bermuda option,

`Strike`

is a scalar (European) or`1`

-by-`NSTRIKES`

(Bermuda) vector of strike prices.For an American option,

`Strike`

is a scalar vector of the strike price.

**Data Types: **`double`

`Settle`

— Settlement or trade dateserial date number | date character vector

Settlement or trade date for the basket option, specified as a scalar serial date number or date character vector.

**Data Types: **`double`

| `char`

`ExerciseDates`

— Option exercise datesserial date number | date character vector

Option exercise dates, specified as a serial date number or date character vector:

For a European or Bermuda option,

`ExerciseDates`

is a`1`

-by-`1`

(European) or`1`

-by-`NSTRIKES`

(Bermuda) vector of exercise dates. For a European option, there is only one`ExerciseDate`

on the option expiry date.For an American option,

`ExerciseDates`

is a`1`

-by-`2`

vector of exercise date boundaries. The option exercises on any date between, or including, the pair of dates on that row. If there is only one non-`NaN`

date, or if`ExerciseDates`

is`1`

-by-`1`

, the option exercises between the`Settle`

date and the single listed`ExerciseDate`

.

**Data Types: **`double`

| `char`

| `cell`

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

.

```
PriceSens = basketsensbyls(RateSpec,BasketStockSpec,OptSpec,
Strike,Settle,Maturity,'AmericanOpt',AmericanOpt,'NumTrials',NumTrial,'OutSpec','delta')
```

`'AmericanOpt'`

— Option type`0`

(European/Bermuda) (default) | values `[0,1]`

Option type, specified as the comma-separated pair consisting of
`'AnericanOpt'`

and a
`NINST`

-by-`1`

positive integer scalar flags with
values:

`0`

— European/Bermuda`1`

— American

For American options, the Longstaff-Schwartz least squares method is used to calculate the early exercise premium. For more information on the least squares method, see https://people.math.ethz.ch/%7Ehjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf.

**Data Types: **`double`

`'NumPeriods'`

— Number of simulation periods per trial`100`

(default) | nonnegative integerNumber of simulation periods per trial, specified as the comma-separated pair
consisting of `'NumPeriods'`

and a scalar nonnegative integer.

`NumPeriods`

is considered only when pricing European basket
options. For American and Bermuda basket options, `NumPeriod`

equals the number of exercise days during the life of the option.

**Data Types: **`double`

`'NumTrials'`

— Number of independent sample paths (simulation trials)`1000`

(default) | nonnegative integerNumber of independent sample paths (simulation trials), specified as the
comma-separated pair consisting of `'NumTrials'`

and a scalar
nonnegative integer.

**Data Types: **`double`

`'Z'`

— Time series array of dependent random variatesvector

Time series array of dependent random variates, specified as the comma-separated
pair consisting of `'Z'`

and a
`NumPeriods`

-by-`NINST`

-by-`NumTrials`

3-D time series array. The `Z`

value generates the Brownian motion
vector (that is, Wiener processes) that drives the simulation.

**Data Types: **`double`

`'Antithetic'`

— Indicator for antithetic sampling`false`

(default) | scalar logical flag with value of `true`

or
`false`

Indicator for antithetic sampling, specified as the comma-separated pair
consisting of `'Antithetic'`

and a value of `true`

or `false`

.

**Data Types: **`logical`

`'OutSpec'`

— Define outputs`{'Price'}`

(default) | character vector with values `'Price'`

,
`'Delta'`

, `'Gamma'`

, `'Vega'`

,
`'Lambda'`

, `'Rho'`

, `'Theta'`

,
and `'All'`

| cell array of character vectors with values `'Price'`

,
`'Delta'`

, `'Gamma'`

, `'Vega'`

,
`'Lambda'`

, `'Rho'`

, `'Theta'`

,
and `'All'`

Define outputs, specified as the comma-separated pair consisting of
`'OutSpec'`

and a `NOUT`

- by-`1`

or a `1`

-by-`NOUT`

cell array of character vectors
with possible values of `'Price'`

, `'Delta'`

,
`'Gamma'`

, `'Vega'`

, `'Lambda'`

,
`'Rho'`

, `'Theta'`

, and
`'All'`

.

`OutSpec = {'All'}`

specifies that the output is
`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`

`'UndIdx'`

— Index of the underlying instrument to compute the sensitivity`[]`

(default) | scalar numericIndex of the underlying instrument to compute the sensitivity, specified as the
comma-separated pair consisting of `'UndIdx'`

and a scalar
numeric.

**Data Types: **`double`

`PriceSens`

— Expected prices or sensitivities for basket optionmatrix

Expected prices or sensitivities (defined using `OutSpec`

) for
basket option, returned as a `NINST`

-by-`1`

matrix.

`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 of simulated paths of correlated state variables. 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.

A *basket option* is an option on a portfolio of
several underlying equity assets.

Payout for a basket option depends on the cumulative performance of the collection of the individual assets. A basket option tends to be cheaper than the corresponding portfolio of plain vanilla options for these reasons:

If the basket components correlate negatively, movements in the value of one component neutralize opposite movements of another component. Unless all the components correlate perfectly, the basket option is cheaper than a series of individual options on each of the assets in the basket.

A basket option minimizes transaction costs because an investor has to purchase only one option instead of several individual options.

For more information, see Basket Option.

[1] Longstaff, F.A., and E.S.
Schwartz. “Valuing American Options by Simulation: A Simple Least-Squares
Approach.” *The Review of Financial Studies.* Vol. 14, No. 1,
Spring 2001, pp. 113–147.

A modified version of this example exists on your system. Do you want to open this version instead?

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web siteYou can also select a web site from the following list:

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

- América Latina (Español)
- Canada (English)
- United States (English)

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)