Pricing Options Structure
Introduction
The MATLAB®
Options
structure provides additional input to most pricing functions.
The Options
structure
Tells pricing functions how to use the interest-rate tree to calculate instrument prices.
Determines what additional information the Command Window displays along with instrument prices.
Tells pricing functions which method to use in pricing barrier options.
The pricing options structure is primarily used in the pricing of interest-rate-based
financial derivatives. However, the BarrierMethod
field in the structure
allows you to use it in pricing equity barrier options as well.
You provide pricing options in an optional Options
argument
passed to a pricing function. (See, for example, bondbyhjm
, bdtprice
, barrierbycrr
, barrierbyeqp
,
or barrierbyitt
.)
Default Structure
If you do not specify the Options
argument in the call to a pricing
function, the function uses a default structure. To observe the default structure, use
derivset
without any arguments.
Options = derivset
Options = Diagnostics: 'off' Warnings: 'on' ConstRate: 'on' BarrierMethod: 'unenhanced'
The Options
structure has four fields: Diagnostics
,
Warnings
, ConstRate
, and
BarrierMethod
.
Diagnostics Field
Diagnostics
indicates whether additional information is displayed
if the tree is modified. The default value for this option is 'off'
. If
Diagnostics
is set to 'on'
and
ConstRate
is set to 'off'
, the pricing functions
display information such as the number of nodes in the last level of the tree generated
for pricing purposes.
Warnings Field
Warnings
indicates whether to display warning messages when the
input tree is not adequate for accurately pricing the instruments. The default value for
this option is 'on'
. If both ConstRate
and
Warnings
are 'on'
, a warning is displayed if any
of the instruments in the input portfolio have a cash flow date between tree dates. If
ConstRate
is 'off'
, and
Warnings
is 'on'
, a warning is displayed if the
tree is modified to match the cash flow dates on the instruments in the portfolio.
ConstRate Field
ConstRate
indicates whether the interest rates should be assumed
constant between tree dates. By default this option is 'on'
, which is
not an arbitrage-free assumption. So the pricing functions return an approximate price for
instruments featuring cash flows between tree dates. Instruments featuring cash flows only
on tree nodes are not affected by this option and return exact (arbitrage-free) prices.
When ConstRate
is 'off'
, the pricing function finds
the cash flow dates for all instruments in the portfolio. If these cash flows do not align
exactly with the tree dates, a new tree is generated and used for pricing. This new tree
features the same volatility and initial rate specifications of the input tree but
contains tree nodes for each date in which at least one instrument in the portfolio has a
cash flow. Keep in mind that the number of nodes in a tree grows exponentially with the
number of tree dates. So, setting ConstRate
'off'
dramatically increases the memory and processor demands on the
computer.
BarrierMethod Field
When using binomial trees to price barrier options, this may require many tree steps
to achieve an accurate result when tree nodes do not align with the barrier level. With
the BarrierMethod
field, the toolbox provides an enhancement method
that improves the accuracy of the results without having to use large trees.
The BarrierMethod
field can be set to
'unenhanced'
(default) or 'interp'
. If you specify
'unenhanced'
, no correction calculation is used. Otherwise, if you
specify 'interp'
, the toolbox provides an enhanced valuation by
interpolating between nodes on barrier boundaries.
You specify the barrier method in the last input argument, Options
,
of the functions barrierbycrr
, barrierbyeqp
, barrierbyitt
, crrprice
, eqpprice
, ittprice
, crrsens
, eqpsens
, or ittsens
. Options
is a
structure that you create with the function derivset
. Using derivset
, you specify whether to use the
enhanced or the unenhanced method.
For more information about this algorithm, see Derman, E., I. Kani, D. Ergener and I. Bardhan, “Enhanced Numerical Methods for Options with Barriers,” Financial Analysts Journal, (Nov. - Dec. 1995), pp. 65–74.
Customizing the Structure
Customize the Options structure by passing property name/property
value pairs to the derivset
function.
As an example, consider an Options structure with ConstRate
'off'
and Diagnostics
'on'
.
Options = derivset('ConstRate', 'off', 'Diagnostics', 'on')
Options = struct with fields: Diagnostics: 'on' Warnings: 'on' ConstRate: 'off' BarrierMethod: 'unenhanced'
To obtain the value of a specific property from the Options
structure, use derivget
.
CR = derivget(Options, 'ConstRate')
CR = 'off'
Note
Use derivset
and derivget
to construct the Options structure.
These functions are guaranteed to remain unchanged, while the implementation
of the structure itself may be modified in the future.
Now observe the effects of setting ConstRate
'off'
.
Obtain the tree dates from the HJM tree.
load deriv.mat TreeDates = [HJMTree.TimeSpec.ValuationDate;... HJMTree.TimeSpec.Maturity]
TreeDates = 730486 730852 731217 731582 731947
datedisp(TreeDates)
01-Jan-2000 01-Jan-2001 01-Jan-2002 01-Jan-2003 01-Jan-2004
All instruments in HJMInstSet
settle on January
1, 2000, and all have cash flows once a year, except for the second
bond, which features a period of 2. This bond has cash flows twice
a year, with every other cash flow consequently falling between tree
dates. You can extract this bond from the portfolio to compare how
its price differs by setting ConstRate
to 'on'
and 'off'
.
BondPort = instselect(HJMInstSet, 'Index', 1);
instdisp(BondPort)
Index Type CouponRate Settle Maturity Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face Name Quantity 1 Bond 0.04 01-Jan-2000 01-Jan-2003 1 NaN NaN NaN NaN NaN NaN NaN 4% bond 100
First price the bond with ConstRate
'on'
(default).
format long
[BondPrice, BondPriceTree] = hjmprice(HJMTree, BondPort)
BondPrice = 98.715915161671376 BondPriceTree = struct with fields: FinObj: 'HJMPriceTree' PBush: {[98.715915161671376] [1×1×2 double] [1×2×2 double] [1×4×2 double] [0 0 0 0 0 0 0 0]} AIBush: {[0] [1×1×2 double] [1×2×2 double] [1×4×2 double] [0 0 0 0 0 0 0 0]} tObs: [0 1 2 3 4]
Now recalculate the price of the bond setting ConstRate
'off'
.
OptionsNoCR = derivset('ConstR', 'off')
OptionsNoCR = struct with fields: Diagnostics: 'off' Warnings: 'on' ConstRate: 'off' BarrierMethod: 'unenhanced'
[BondPriceNoCR, BondPriceTreeNoCR] = hjmprice(HJMTree,... BondPort, OptionsNoCR)
BondPriceNoCR = 98.715915161671376 BondPriceTreeNoCR = struct with fields: FinObj: 'HJMPriceTree' PBush: {[98.715915161671376] [1×1×2 double] [1×2×2 double] [1×4×2 double] [0 0 0 0 0 0 0 0]} AIBush: {[0] [1×1×2 double] [1×2×2 double] [1×4×2 double] [0 0 0 0 0 0 0 0]} tObs: [0 1 2 3 4]
The cash flows of the bond align with the tree dates. You can use the treeviewer
function to see the prices of these instruments along the price
tree.
size(BondPriceTree.PBush{end})
ans = 1 8
size(BondPriceTreeNoCR.PBush{end})
ans = 1 8
See Also
instasian
| instbarrier
| instcompound
| instlookback
| instoptstock
Related Examples
- Pricing Equity Derivatives Using Trees
- Pricing European Call Options Using Different Equity Models
- Pricing Using the Black-Scholes Model
- Compute Option Prices on a Forward
- Compute Forward Option Prices and Delta Sensitivities
- Compute the Option Price on a Future
- Pricing Asian Options