Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

simTermStructs

Class: LinearGaussian2F

Simulate term structures for two-factor additive Gaussian interest-rate model

Syntax

[ZeroRates,ForwardRates] = simTermStructs(nPeriods)
[ZeroRates,ForwardRates] = simTermStructs(nPeriods,Name,Value)

Description

[ZeroRates,ForwardRates] = simTermStructs(nPeriods) simulates future zero curve paths using a specified LinearGaussian2F object.

[ZeroRates,ForwardRates] = simTermStructs(nPeriods,Name,Value) simulates future zero curve paths using a specified LinearGaussian2F object with additional options specified by one or more Name,Value pair arguments.

Input Arguments

nPeriods

Number of simulation periods. For example, to simulate 12 years with an annual spacing. specify 12 as the nPeriods input and 1 as the optional deltaTime input (note that the default value for deltaTime is 1).

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'deltaTime'

Time step between nPeriods, specified as a scalar or vector. For example, to simulate 12 years with an annual spacing. specify 12 as the nPeriods input and 1 as the optional deltaTime input (note that the default value for deltaTime is 1).

Default: 1

'nTrials'

Positive scalar integer number of simulated trials (sample paths) 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.

Default: 1

'antithetic'

Boolean scalar 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). For details, see simBySolution for the HWV model.

Default: false

'Z'

Direct specification of the dependent random noise process used to generate the zero-drift, unit-variance rate Brownian vector dW(t) that drives the simulation. For details, see simBySolution for the HWV model.

Default: Uses default for simBySolution. If you do not specify a value for Z, simBySolution generates Gaussian variates.

'Tenor'

Numeric vector of maturities to compute at each time step.

Default: tenor of the LinearGaussian2F object's zero curve

Output Arguments

ZeroRates

nPeriods+1-by-nTenors-by-nTrials matrix of simulated zero-rate term structures.

ForwardRates

nPeriods+1-by-nTenors-by-nTrials matrix of simulated forward-rate term structures. The ForwardRates output is computed using the simulated short rates and by using the model definition to recover the entire yield curve at each simulation date.

Attributes

Accesspublic
Staticfalse
Hiddenfalse

To learn about attributes of methods, see Method Attributes (MATLAB).

Examples

expand all

Create a two-factor additive Gaussian interest-rate model.

Settle = datenum('15-Dec-2007');
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);
    
a = .07;
b = .5;
sigma = .01;
eta = .006;
rho = -.7;
 
G2PP = LinearGaussian2F(irdc,a,b,sigma,eta,rho)
G2PP = 
  LinearGaussian2F with properties:

    ZeroCurve: [1×1 IRDataCurve]
            a: @(t,V)ina
            b: @(t,V)inb
        sigma: @(t,V)insigma
          eta: @(t,V)ineta
          rho: -0.7000

Use the simTermStructs method to simulate term structures based on the LinearGaussian2F model.

 SimPaths = simTermStructs(G2PP, 10,'nTrials',100);

Create a two-factor additive Gaussian interest-rate model.

Settle = datenum('15-Dec-2007');
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);
a = .07;
b = .5;
sigma = .01;
eta = .006;
rho = -.7;
G2PP = LinearGaussian2F(irdc,a,b,sigma,eta,rho)
G2PP = 
  LinearGaussian2F with properties:

    ZeroCurve: [1×1 IRDataCurve]
            a: @(t,V)ina
            b: @(t,V)inb
        sigma: @(t,V)insigma
          eta: @(t,V)ineta
          rho: -0.7000

Use the simTermStructs method to simulate term structures based on the LinearGaussian2F object, where uneven simulation tenors are specified using the optional name-value argument deltaTime as a vector of length NPeriods.

NPeriods = 10;               
dt = rand(NPeriods,1);
SimPaths = G2PP.simTermStructs(NPeriods,'nTrials',100,'DeltaTime',dt);

Introduced in R2013a

Was this topic helpful?