Reviews & Opinions
Independent and trusted. Read before buy Matlab Financial Derivatives Toolbox!

Matlab Financial Derivatives Toolbox


Bookmark
Matlab Financial Derivatives Toolbox

Bookmark and Share

 

Matlab Financial Derivatives ToolboxAbout Matlab Financial Derivatives Toolbox
Here you can find all about Matlab Financial Derivatives Toolbox like manual and other informations. For example: review.

Matlab Financial Derivatives Toolbox manual (user guide) is ready to download for free.

On the bottom of page users can write a review. If you own a Matlab Financial Derivatives Toolbox please write about it to help other people.
[ Report abuse or wrong photo | Share your Matlab Financial Derivatives Toolbox photo ]

 

 

Manual

Preview of first few manual pages (at low quality). Check before download. Click to enlarge.
Manual - 1 page  Manual - 2 page  Manual - 3 page 

Download (English)
Matlab Financial Derivatives Toolbox, size: 2.4 MB

 

Matlab Financial Derivatives Toolbox

 

 

User reviews and opinions

<== Click here to post a new opinion, comment, review, etc.

No opinions have been provided. Be the first and add a new opinion/review.

 

Documents

doc0

3-33 3-33 3-35 3-37 3-39 3-41 3-45 3-49 3-51 3-51
Computing Prices and Sensitivities Using the Black-Scholes Model. Computing Prices and Sensitivities Using the Black Model. Computing Prices and Sensitivities Using the Roll-Geske-Whaley Model. Computing Prices and Sensitivities Using the Bjerksund-Stensland Model.

3-55 3-57 3-58 3-59

Hedging Portfolios

Hedging

4-2 4-3 4-3 4-4 4-12 4-16 4-16 4-16 4-19 4-21 4-21 4-21 4-24 4-25 4-27
Hedging Functions. Introduction. Hedging with hedgeopt. Self-Financing Hedges with hedgeslf. Specifying Constraints with ConSet. Introduction. Setting Constraints. Portfolio Rebalancing. Hedging with Constrained Portfolios. Overview. Example: Fully Hedged Portfolio. Example: Minimize Portfolio Sensitivities. Example: Under-Determined System. Example: Portfolio Constraints with hedgeslf.

Function Reference

Interest-Rate Instruments. 5-2
Interest-Rate Term Structure. Interest-Rate Tree Models. Heath-Jarrow-Morton Trees. Heath-Jarrow-Morton Tree Utililites. Black-Derman-Toy Trees. Black-Derman-Toy Tree Utilities. Hull-White Trees. Hull-White Tree Utilities. Black-Karasinski Trees. Black-Karasinski Tree Utilities. Tree Manipulation. Interest-Rate Closed-Form Solutions. Equity Instruments. Equity Tree Models. Cox-Ross-Rubinstein Trees. Cox-Ross-Rubinstein Tree Utilities. Equal Probabilities Binomial Trees. Equal Probabilities Binomial Tree Utilities. Leisen-Reimer Trees. Leisen-Reimer Tree Utilities. Implied Trinomial Trees. Implied Trinomial Tree Utilities. Tree Manipulation. Equity Derivative Closed-Form Solutions. Black-Scholes Option Pricing Model. Black Option Pricing Model. Role-Geske-Whaley Option Pricing Model. Bjerksund-Stensland Option Pricing Model. Nengjiu Ju Approximation Pricing Model. Stulz Option Pricing. Monte Carlo Simulation for Equity Derivatives. Longstaff-Schwartz Option Pricing Model. Controlling Defaults and Options.
5-2 5-3 5-4 5-4 5-5 5-5 5-6 5-6 5-8 5-8 5-9 5-10 5-10 5-10 5-11 5-11 5-11 5-11 5-12 5-12 5-12 5-13 5-13 5-14 5-14 5-15 5-16 5-16 5-16 5-17 5-17 5-17 5-18
Portfolio Handling for Interest and Equity Instruments. Financial Object Structures. Hedging Portfolios.

5-18 5-19 5-19

Functions Alphabetical List
Derivatives Pricing Options
Pricing Options Structure. Introduction. Default Structure. Customizing the Structure. A-2 A-2 A-2 A-5

Bibliography

Black-Derman-Toy (BDT) Modeling. Heath-Jarrow-Morton (HJM) Modeling. Hull-White (HW) and Black-Karasinski (BK) Modeling. Cox-Ross-Rubinstein (CRR) Modeling. B-2 B-3

B-4 B-5

Implied Trinomial Tree (ITT) Modeling. Leisen-Reimer Tree (LR) Modeling. Equal Probabilities Tree (EQP) Modeling. Closed-Form Solutions Modeling. Financial Derivatives.

B-6 B-7 B-8 B-9 B-10

Examples
Instrument Portfolio Examples. Interest Rate Environment Examples C-2 C-2 C-2 C-2 C-2 C-3 C-3 C-3 C-3 C-3 C-4

