Accelerating the pace of engineering and science

# floorbylg2f

Price floor using Linear Gaussian two-factor model

## Syntax

• FloorPrice = floorbylg2f(ZeroCurve,a,b,sigma,eta,rho,Strike,
Maturity)
example
• FloorPrice = floorbylg2f(___,Name,Value) example

## Description

example

FloorPrice = floorbylg2f(ZeroCurve,a,b,sigma,eta,rho,Strike,
Maturity)
returns the floor price for a two-factor additive Gaussian interest-rate model.

example

FloorPrice = floorbylg2f(___,Name,Value) returns the floor price for a two-factor additive Gaussian interest-rate model using optional name-value pairs.

 Note:   Use the optional name-value pair argument, Notional, to pass a schedule to compute the price for an amortizing floor.

## Examples

expand all

### Price a Floor Using a Linear Gaussian Two-Factor Model

Define the ZeroCurve, a, b, sigma, eta, and rho parameters to compute the floor price.

```Settle = datenum('15-Dec-2007');

ZeroTimes = [3/12 6/12 1 5 7 10 20 30]';
ZeroRates = [0.033 0.034 0.035 0.040 0.042 0.044 0.048 0.0475]';

irdc = IRDataCurve('Zero',Settle,CurveDates,ZeroRates);

a = .07;
b = .5;
sigma = .01;
eta = .006;
rho = -.7;

FloorMaturity = daysadd(Settle,360*[1:5 7 10 15 20 25 30],1);

Strike = [0.035 0.037 0.038 0.039 0.040 0.042 0.044 0.046 0.047 0.047 0.047]';

Price = floorbylg2f(irdc,a,b,sigma,eta,rho,Strike,FloorMaturity)
```
```Price =

0
0.4041
0.8282
1.3103
1.8346
3.0636
4.9172
7.7614
9.7166
11.4163
12.7628

```

### Price an Amortizing Floor Using a Linear Gaussian Two-Factor Model

Define the ZeroCurve, a, b, sigma, eta, rho, and Notional parameters for the amortizing floor.

```Settle = datenum('15-Dec-2007');
% Define ZeroCurve
ZeroTimes = [3/12 6/12 1 5 7 10 20 30]';
ZeroRates = [0.033 0.034 0.035 0.040 0.042 0.044 0.048 0.0475]';

irdc = IRDataCurve('Zero',Settle,CurveDates,ZeroRates);

% Define a, b, sigma, eta, and rho
a = .07;
b = .5;
sigma = .01;
eta = .006;
rho = -.7;

% Define the amortizing floors
FloorMaturity = daysadd(Settle,360*[1:5 7 10 15 20 25 30],1);
Strike = [0.025 0.036 0.037 0.038 0.039 0.041 0.043 0.045 0.046 0.046 0.046]';
Notional = {{'15-Dec-2012' 100;'15-Dec-2017' 70;'15-Dec-2022' 40;'15-Dec-2037' 10}};

% Price the amortizing floors
Price = floorbylg2f(irdc,a,b,sigma,eta,rho,Strike,FloorMaturity,'Notional',Notional)
```
```Price =

0
0.2633
0.6438
1.0815
1.5637
2.5196
3.9061
5.4326
6.0416
6.2033
6.3316

```

## Input Arguments

expand all

### ZeroCurve — Zero curve for Linear Gaussian two-factor modelstructure

Zero curve for the Linear Gaussian two-factor model, specified using IRDataCurve or RateSpec.

Data Types: struct

### a — Mean reversion for first factor for Linear Gaussian two-factor modelscalar

Mean reversion for the first factor for the Linear Gaussian two-factor model, specified as a scalar.

Data Types: single | double

### b — Mean reversion for second factor for Linear Gaussian two-factor modelscalar

Mean reversion for the second factor for the Linear Gaussian two-factor model, specified as a scalar.

Data Types: single | double

### sigma — Volatility for first factor for Linear Gaussian two-factor modelscalar

Volatility for the first factor for the Linear Gaussian two-factor model, specified as a scalar.

Data Types: single | double

### eta — Volatility for second factor for Linear Gaussian two-factor modelscalar

Volatility for the second factor for the Linear Gaussian two-factor model, specified as a scalar.

Data Types: single | double

### rho — Scalar correlation of factorsscalar

Scalar correlation of the factors, specified as a scalar.

Data Types: single | double

### Strike — Floor strike pricenonnegative integer | vector of nonnegative integers

Floor strike price specified, as a nonnegative integer using a NumFloors-by-1 vector of floor strike prices.

Data Types: single | double

### Maturity — Floor maturity datenonnegative integer | vector of nonnegative integers | string of dates

Floor maturity date, specified using a NumFloors-by-1 vector of serial date numbers or date strings.

Data Types: single | double | cell

### 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.

Example: Price = floorbylg2f(irdc,a,b,sigma,eta,rho,Strike,FloorMaturity,'Reset',1,'Notional',100)

### 'Reset' — Frequency of floor payments per year2 (default) | positive integer from the set [1,2,3,4,6,12] | vector of positive integers from the set [1,2,3,4,6,12]

Frequency of floor payments per year, specified as positive integers for the values [1,2,4,6,12] in a NumFloors-by-1 vector.

Data Types: single | double

### 'Notional' — Notional value of floor100 (default) | nonnegative integer | vector of nonnegative integers

NINST-by-1 of notional principal amounts or NINST-by-1 cell array where each element is a NumDates-by-2 cell array where the first column is dates and the second column is the associated principal amount. The date indicates the last day that the principal value is valid.

Data Types: single | double

## Output Arguments

expand all

### FloorPrice — Floor pricescalar | vector

Floor price, returned as a scalar or a NumFloors-by-1 vector.

expand all

### Algorithms

The following defines the two-factor additive Gaussian interest-rate model, given the ZeroCurve, a, b, sigma, eta, and rho parameters:

$r\left(t\right)=x\left(t\right)+y\left(t\right)+\varphi \left(t\right)$

$dx\left(t\right)=-a\left(x\right)\left(t\right)dt+\sigma \left(d{W}_{1}\left(t\right),x\left(0\right)=0$

$dy\left(t\right)=-b\left(y\right)\left(t\right)dt+\eta \left(d{W}_{2}\left(t\right),y\left(0\right)=0$

where $d{W}_{1}\left(t\right)d{W}_{2}\left(t\right)=\rho dt$ is a two-dimensional Brownian motion with correlation ρ and ϕ is a function chosen to match the initial zero curve.

## References

[1] Brigo, D. and F. Mercurio, Interest Rate Models - Theory and Practice, Springer Finance, 2006.