simTermStructs
Simulate term structures for LIBOR Market Model
Syntax
Description
[
simulates future zero curve paths using a specified ZeroRates
,ForwardRates
] = simTermStructs(LMM
,nPeriods
)LiborMarketModel
object.
[
adds optional name-value pair arguments. ZeroRates
,ForwardRates
] = simTermStructs(___,Name,Value
)
Examples
Simulate Term Structures for a LIBOR Market Model
Create a LMM
object.
Settle = datetime(2007,12,15); CurveTimes = [1:5 7 10 20]'; ZeroRates = [.01 .018 .024 .029 .033 .034 .035 .034]'; CurveDates = daysadd(Settle,360*CurveTimes,1); irdc = IRDataCurve('Zero',Settle,CurveDates,ZeroRates); LMMVolFunc = @(a,t) (a(1)*t + a(2)).*exp(-a(3)*t) + a(4); LMMVolParams = [.3 -.02 .7 .14]; numRates = 20; VolFunc(1:numRates-1) = {@(t) LMMVolFunc(LMMVolParams,t)}; Beta = .08; CorrFunc = @(i,j,Beta) exp(-Beta*abs(i-j)); Correlation = CorrFunc(meshgrid(1:numRates-1)',meshgrid(1:numRates-1),Beta); LMM = LiborMarketModel(irdc,VolFunc,Correlation,'Period',1)
LMM = LiborMarketModel with properties: ZeroCurve: [1x1 IRDataCurve] VolFunctions: {1x19 cell} Correlation: [19x19 double] NumFactors: NaN Period: 1
Simulate the term structures for the specified LMM
object.
[ZeroRates, ForwardRates] = simTermStructs(LMM, 20,'nTrials',100);
Input Arguments
LMM
— LiborMarketModel
object
object
LiborMarketModel
object, specified using the
LMM
object created using LiborMarketModel
.
Data Types: object
nPeriods
— Number of simulation periods
numeric
Number of simulation periods, specified as a numeric value. The
nPeriods
value is determined by the swaption expiry and the
periodicity of the rates of the model. For example, if you were to price a swaption
expiring in 5 years with a semiannual LIBOR Market Model (LMM), then
nPeriods
would be 10
.
Data Types: double
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is 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 enclose
Name
in quotes.
Example: [ZeroRates, ForwardRates] = simTermStructs(LMM,
20,'nTrials',100)
nTrials
— Number of simulated trials
1
(default) | positive integer
Number of simulated trials (sample paths), specified as the comma-separated pair
consisting of 'nTrials'
and a positive scalar integer value of
nPeriods
observations each. If you do not specify a value for
this argument, the default is 1
, indicating a single path of
correlated state variables.
Data Types: double
antithetic
— Flag indicating whether antithetic sampling is used to generate Gaussian random variates
false
(default) | positive integer
Flag indicating whether antithetic sampling is used to generate the Gaussian
random variates that drive the zero-drift, unit-variance rate Brownian vector
dW(t), specified as the comma-separated pair
consisting of 'antithetic'
and a Boolean scalar flag. For details
on the Brownian vector, see simBySolution
.
Data Types: logical
Z
— Direct specification of dependent random noise process
generated by simBySolution
function (default) | numeric
Direct specification of the dependent random noise process, specified as the
comma-separated pair consisting of 'Z'
and a numeric value. The
Z
value is used to generate the zero-drift, unit-variance rate
Brownian vector dW(t) that drives the
simulation. For details, see simBySolution
for the GBM model.
Data Types: double
Tenor
— Maturities to compute at each time step
number of rates in LiborMarketModel
object (default) | numeric vector
Maturities to compute at each time step, specified as the comma-separated pair
consisting of 'Tenor'
and a numeric vector.
Tenor
enables you to choose a different set of rates to
output than the underlying rates. For example, you may want to simulate quarterly
data but only report annual rates; this can be done by specifying the optional input
Tenor
.
The default for tenor
is the number of rates in the LiborMarketModel
object as specified
by the Correlation
and VolFunc
input arguments
for the LiborMarketModel
object.
Data Types: double
Output Arguments
ZeroRates
— Simulated zero-rate term structures
matrix
Simulated zero-rate term structures, returned as a
nPeriods+1
-by-nTenors
-by-nTrials
matrix.
ForwardRates
— Simulated forward-rate term structures
matrix
Simulated zero-rate term structures, returned as a
nPeriods+1
-by-nTenors
-by-nTrials
matrix.
Version History
Introduced in R2013a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)