The BK model is a single-factor, log-normal version of the HW model. For detailed information about interest-rate models, see: Computing Prices and Sensitivities Using the Interest-Rate Term Structure on page 2-31 for a discussion of price and sensitivity based on portfolios of zero-coupon bonds Computing Prices and Sensitivities Using Interest-Rate Tree Models on page 2-58 for a discussion of price and sensitivity based on the HJM and BDT interest-rate models Note Historically, the initial version of Financial Derivatives Toolbox software provided only the HJM interest-rate model. A later version added the BDT model. The current version adds both the HW and BK models. This chapter provides extensive examples of using the HJM and BDT models to compute prices and sensitivities of interest-rate based financial derivatives. The HW and BK tree structures are similar to the BDT tree structure. To avoid needless repetition throughout this chapter, documentation is provided only where significant deviations from the BDT structure exist. Specifically, HW and BK Tree Structures on page 2-53 explains the few noteworthy differences among the various formats. If you need more detailed information about functions that use the HW and BK tree structures, see Chapter 5, Function Reference, which provides extensive reference information for all functions that compose this toolbox.

Rate and Price Trees

The interest-rate or price trees supported in this toolbox can be either binomial (two branches per node) or trinomial (three branches per node). Typically, binomial trees assume that underlying interest rates or prices can only either increase or decrease at each node. Trinomial trees allow for a more complex movement of rates or prices. With trinomial trees the movement of rates or prices at each node is unrestricted (for example, up-up-up or unchanged-down-down).

Types of Trees

Financial Derivatives Toolbox trees can be classified as bushy or recombining. A bushy tree is a tree in which the number of branches increases exponentially relative to observation times; branches never recombine. In this context, a recombining tree is the opposite of a bushy tree. A recombining tree has branches that recombine over time. From any given node, the node reached by taking the path up-down is the same node reached by taking the path down-up. A bushy tree and a recombining binomial tree are illustrated next.

1x1 1x1 1x1

struct struct struct
BDTTree and BDTInstSet are the input arguments required to call the function bdtprice.
Use the function instdisp to examine the set of instruments contained in the variable BDTInstSet.

instdisp(BDTInstSet)

Index Type CouponRate Settle Bond 0.1 Bond 0.1 01-Jan-2000 01-Jan-2000

Period Basis. NaN. NaN.

Name 10% bond 10% bond
UnderInd OptSpec Strike ExerciseDates call 9501 Jan-2002
AmericanOpt Name NaN Option 95

OptBond 1

Fixed 0.10

10% Fixed 80

20BP Float 8
Index Type Strike Settle 6 Cap 0.15 01-Jan-2000
CapReset Basis Principal Name 1 NaN NaN

15% Cap 30

FloorReset Basis Principal Name 1 NaN NaN

Floor 0.09

9% Floor 40
LegReset Basis Principal LegType Name [1 1] NaN NaN
Swap [0.15 10] 01-Jan-2000

[NaN] 15%/10BP Swap 10

Note that there are eight instruments in this portfolio set: two bonds, one bond option, one fixed-rate note, one floating-rate note, one cap, one floor, and one swap. Each instrument has a corresponding index that identifies the instrument prices in the price vector returned by bdtprice. Now use bdtprice to calculate the price of each instrument in the instrument set.
Price = bdtprice(BDTTree, BDTInstSet) Warning: Not all cash flows are aligned with the tree. Result will be approximated. Price = 95.5030 93.9079 1.7657 95.5030 100.4865 1.4863 0.0245 7.4222

Price Vector Output

The prices in the output vector Price correspond to the prices at observation time zero (tObs = 0), which is defined as the valuation date of the interest-rate tree. The instrument indexing within Price is the same as the indexing within InstSet. In the HJM example, the prices in the Price vector correspond to the instruments in this order.
InstNames = instget(HJMInstSet, 'FieldName','Name') InstNames = 4% bond 4% bond Option 101 4% Fixed
20BP Float 3% Cap 3% Floor 6%/20BP Swap
Consequently, in the Price vector, the fourth element, 98.7159, represents the price of the fourth instrument (4% fixed-rate note); the sixth element, 6.2831, represents the price of the sixth instrument (3% cap). In the BDT example, the prices in the Price vector correspond to the instruments in this order.
InstNames = instget(BDTInstSet, 'FieldName','Name') InstNames = 10% Bond 10% Bond Option 95 10% Fixed 20BP Float 15% Cap 9% Floor 15%/10BP Swap
Consequently, in the Price vector, the fourth element, 95.5030, represents the price of the fourth instrument (10% fixed-rate note); the sixth element, 1.4863, represents the price of the sixth instrument (15% cap).

o=optimset('TolFun',100*eps);
[Alpha, Sigma] = hwcalbycap(RateSpec, MarketStrike, MarketMat, MarketVol,. Strike, Settle, Maturity, 'Reset', Reset, 'Principal', Principal, 'Basis',. Basis, 'OptimOptions', o) Local minimum possible.

Local minimum possible.

lsqnonlin stopped because the size of the current step is less than the default value of the step size tolerance. Warning: LSQNONLIN did not converge to an optimal solution. It exited with exitflag = 2.
> In hwcalbycapfloor at 97 In hwcalbycap at 77

Alpha =

1.0000e-006

Sigma =

