| Financial Derivatives Toolbox™ | ![]() |
StockSpec = stockspec(Sigma, AssetPrice,
DividendType,
DividendAmounts, ExDividendDates)
Sigma | NINST-by-1 decimal annual price volatility of underlying security. |
NINST-by-1 vector of underlying asset price values at time 0. | |
DividendType | (Optional) NINST-by-1 cell array of strings specifying each stock's dividend type. Dividend type must be either cash for actual dollar dividends, constant for constant dividend yield, or continuous for continuous dividend yield. This function does not handle stock option dividends. |
DividendAmounts | (Optional) NINST-by-NDIV matrix of cash dividends or NINST-by-1 vector representing a constant or continuous annualized dividend yield. |
ExDividendDates | (Optional) NINST-by-NDIV matrix of ex-dividend dates for cash type or NINST-by-1 vector of ex-dividend dates for constant dividend type. For continuous dividend type, this argument should be ignored. |
StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmounts, ExDividendDates) creates a MATLAB structure containing the properties of a stock.
Example 1. Consider a stock that provides four cash dividends of $0.50 on January 3, 2008, April 1, 2008, July 5, 2008 and October 1, 2008. The stock is trading at $50, and has a volatility of 20% per annum. Using this data, create the structure StockSpec:
AssetPrice = 50;
Sigma = 0.20;
DividendType = {'cash'};
DividendAmounts = [0.50, 0.50, 0.50, 0.50];
ExDividendDates = {'03-Jan-2008', '01-Apr-2008', '05-July-2008', '01-Oct-2008'};
StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmounts, ExDividendDates)
StockSpec =
FinObj: 'StockSpec'
Sigma: 0.2000
AssetPrice: 50
DividendType: {'cash'}
DividendAmounts: [0.5000 0.5000 0.5000 0.5000]
ExDividendDates: [733410 733499 733594 733682]
Examine the StockSpec structure:
datedisp(StockSpec.ExDividendDates)
03-Jan-2008 01-Apr-2008 05-Jul-2008 01-Oct-2008
StockSpec.DividendType
ans =
'cash' The StockSpec structure encapsulates the information of the stock and its four cash dividends.
Example 2. Consider two stocks that are trading at $40 and $35. The first one provides two cash dividends of $0.25 on March 1, 2008 and June 1, 2008. The second stock provides a continuous dividend yield of 3%. The stocks have a volatility of 30% per annum. Using this data, create the structure StockSpec:
AssetPrice = [40; 35];
Sigma = .30;
DividendType = {'cash'; 'continuous'};
DividendAmount = [0.25, 0.25 ; 0.03 NaN];
DividendDate1 = 'March-01-2008';
DividendDate2 = 'Jun-01-2008';
StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmount,...
{ DividendDate1, DividendDate2 ; NaN NaN})
StockSpec =
FinObj: 'StockSpec'
Sigma: [2x1 double]
AssetPrice: [2x1 double]
DividendType: {2x1 cell}
DividendAmounts: [2x2 double]
ExDividendDates: [2x2 double]
Examine the StockSpec structure:
datedisp(StockSpec.ExDividendDates)
01-Mar-2008 01-Jun-2008
NaN NaN
StockSpec.DividendType
ans =
'cash'
'continuous'The StockSpec structure encapsulates the information of the two stocks and their dividends.
crrprice, crrtree, intenvset, optstockbybjs, optstockbyblk, optstockbybls, optstockbyrgw
![]() | stockoptspec | swapbybdt | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |