This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

basketbyls

Price European or American basket options using Monte Carlo simulations

Syntax

[Price,Paths,Times,Z] = basketbyls(RateSpec,BasketStockSpec,OptSpec,Strike,Settle,ExerciseDates)
[Price,Paths,Times,Z] = basketbyls(___,Name,Value)

Description

example

[Price,Paths,Times,Z] = basketbyls(RateSpec,BasketStockSpec,OptSpec,Strike,Settle,ExerciseDates) prices basket options using the Longstaff-Schwartz model.

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

example

[Price,Paths,Times,Z] = basketbyls(___,Name,Value) specifies options using one or more name-value pair arguments in addition to the input arguments in the previous syntax.

Examples

collapse all

Find an American call basket option of three stocks. The stocks are currently trading at $35, $40 and $45 with annual volatilities of 12%, 15% and 18%, respectively. The basket contains 33.33% of each stock. Assume the correlation between all pair of assets is 50%. On May 1, 2009, an investor wants to buy a three-year call option with a strike price of $42. The current annualized continuously compounded interest rate is 5%. Use this data to compute the price of the call basket option using the Longstaff-Schwartz model.

Settle = 'May-1-2009';
Maturity  = 'May-1-2012';

% 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.
Corr = [1 0.50 0.50; 0.50 1 0.50;0.50 0.50 1];

% Define BasketStockSpec
AssetPrice =  [35;40;45]; 
Volatility = [0.12;0.15;0.18];
Quantity = [0.333;0.333;0.333];
BasketStockSpec = basketstockspec(Volatility, AssetPrice, Quantity, Corr);

% Compute the price of the call basket option
OptSpec = {'call'};
Strike = 42;
AmericanOpt = 1; % American option
Price = basketbyls(RateSpec, BasketStockSpec, OptSpec, Strike, Settle, Maturity,...
'AmericanOpt',AmericanOpt)
Price = 5.4687

Increase the number of simulation trials to 2000 to give the following results:

NumTrial = 2000;
Price = basketbyls(RateSpec, BasketStockSpec, OptSpec, Strike, Settle, Maturity,...
'AmericanOpt',AmericanOpt,'NumTrials',NumTrial)
Price = 5.5501

Input Arguments

collapse all

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

BasketStock specification, specified using basketstockspec.

Data Types: struct

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

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

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

Data Types: double | char

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

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 quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: Price = basketbyls(RateSpec,BasketStockSpec,OptSpec, Strike,Settle,Maturity,'AmericanOpt',AmericanOpt,'NumTrials',NumTrial)

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

Note

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

Number of simulation periods per trial, specified as the comma-separated pair consisting of 'NumPeriods' and a scalar nonnegative integer.

Note

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

Number of independent sample paths (simulation trials), specified as the comma-separated pair consisting of 'NumTrials' and a scalar nonnegative integer.

Data Types: double

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

Indicator for antithetic sampling, specified as the comma-separated pair consisting of 'Antithetic' and a value of true or false.

Data Types: logical

Output Arguments

collapse all

Expected prices for basket option, returned as a NINST-by-1 matrix.

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.

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.

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.

References

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

Introduced in R2009b