0.0127
The previous warning indicates that the conversion was not optimal. The search algorithm used by the Optimization Toolbox function lsqnonlin did not find a solution that conforms to all the constraints. To discern whether the solution is acceptable, look at the results of the optimization by specifying a third output (OptimOut) for hwcalbycap:
[Alpha, Sigma, OptimOut] = hwcalbycap(RateSpec, MarketStrike, MarketMat,.
MarketVol, Strike, Settle, Maturity, 'Reset', Reset, 'Principal', Principal,. 'Basis', Basis, 'OptimOptions', o);
The OptimOut.residual field of the OptimOut structure is the optimization residual. This value contains the difference between the Black caplets and those calculated during the optimization. You can use the OptimOut.residual value to calculate the percentual difference (error) compared to Black caplet prices and then decide whether the residual is acceptable. There is almost always some residual, so decide if parametrizing the market with a single value of Alpha and Sigma is acceptable. Price caplets using market data and Blacks formula to obtain reference caplet values. To determine the effectiveness of the optimization, calculate reference caplet values using Blacks formula and the market data. Note, you must first interpolate the market data to obtain the caplets for calculation:
MarketMatNum = datenum(MarketMat); [Mats,Strikes] = meshgrid(MarketMatNum, MarketStrike); FlatVol = interp2(MarketMatNum, MarketStrike, MarketVol, datenum(Maturity),. Strike, 'spline');
Compute the price of the cap using the Black model:
[CapPrice, Caplets] = capbyblk(RateSpec, Strike, Settle, Maturity, FlatVol,. 'Reset', Reset, 'Basis', Basis, 'Principal', Principal); Caplets = Caplets(2:end)'; Caplets = 0.3210 1.6355 2.4863 3.1903 3.4110 3.2685 3.2385 3.4803 3.2419 3.1949 3.2991

3.3750

Compare optimized values and Black values and display graphically. After calculating the reference values for the caplets, compare the values, analytically and graphically, to determine whether the calculated single values of Alpha and Sigma provide an adequate approximation:

capbyblk floorbyblk

Graphical Representation of Trees
In this section. Introduction on page 2-82 Observing Interest Rates on page 2-82 Observing Instrument Prices on page 2-86
You can use the function treeviewer to display a graphical representation of a tree, allowing you to examine interactively the prices and rates on the nodes of the tree until maturity. To get started with this process, first load the data file deriv.mat included in this toolbox.
Note treeviewer price tree diagrams follow the convention that increasing prices appear on the upper branch of a tree and, consequently, decreasing prices appear on the lower branch. Conversely, for interest rate displays, decreasing interest rates appear on the upper branch (prices are rising) and increasing interest rates on the lower branch (prices are falling). For information on the use of treeviewer to observe interest rate movement, see Observing Interest Rates on page 2-82. For information on using treeviewer to observe the movement of prices, see Observing Instrument Prices on page 2-86.

Observing Interest Rates

If you provide the name of an interest rate tree to the treeviewer function, it displays a graphical view of the path of interest rates. For example, here is the treeviewer representation of all the rates along both the up and down branches of HJMTree.

treeviewer(HJMTree)

The example in Isolating a Specific Node for a CRRTree on page 3-19 used bushpath to find the path of forward rates along an HJM tree by taking the first branch up and then two branches down the rate tree.
FRates = bushpath(HJMTree.FwdTree, [2]) FRates = 1.0356 1.0364 1.0526 1.0674
With the treeviewer function you can display the identical information by clicking along the same sequence of nodes, as shown next.
Next is a treeviewer representation of interest rates along several branches of BDTTree.

treeviewer(BDTTree)

Note When using treeviewer with recombining trees, such as BDT, BK, and HW, you must click each node in succession from the beginning to the end. Because these trees can recombine, treeviewer is unable to complete the path automatically. The example in Isolating a Specific Node for a CRRTree on page 3-19 used treepath to find the path of interest rates taking the first branch up and then two branches down the rate tree.

PriceTree.PTree{1} 1.6506 10.6832 2.4074 3.2294 0.5426 6.1845 3.2052 6.6074
With this interface, you can observe the prices for all instruments in the portfolio at a specific time.
Prices for Lookback and Asian Options for Equity Trees
Lookback options and Asian options are path dependent, and, as such, there are no unique prices for any node except the root node. Consequently, the corresponding values for lookback and Asian options in the price tree are set to NaN, the only exception being the root node. This becomes apparent if you examine the prices in the second node (tobs = 1) of the CRR price tree:
PriceTree.PTree{2} ans = 11.9176 0.9508 16.4600 2.5896 NaN NaN NaN NaN 0 7.1914 2.6672 5.0000 NaN NaN NaN NaN
Examining the prices in the second node (tobs = 1) of the ITT price tree displays:
PriceTree.PTree{2} ans = 3.9022 6.3736 5.6914 2.7663 NaN NaN NaN NaN 0 13.3.8594 NaN NaN NaN NaN 0 22.5.0000 NaN NaN NaN NaN
Sensitivities can be reported either as dollar price changes or percentage price changes. The delta, gamma, and vega sensitivities that the toolbox computes are dollar sensitivities. The functions crrsens, eqpsens, and ittsens compute the delta, gamma, and vega sensitivities of instruments using a stock tree. They also optionally return the calculated price for each instrument. The sensitivity functions require the same two input arguments used by the pricing functions (CRRTree and CRRInstSet for CRR, EQPTree and EQPInstSet for EQP, andITTTree and ITTInstSet for ITT). As with the instrument pricing functions, the optional input argument
Options is also allowed. You would include this argument if you want a
sensitivity function to generate a price for a barrier option as one of its outputs and want to control the method that the toolbox uses to perform the pricing operation. See Appendix A, Derivatives Pricing Options or the derivset function for more information. For path-dependent options (lookback and Asian), delta and gamma are computed by finite differences in calls to crrprice, eqpprice, and ittprice. For the other options (stock option, barrier, and compound), delta and gamma are computed from the CRR, EQP, and ITT trees and the corresponding option price tree. (See Chriss, Neil, Black-Scholes and Beyond, pp. 308-312.)
CRR Sensitivities Example
The calling syntax for the sensitivity function is:

