# hjmvolspec

Specify Heath-Jarrow-Morton interest-rate volatility process

## Syntax

`Volspec = hjmvolspec(varargin)`

## Arguments

The arguments to `hjmvolspec` vary according to the type and number of volatility factors specified when calling the function. Factors are specified by pairs of names and parameter sets. Factor names can be `'Constant'`, `'Stationary'`, `'Exponential'`, `'Vasicek'`, or `'Proportional'`. The parameter set is specific for each of these factor types:

• Constant volatility (Ho-Lee):
```VolSpec = hjmvolspec('Constant', Sigma_0)```

• Stationary volatility:
```VolSpec = hjmvolspec('Stationary', CurveVol, CurveTerm)```

• Exponential volatility:
```VolSpec = hjmvolspec('Exponential', Sigma_0, Lambda)```

• Vasicek, Hull-White:
```VolSpec = hjmvolspec('Vasicek', Sigma_0, CurveDecay, CurveTerm)```

• Nearly proportional stationary:
```VolSpec = hjmvolspec('Proportional', CurveProp, CurveTerm, MaxSpot)```

You can specify more than one factor by concatenating names and parameter sets.

The following table defines the various arguments to `hjmvolspec`.

Argument

Description

`Sigma_0`

Scalar base volatility over a unit time.

`Lambda`

Scalar decay factor.

`CurveVol`

Number of curves (`NCURVES`)-by`1` vector of `Vol` values at sample points.

`CurveDecay`

`NCURVES`-by-`1` vector of `Decay` values at sample points.

`CurveProp`

`NCURVES`-by-`1` vector of `Prop` values at sample points.

`CurveTerm`

`NCURVES`-by-`1` vector of `Term` sample points.

 Note:   See the volatility specifications formulas below for a description of `Vol`, `Decay`, `Prop`, and `Term`.

## Description

`Volspec = hjmvolspec(varargin)` computes `VolSpec`, a structure that specifies the volatility model for `hjmtree`.

`hjmvolspec` specifies an HJM forward-rate volatility process. Each factor is specified with one of the functional forms.

Volatility SpecificationFormula

`Constant`

$\sigma \left(t,T\right)$ = Sigma_0

`Stationary`

$\sigma \left(t,T\right)$ = Vol(T`-`t) = Vol(Term)

`Exponential`

$\sigma \left(t,T\right)$ = Sigma_0*exp(-Lambda*(T`-`t))

`Vasicek`, `Hull-White`

$\sigma \left(t,T\right)$ = Sigma_0*exp(`-`Decay(T`-`t))

`Proportional`

$\sigma \left(t,T\right)$ = Prop(T`-`t)*max(SpotRate(t), MaxSpot)

The volatility process is $\sigma \left(t,T\right)$, where t is the observation time and T is the starting time of a forward rate. In a stationary process, the volatility term is T–t. Multiple factors can be specified sequentially.

The time values T, t, and `Term` are in coupon interval units specified by the `Compounding` input of `hjmtimespec`. For instance if `Compounding` = `2`, ```Term = 1``` is a semiannual period (six months).

## Examples

collapse all

### Compute the `VolSpec` Structure to Specify a Proportional Volatility Model for `HJMTree`

This example shows how to compute the `VolSpec` structure to specify the volatility model for `hjmtree` when volatility is single-factor proportional.

```CurveProp = [0.11765; 0.08825; 0.06865]; CurveTerm = [1; 2; 3]; VolSpec = hjmvolspec('Proportional', CurveProp, CurveTerm, 1e6) ```
```VolSpec = FinObj: 'HJMVolSpec' FactorModels: {'Proportional'} FactorArgs: {{1x3 cell}} SigmaShift: 0 NumFactors: 1 NumBranch: 2 PBranch: [0.5000 0.5000] Fact2Branch: [-1 1] ```

### Compute the `VolSpec` Structure to Specify an Exponential Volatility Model for `HJMTree`

This example shows how to compute the `VolSpec` structure to specify the volatility model for `hjmtree` when volatility is two-factor exponential and constant.

```VolSpec = hjmvolspec('Exponential', 0.1, 1, 'Constant', 0.2) ```
```VolSpec = FinObj: 'HJMVolSpec' FactorModels: {'Exponential' 'Constant'} FactorArgs: {{1x2 cell} {1x1 cell}} SigmaShift: 0 NumFactors: 2 NumBranch: 3 PBranch: [0.2500 0.2500 0.5000] Fact2Branch: [2x3 double] ```