# basketsensbyju

Determine European basket options price or sensitivities using Nengjiu Ju approximation model

## Syntax

## Description

specifies options using one or more name-value pair arguments in
addition to the input arguments in the previous syntax.`PriceSens`

= basketsensbyju(___,`Name,Value`

)

## Examples

### Calculate Prices and Sensitivities for Basket Options Using the Nengjiu Ju Approximation Model

Find a European call basket option of five stocks. Assume that the basket contains:

5% of the first stock trading at $110

15% of the second stock trading at $75

20% of the third stock trading at $40

25% of the fourth stock trading at $125

35% of the fifth stock trading at $92

These stocks have annual volatilities of 20% and the correlation between the assets is zero. On May 1, 2009, an investor wants to buy a 1-year call option with a strike price of $90. The current annualized, continuously compounded interest is 5%. Use this data to compute price and delta of the call basket option with the Ju approximation model.` `

Settle = datetime(2009,5,1); Maturity = datetime(2010,5,1); % 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 = 5; InstIdx = ones(NumInst,1); Corr = diag(ones(5,1), 0); % Define BasketStockSpec AssetPrice = [110; 75; 40; 125; 92]; Volatility = 0.2; Quantity = [0.05; 0.15; 0.2; 0.25; 0.35]; BasketStockSpec = basketstockspec(Volatility, AssetPrice, Quantity, Corr); % Compute the price of the call basket option. Calculate also the delta % of the first stock. OptSpec = {'call'}; Strike = 90; OutSpec = {'Price','Delta'}; UndIdx = 1; % First element in the basket [Price, Delta] = basketsensbyju(RateSpec, BasketStockSpec, OptSpec, Strike, Settle, ... Maturity, 'OutSpec', OutSpec,'UndIdx', UndIdx)

Price = 5.1610

Delta = 0.0297

Compute `Delta`

with respect to the second asset:

UndIdx = 2; % Second element in the basket OutSpec = {'Delta'}; Delta = basketsensbyju(RateSpec, BasketStockSpec, OptSpec, Strike, Settle, Maturity, ... 'OutSpec',OutSpec,'UndIdx',UndIdx)

Delta = 0.0906

## Input Arguments

`BasketStockSpec`

— `BasketStock`

specification

structure

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

scalar 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 date

datetime scalar | string scalar | date character vector

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

To support existing code, `basketsensbyju`

also
accepts serial date numbers as inputs, but they are not recommended.

`Maturity`

— Maturity date

datetime scalar | string scalar | date character vector

Maturity date for the basket option, specified as a scalar datetime, string, or date character vector.

To support existing code, `basketsensbyju`

also
accepts serial date numbers as inputs, but they are not recommended.

### Name-Value Arguments

Specify optional 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: **```
PriceSens =
basketsensbyju(RateSpec,BasketStockSpec,OptSpec,
Strike,Settle,Maturity,'OutSpec','delta')
```

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

Index of the underlying instrument to compute
the sensitivity, specified as the comma-separated
pair consisting of `'UndIdx'`

and
a scalar numeric.

**Data Types: **`double`

## Output Arguments

`PriceSens`

— Expected prices or sensitivities for basket option

matrix

Expected prices or sensitivities (defined using
`OutSpec`

) for basket option,
returned as a
`NINST`

-by-`1`

matrix.

## More About

### Basket Option

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.

## References

[1] Nengjiu Ju.
“Pricing Asian and Basket Options Via Taylor Expansion.”
*Journal of Computational Finance.* Vol. 5,
2002.

## Version History

**Introduced in R2009b**

### R2022b: Serial date numbers not recommended

Although `basketsensbyju`

supports serial date numbers,
`datetime`

values are recommended instead. The
`datetime`

data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.

To convert serial date numbers or text to `datetime`

values, use the `datetime`

function. For example:

t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)

y = 2021

There are no plans to remove support for serial date number inputs.

## Open Example

You have a modified version of this example. Do you want to open this example with your edits?

## MATLAB Command

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.

# Select a Web Site

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

You can also select a web site from the following list:

## How to Get Best Site Performance

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

### Americas

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

### Europe

- 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)