MaxCost = [0:1000:50000];

Now, call hedgeopt.

[Sens, Cost, Quantity] = hedgeopt(Sensitivities, Price,. Holdings, FixedInd, [], MaxCost);
With this data, you can plot the required hedging cost versus the funds available (the amount you are willing to spend)
plot(MaxCost/1000, Cost/1000, 'red'), grid xlabel('Funds Available for Rebalancing ($1000''s)') ylabel('Actual Rebalancing Cost ($1000''s)') title ('Rebalancing Cost Profile')

Rebalancing Cost Profile

and the portfolio dollar sensitivities versus the funds available.
figure plot(MaxCost/1000, Sens(:,1), '-red') hold('on') plot(MaxCost/1000, Sens(:,2), '-.black') plot(MaxCost/1000, Sens(:,3), '--blue') grid xlabel('Funds Available for Rebalancing ($1000''s)') ylabel('Delta, Gamma, and Vega Portfolio Dollar Sensitivities') title ('Portfolio Sensitivities Profile') legend('Delta', 'Gamma', 'Vega', 0)
Funds Available for Rebalancing
Self-Financing Hedges with hedgeslf
The figures Rebalancing Cost Profile on page 4-11 and Funds Available for Rebalancing on page 4-12 indicate that there is no benefit because the funds available for hedging exceed $23,055.90, the point of maximum expense required to obtain simultaneous delta, gamma, and vega neutrality. You can also find this point of delta, gamma, and vega neutrality using hedgeslf.
[Sens, Value1, Quantity] = hedgeslf(Sensitivities, Price,. Holdings, FixedInd); Sens = -0.00 -0.00 -0.00 Value1 = 618.72
Quantity = 100.00 -182.36 -19.55 80.00 8.00 -32.97 40.00 10.00
Similar to hedgeopt, hedgeslf returns the portfolio dollar sensitivities and instrument quantities (the rebalanced holdings). However, in contrast, the second output parameter of hedgeslf is the value of the rebalanced portfolio, from which you can calculate the rebalancing cost by subtraction.
Value0 - Value1 ans = 23055.90
In this example, the portfolio is clearly not self-financing, so hedgeslf finds the best possible solution required to obtain zero sensitivities. There is, in fact, a third calling syntax available for hedgeopt directly related to the results shown above for hedgeslf. Suppose, instead of directly specifying the funds available for rebalancing (the most money you are willing to spend), you want to simply specify the number of points along the cost frontier. This call to hedgeopt samples the cost frontier at 10 equally spaced points between the point of minimum cost (and potentially maximum exposure) and the point of minimum exposure (and maximum cost).
[Sens, Cost, Quantity] = hedgeopt(Sensitivities, Price,. Holdings, FixedInd, 10); Sens = -32784.46 -29141.74

2231.83 1983.85

-49694.33 -44172.74

A NINST-by-NUMCURVES matrix of clean bond prices. Each column arises from one of the zero curves.

PriceNoAI

A NINST-by-NUMCURVES matrix of dirty bond price (clean + accrued interest). Each column arises from one of the zero curves.

CFlowAmounts

A NINST-by-NUMCFS matrix of cash flows for each bond

CFlowDates

A NUMCFS-by-1 matrix of payment dates for each bond
Price a 4% bond using a set of zero curves. Load the filederiv.mat, which provides ZeroRateSpec, the interest-rate term structure, needed to price the bond.
load deriv.mat; CouponRate = 0.04; Settle = '01-Jan-2000'; Maturity = '01-Jan-2004'; Price = bondbyzero(ZeroRateSpec, CouponRate, Settle, Maturity) Price = 97.5334
| swapbyzero | cfbyzero | fixedbyzero | floatbyzero

bushpath

Extract entries from node of bushy tree
Values = bushpath(Tree, BranchList)

Tree BranchList

