Main Content

lookbackbyls

价格使用欧美lookback选项Monte Carlo simulations

Description

example

[Price,Paths,Times,Z] = lookbackbyls(RateSpec,年代tockSpec,OptSpec,年代trike,年代ettle,ExerciseDates)returns prices of lookback options using the Longstaff-Schwartz model for Monte Carlo simulations.lookbackbylscomputes prices of European and American lookback options.

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

lookbackbylscalculates values of fixed- and floating-strike lookback options. To compute the value of a floating-strike lookback option,年代trikemust be specified asNaN.

example

[Price,Paths,Times,Z] = lookbackbyls(___,Name,Value)adds optional name-value pair arguments.

Examples

collapse all

Define theRateSpec.

年代tartDates ='Jan-1-2013';EndDates ='Jan-1-2014';Rates = 0.042; Compounding = -1; RateSpec = intenvset('ValuationDate', StartDates,'StartDates', StartDates,...'EndDates', EndDates,'Rates', Rates,'Compounding'复合)
RateSpec =struct with fields:FinObj: 'RateSpec' Compounding: -1 Disc: 0.9589 Rates: 0.0420 EndTimes: 1 StartTimes: 0 EndDates: 735600 StartDates: 735235 ValuationDate: 735235 Basis: 0 EndMonthRule: 1

Define the年代tockSpec.

AssetPrice = 50; Sigma = 0.36; StockSpec = stockspec(Sigma, AssetPrice)
年代tockSpec =struct with fields:FinObj: 'StockSpec' Sigma: 0.3600 AssetPrice: 50 DividendType: [] DividendAmounts: 0 ExDividendDates: []

Define the floating lookback option.

年代ettle ='Jan-1-2013';Maturity ='April-1-2013';OptSpec ='put';年代trike = NaN;

Compute the price of the European floating lookback option.

Price = lookbackbyls(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity)
Price = 6.6471

Define theRateSpec.

年代tartDates ='Jan-1-2013';EndDates ='Jan-1-2014';Rates = 0.045; Compounding = -1; RateSpec = intenvset('ValuationDate', StartDates,'StartDates', StartDates,...'EndDates', EndDates,'Rates', Rates,'Compounding'复合)
RateSpec =struct with fields:FinObj: 'RateSpec' Compounding: -1 Disc: 0.9560 Rates: 0.0450 EndTimes: 1 StartTimes: 0 EndDates: 735600 StartDates: 735235 ValuationDate: 735235 Basis: 0 EndMonthRule: 1

Define the年代tockSpec.

AssetPrice = 102; Sigma = 0.45; StockSpec = stockspec(Sigma, AssetPrice)
年代tockSpec =struct with fields:FinObj: 'StockSpec' Sigma: 0.4500 AssetPrice: 102 DividendType: [] DividendAmounts: 0 ExDividendDates: []

Define the fixed lookback option.

年代ettle ='Jan-1-2013';Maturity ='July-1-2013';OptSpec ='call';罢工= 98;

Compute the price of the European fixed lookback option.

Price = lookbackbyls(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity)
Price = 30.2368

Input Arguments

collapse all

Interest-rate term structure (annualized and continuously compounded), specified by theRateSpecobtained fromintenvset. For information on the interest-rate specification, seeintenvset.

Data Types:struct

年代tock specification for the underlying asset. For information on the stock specification, seestockspec.

stockspechandles several types of underlying assets. For example, for physical commodities the price is represented by年代tockSpec.Asset, the volatility is represented by年代tockSpec.Sigma, and the convenience yield is represented by年代tockSpec.DividendAmounts.

Data Types:struct

Definition of option as'call'or'put', specified as aNINST-by-1cell array of character vectors.

Data Types:char|cell

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

Data Types:single|double

年代ettlement or trade date for the lookback option, specified as date character vectors or as serial date numbers using aNINST-by-1vector or cell array of character vector dates.

Data Types:double|char|cell

Matrix of exercise callable or puttable dates for European or American options, specified as date character vectors or as serial date numbers as follows:

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

  • American option —NINST-by-2vector 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-NaNdate is listed, or ifExerciseDatesis aNINST-by-1vector of serial date numbers or cell array of character vectors, the option is exercised between年代ettleand the single listed exercise date.

Data Types:double|char|cell

Name-Value Arguments

年代pecify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis 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 encloseNamein quotes.

Example:Price = lookbackbyls(RateSpec,StockSpec1,StockSpec2,Settle,Maturity,OptSpec,Strike,Corr,'AmericanOpt',1)

Option type, specified as the comma-separated pair consisting of'AmericanOpt'and an integer scalar flag with these values:

  • 0— European

  • 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, seehttps://people.math.ethz.ch/%7Ehjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf.

Data Types:single|double

年代calar number of independent sample paths (simulation trials), specified as the comma-separated pair consisting of'NumTrials'和一个nonnegative integer.

Data Types:single|double

年代calar number of simulation periods per trial, specified as the comma-separated pair consisting of'NumPeriods'和一个nonnegative integer.NumPeriodsis considered only when pricing European lookback options. For American lookback options,NumPeriodsis equal to the number of exercise days during the life of the option.

Data Types:single|double

Time series array of dependent random variates, specified as the comma-separated pair consisting of'Z'and aNumPeriods-by-1-by-NumTrials3-D array. TheZvalue generates the Brownian motion vector (that is, Wiener processes) that drives the simulation.

Data Types:single|double

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

Data Types:logical

Output Arguments

collapse all

Expected price of the lookback option, returned as a1-by-1scalar.

年代imulated paths of correlated state variables, returned as aNumPeriods + 1-by-1-by-NumTrials3-D time series array. Each row ofPathsis the transpose of the state vectorX(t) at timetfor a given trial.

Observation times associated with simulated paths, returned as aNumPeriods + 1-by-1column vector of observation times associated with the simulated paths. Each element ofTimesis associated with the corresponding row ofPaths.

Time series array of dependent random variates, returned as aNumPeriods-by-1-by-NumTrials3-D array whenZis specified as an input argument. If theZinput argument is not specified, then theZoutput argument contains the random variates generated internally.

More About

collapse all

Lookback Option

Alookback optionis a path-dependent option based on the maximum or minimum value the underlying asset achieves during the entire life of the option.

Financial Instruments Toolbox™ software supports two types of lookback options: fixed and floating. Fixed lookback options have a specified strike price, while floating lookback options have a strike price determined by the asset path. For more information, seeLookback Option.

References

[1] Hull, J. C.Options, Futures, and Other Derivatives5th Edition. Englewood Cliffs, NJ: Prentice Hall, 2002.

Version History

Introduced in R2014a