Bushy tree. Number of paths (NUMPATHS) by path length (PATHLENGTH) matrix containing the sequence of branchings.
Values = bushpath(Tree, BranchList) extracts entries of a node
of a bushy tree. The node path is described by the sequence of branchings taken, starting at the root. The top branch is number 1, the second-to-top is 2, and so on. Set the branch sequence to zero to obtain the entries at the root node.
Values is a number of values (NUMVALS)-by-NUMPATHS matrix containing
the retrieved entries of a bushy tree.
Create an HJM tree by loading the example file.
FwdRates = bushpath(HJMTree.FwdTree, [1])
returns the rates at the tree nodes located by taking the up branch, then the down branch, and finally the up branch again.
FwdRates = 1.0356 1.0364 1.0526

1.0463

You can visualize this with the treeviewer function.

bushshape | mkbush

bushshape
Retrieve shape of bushy tree
[NumLevels, NumChild, NumPos, NumStates, Trim] = bushshape(Tree)

Bushy tree.

[NumLevels, NumChild, NumPos, NumStates, Trim] = bushshape(Tree) returns information on a bushy trees shape. NumLevels is the number of time levels of the tree. NumChild is a 1-by-number of levels (NUMLEVELS) vector with the number of branches (children) of the nodes in each level. NumPos is a 1-by-NUMLEVELS vector containing the length of the state

vectors in each level.

NumStates is a 1-by-NUMLEVELS vector containing the number of state vectors in each level. Trim is 1 if NumPos decreases by 1 when moving from one time level to the next. Otherwise, it is 0.
With treeviewer you can see the general shape of the HJM interest-rate tree.

With this tree

The valuation date (settle date) specified in HWTree is January 1, 2004 (date number 731947).
HWTree.RateSpec.ValuationDate ans = 731947
CFlowAmounts =[5 NaN 5.5 105; 6 105]; CFlowDates = [732678, NaN, 733408, 733774; 732678, 733034, 733408, 734774];
[Price, PriceTree] = cfbyhw(HWTree, CFlowAmounts, CFlowDates,. HWTree.RateSpec.ValuationDate) Price = 93.3789 81.7651 PriceTree = FinObj: 'HWPriceTree' tObs: [4] PTree: {[2x1 double] double] Connect: {[2] [4] [2x3 double] [4]} [3x3 double] [3x5 double]} [2x5 double] [2x5 [2x5 double]}
cfamounts | hwtree | hwprice | instcf

cfbyzero

Price cash flows from set of zero curves
Price = cfbyzero(RateSpec, CFlowAmounts, CFlowDates, Settle, Basis)
Structure containing the properties of an interest-rate structure. See intenvset for information on creating RateSpec. Number of instruments (NINST) by maximum number of cash flows (MOSTCFS) matrix with entries listing cash flow amounts corresponding to each date in CFlowDates. Each row is a list of cash flow values for one instrument. If an instrument has fewer than MOSTCFS cash flows, the end of the row is padded with NaNs.
NINST-by-MOSTCFS matrix of cash flow dates. Each entry contains the serial date of the corresponding cash flow in CFlowAmounts.

Settle Basis

Settlement date on which the cash flows are priced. (Optional) Day-count basis of the instrument. A vector of integers. 0 = actual/actual (default) 1 = 30/360 (SIA) 2 = actual/= actual/= 30/360 (BMA) 5 = 30/360 (ISDA) 6 = 30/360 (European)
Price = cfbyzero(RateSpec, CFlowAmounts, CFlowDates, Settle, Basis) computes Price, an NINST-by-NUMCURVES matrix of
cash flows prices. Each column arises from one of the zero curves.
Price a portfolio containing two cash flow instruments paying interest annually over the four-year period from January 1, 2000 to January 1, 2004. Load the file deriv.mat, which provides ZeroRateSpec. The ZeroRateSpec structure contains the interest-rate information needed to price the instruments.
load deriv.mat CFlowAmounts =[5 NaN 5.5 105;6 105]; CFlowDates = [730852, NaN, 731582,731947; 730852, 731217, 731582, 731947]; Settle = 730486; Price = cfbyzero(ZeroRateSpec, CFlowAmounts, CFlowDates, Settle) Price = 96.7804

97.2187

bondbyzero | fixedbyzero | floatbyzero | swapbyzero
Price European simple chooser options using Black-Scholes model
Price = chooserbybls(RateSpec, StockSpec, Settle, Maturity, Strike)
NINST-by-1 vector of settlement or trade dates. NINST-by-1 vector of maturity dates. NINST-by-1 vector of strike price values. NINST-by-1 vector of chooser dates.
StockSpec Settle Maturity Strike ChooseDate
Price = chooserbybls(RateSpec, StockSpec, Settle, Maturity, Strike) computes the price for European simple chooser options using

UOptSpec = 'Call'; UStrike = 99; USettle = '01-Jan-2006'; UExerciseDates = '01-Jan-2010'; UAmericanOpt = 1; COptSpec = 'Put'; CStrike = 5; CSettle = '01-Jan-2006'; CExerciseDates = '01-Jan-2010'; Price = compoundbyitt(ITTTree, UOptSpec, UStrike, USettle,. UExerciseDates, UAmericanOpt, COptSpec, CStrike, CSettle,. CExerciseDates) Price = 2.727
Rubinstein, Mark, Double Trouble, Risk 5, 1991.

instcompound | itttree

crrprice
Instrument prices from CRR tree

CRRTree InstSet

Stock price tree structure created by crrtree. Variable containing a collection of NINST instruments. Instruments are categorized by type; each type can have different data fields. The stored data field is a row vector or string for each instrument. For more information about how to create the InstSet structure, see instadd. (Optional) Derivatives pricing options structure created with derivset.
computes stock option prices using a CRR binomial tree created with crrtree.
each instrument. The prices are computed by backward dynamic programming on the stock tree. If an instrument cannot be priced, NaN is returned.
PriceTree is a MATLAB structure of trees containing vectors of instrument prices and a vector of observation times for each node. PriceTree.PTree contains the prices. PriceTree.tObs contains the observation times. PriceTree.dObs contains the observation dates. crrprice handles instrument types: 'Asian', 'Barrier', 'Compound', 'Lookback', 'OptStock'. See instadd to construct defined types.
Related single-type pricing functions are:
asianbycrr: Price an Asian option from a CRR tree. barrierbycrr: Price a barrier option from a CRR tree. compoundbycrr: Price a compound option from a CRR tree. lookbackbycrr: Price a lookback option from a CRR tree. optstockbycrr: Price an American, Bermuda, or European option from a CRR tree.
Load the CRR tree and instruments from the data file deriv.mat. Price the barrier and lookback options contained in the instrument set.
load deriv.mat; CRRSubSet = instselect(CRRInstSet,'Type',. {'Barrier', 'Lookback'});

InstSet = instfloor(InstSet, Strike, Settle, Maturity, Reset, Basis, Principal) creates a new instrument set containing
floor instruments or adds floor instruments to an existing instrument set.
[FieldList, ClassList, TypeString] = instfloor displays the
ClassList is an NFIELDS-by-1 cell array of strings listing the data class of each field. The class determines how arguments are parsed. Valid strings are 'dble', 'date', and 'char'. TypeString is a string specifying the type of instrument added. For a floor instrument, TypeString = 'Floor'.

instget

Data from instrument variable
[Data_1, Data_2,.,Data_n] = instget(InstSet, 'FieldName', FieldList, 'Index', IndexSet, 'Type', TypeList)
Variable containing a collection of instruments. Instruments are classified by type; each type can have different data fields. The stored data field is a row vector or string for each instrument. (Optional) String or number of fields (NFIELDS)-by-1 cell array of strings listing the name of each data field to match with data values. FieldList entries can also be either 'Type' or 'Index'; these return type strings and index numbers respectively. The default is all fields available for the returned set of instruments. (Optional) Number of instruments (NINST)-by-1 vector of positions of instruments to work on. If TypeList is also entered, instruments referenced must be one of TypeList types and contained in IndexSet. The default is all indices available in the instrument variable. (Optional) String or number of types (NTYPES)-by-1 cell array of strings restricting instruments to match one of TypeList types. The default is all types in the instrument variable.
Argument value pairs can be entered in any order. The InstSet variable must be the first argument.
[Data_1, Data_2,.,Data_n] = instget(InstSet, 'FieldName', FieldList, 'Index', IndexSet, 'Type', TypeList) retrieves data
arrays from an instrument variable.
Data_1 is an NINST-by-M array of data contents for the first field in FieldList. Each row corresponds to a separate instrument in IndexSet. Unavailable data is returned as NaN or as spaces. Data_n is an NINST-by-M array of data contents for the last field in FieldList.
Retrieve the instrument set ExampleInst from the data file. InstSetExamples.mat. ExampleInst contains three types of instruments: Option, Futures, and TBill.
Extract the price from all instruments.
P = instget(ExampleInst,'FieldName','Price') P =
12.2000 9.2000 6.8000 NaN 7.4000 2.9000 99.0000
Get all the prices and the number of contracts held.
[P,C] = instget(ExampleInst, 'FieldName', {'Price', 'Contracts'}) P = 12.2000 9.2000 6.8000 Nan 7.4000 2.9000 99.0000 C = 1000 -1000 -6

NINST-by-1 vector of settlement or trade dates.
For a European or Bermuda option:
For each instrument, the option can be exercised on any coupon date between or including the pair of dates on that row. If only one non-NaN date is listed, or if ExerciseDates is NINST-by-1, the option can be exercised between the underlying bond Settle and the single listed exercise date.
(Optional) If AmericanOpt = 0, NaN, or is unspecified, the option is a European or Bermuda option. If AmericanOpt = 1, the option is an American option.
Note Data arguments for optstockbyitt are NINST-by-1 vectors, scalar, or empty. Fill unspecified entries in vectors with NaN. Only one data argument is required to create the instrument; the others may be omitted or passed as empty matrices [].
[Price, PriceTree] = optstockbyitt(ITTTree, OptSpec, Strike, Settle, ExerciseDates, AmericanOpt) computes the price
each node. Note The Settle date for every option is set to the ValuationDate of the stock tree. The option argument, Settle, is ignored.
Price a stock option using an ITT equity tree. Load the file deriv.mat which provides the ITTTree. The ITTTree structure contains the stock specification and time information needed to price the option.
OptSpec = 'Put'; Strike = 80; Settle = '01-Jan-2006'; ExerciseDates = ' 01-Jan-2010 ';
Price = optstockbyitt(ITTTree, OptSpec, Strike, Settle,ExerciseDates) Price = 10.68
instoptstock | itttree | stockoptspec

optstockbylr

Price options on stocks using Leisen-Reimer binomial tree model
[Price, Settle, [Price, Settle, PriceTree] = optstockbylr(LRTree, OptSpec, Strike, ExerciseDates) PriceTree] = optstockbylr(LRTree, OptSpec, Strike, ExerciseDates, Name,Value)
[Price, PriceTree] = optstockbylr(LRTree, OptSpec, Strike, Settle, ExerciseDates) computes option prices on stocks using the
Leisen-Reimer binomial tree model.
[Price, PriceTree] = optstockbylr(LRTree, OptSpec, Strike, Settle, ExerciseDates, Name,Value) computes option prices on
stocks using the Leisen-Reimer binomial tree model with additional options specified by one or more Name,Value pair arguments.
Stock tree structure created by lrtree.
OptSpec NINST-by-1 cell array of strings 'call' or 'put'. Strike NINST-by-1 (European/American) or NINST-by-NSTRIKES
(Bermuda) matrix of strike price values. Each row is the schedule for one option. If an option has fewer than NSTRIKES exercise opportunities, the end of the row is padded with NaNs.
Settle NINST-by-1 matrix of settlement or trade dates.
Note The settle date for every option is set to the ValuationDate of the stock tree. The option argument, Settle, is ignored.
ExerciseDates NINST-by-1 (European/American) or NINST-by-NSTRIKEDATES
(Bermuda) matrix of exercise dates. Each row is the schedule for one option. For a European option, there is only one ExerciseDate on the option expiry date. For the American type, the option can be exercised on any tree data between the ValuationDate and tree maturity. The last element of each row must be the same as the maturity of the tree.

Glossary-1

with respect to equities. A high-beta instrument is riskier than a low-beta instrument. binomial model A method in which the probability over time of each possible price or rate follows a binomial distribution. The basic assumption is that prices or rates can move to only two values (one higher and one lower) over any short time period. See also trinomial model on page Glossary-10. Black-Derman-Toy (BDT) model A model for pricing interest rate derivatives where all security prices and rates depend upon the short rate (annualized one-period interest rate). bond A long-term debt security with fixed interest payments and fixed maturity date.
bond option The right to sell a bond back to the issuer (put) or to redeem a bond from its current owner (call) at a specific price and on a specific date. bushy tree A tree of prices or interest rates in which the number of branches increases exponentially relative to observation times; branches never recombine. Opposite of a recombining tree on page Glossary-8. call 1. An option to buy a certain quantity of a stock or commodity for a specified price within a specified time. See also put on page Glossary-7. 2. A demand to submit bonds to the issuer for redemption before the maturity date. call swaption Allows the option buyer to enter into an interest rate swap in which the buyer of the option pays the fixed rate and receives the floating rate.

Glossary-2

callable bond A bond that allows the issuer to buy back the bond at a predetermined price at specified future dates. The bond contains an embedded call option; that is, the holder has sold a call option to the issuer. See also puttable bond on page Glossary-8. cap Interest-rate option that guarantees that the rate on a floating-rate loan will not exceed a certain level.
caplet An interim cap component in a multiperiod interest-rate cap agreement. cash-or-nothing option A digital option that pays some fixed amount of cash if the option expires in the money. compound option An option on an option, such as a call on a call, a put on a put, a call on a put, or a put on a call. delta The rate of change of the price of a derivative security relative to the price of the underlying asset; that is, the first derivative of the curve that relates the price of the derivative to the price of the underlying security.

doc1

Financial Derivatives Toolbox 3
Model and analyze equity and fixed-income derivatives
The Financial Derivatives Toolbox extends the Financial Toolbox with functionality for analyzing and modeling equity and fixedincome derivatives and securities contingent on interest rates. You can use the toolbox to compute prices and sensitivities, view price evolutions, and perform hedging analyses using common equity and fixed income modeling methods such as Cox-Ross-Rubinstein (CRR), Equal Probabilities (EQP), Heath-Jarrow-Morton (HJM), and Black-Derman-Toy (BDT).

KEY FEATURES

Computes prices and sensitivities of vanilla and exotic equity options using the Cox-Ross-Rubinstein model or Equal Probabilities (EQP) model Calculates the prices of any set of supported instruments based on an interest rate structure Computes prices and sensitivities of fixed-income instruments using the Heath-Jarrow-Morton (HJM) model or the BlackDerman-Toy (BDT) model Provides strategies for minimizing the cost of hedging a portfolio given a set of target sensitivities, and minimizing portfolio sensitivities given maximum target costs
Working with Equity Options
The toolbox provides functionality for modeling the evolution of stock prices using the CRR or the EQP method. With either of these discrete-time modeling methods, you can create binomial trees and illustrate the expected stock price for each node in the tree with the corresponding volatility. The toolbox also provides functionality for calculating portfolio prices and sensitivities based on a binary equity price tree. The Financial Derivatives Toolbox supports the following equity options:
Stock (American, European, Bermuda) Compound Barrier Asian Lookback
Working with Fixed-Income Instruments
The Financial Derivatives Toolbox includes functions for finding the prices and sensitivities of several financial instruments based on interest-rate curves. You can apply the functions to a portfolio of different types of instruments or to groups of instruments of the same type. The toolbox also provides functions that use the Heath-Jarrow-Morton (HJM) and BlackDerman-Toy (BDT) models to compute prices and sensitivities for other financial instruments.
Instrument portfolio pricing example, created using MATLAB, Excel Link, the Financial Derivatives Toolbox, and Microsoft Excel. The tree diagram (inset) uses the Heath-JarrowMorton interest rate model.

Sample Functions

Portfolio Hedge Allocation Allocate self-financing hedge
Allocate optimal hedge to trade off cost for sensitivity
Interest Term Structure Calculate discounting factors from interest rates
Calculate interest rates from cash flow discounting factors
Pricing and Sensitivity for Equity and Fixed Income
Calculate instrument prices by term structure, HJM tree, BDT tree, CRR stock tree, or EQP stock tree Calculate instrument sensitivities by term structure, HJM tree, BDT tree, CRR stock tree, or EQP stock tree
Hedging strategy developed in the Financial Derivatives Toolbox.
Price bonds by a set of zero curves Specify volatility process
The Financial Derivatives Toolbox supports the following fixed-income instruments:
Bonds and options on bonds Arbitrary cash flows Fixed-rate and floating-rate notes Caps and floors Vanilla swaps
The Financial Derivatives Toolbox provides functions for interest rate environment computations, instrument portfolio construction and manipulation, and for Heath-Jarrow-Morton and Black-Derman-Toy modeling.
Creating Portfolios and Hedging Strategies
The Financial Derivatives Toolbox provides functionality for pricing portfolios and applying hedging strategies. You can:

Required Products

MATLAB Financial Toolbox Optimization Toolbox Statistics Toolbox
For demos, application examples, tutorials, user stories, and pricing: Visit www.mathworks.com Contact The MathWorks directly US & Canada 508-647-7000 Benelux France Germany Italy Korea Spain Sweden Switzerland UK +31 (0)+33 (0)14 +49 (0)750 +39 (011) +82 (0)5114 +00 +46 (8)00 +41 (0)+44 (0)200
Create and manage portfolios that include
several types of financial instruments

Related Products

GARCH Toolbox. Analyze financial volatility using univariate GARCH models Fixed-Income Toolbox. Perform fixedincome modeling and analysis For more information on related products, visit www.mathworks.com/products/derivatives
Calculate the price and sensitivities for each

instrument and the total portfolio
View the results either numerically or

graphically

Define a hedging strategy using selected
instruments within a portfolio to achieve a target sensitivity or cost
Platform and System Requirements
For platform and system requirements, visit www.mathworks.com/products/derivatives
Visit www.mathworks.com to obtain contact information for authorized MathWorks representatives in countries throughout Asia Pacific, Latin America, the Middle East, Africa, and the rest of Europe.
Tel: 508.647.7000 info@mathworks.com www.mathworks.com

9855v02 05/04

2004 by The MathWorks, Inc. MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered trademarks, and TargetBox is a trademark of The MathWorks, Inc. Other product or brand names are trademarks or registered trademarks of their respective holders.

 

Tags

WF-T653A LA-610 SDR458H GGR50B XM-4S Maitre CFD-S350 FJS1425W Adventure 2 88KEY R-937 93ST VR900 HK505 Deskjet 3600 KX-TC170B ST7000 SD-P1400 Master Wharton 4860 Seiko 7009 Assassin SD950 IS RB-06 Madam 793MB LE32R72B Penta AD31 LE37R87 Fire-15 DVD-P390K Premio SUP 015 LAC-M1600 NN-S255 Coolpix L3 Limousine DVD-S559mk2 WF8620NHW Shredder Sparc 16V LP790 RX3715 YDP-160-140 Mixchart 200 VOX LAN121HNP B-63874HU 05 Wtmc6500UC RS 4 ZC540S LE15S51B Review Sedan SRP2008B N-33H Subwoofer Gateway HCA-20 MFC06 90090 Canon F-1N SL-PD6 Instruments FM8 E5211 RM-X55M NV-MD9000EN ASD 9UA S D DE4654 Supertooth ONE RF-11 KX-TC1743G VR668 SHR-2160P250 Smonitor DEH-P9600MP AFT-100 Toaster 42PX3RV-ZA VOX VT50 4-THE Room XT225 LC DPC-971 TDA2040 KRF-X9060D AM 12 DSC-S600 NWZ-S638F Doro 5045 MB-3907C SGH-A847 QG-H700 Transfer FAX Microtower PC U5-332 BCS-FS505 RH278 LE37B530 T710PH Drive SLV-D920N

 

manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding

 

Sitemap

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101