# G2 (3) - Linux Manuals

## G2: Two-additive-factor gaussian model class.

## NAME

QuantLib::G2 - Two-additive-factor gaussian model class.

## SYNOPSIS

#include <ql/models/shortrate/twofactormodels/g2.hpp>

Inherits **QuantLib::TwoFactorModel**, **QuantLib::AffineModel**, and **QuantLib::TermStructureConsistentModel**.

### Classes

class **FittingParameter**

*Analytical term-structure fitting parameter $ ndle*< **YieldTermStructure** > &termStructure, Real a=0.1, Real sigma=0.01, Real b=0.1, Real eta=0.01, Real rho=-0.75)"

### Public Member Functions

**G2** (const **Handle**< **YieldTermStructure** > &termStructure, Real a=0.1, Real sigma=0.01, Real b=0.1, Real eta=0.01, Real rho=-0.75)

boost::shared_ptr< **ShortRateDynamics** > **dynamics** () const

*Returns the short-rate dynamics. *

virtual Real **discountBond** (Time now, Time maturity, **Array** factors) const

Real **discountBond** (Time, Time, **Rate**, **Rate**) const

Real **discountBondOption** (Option::Type type, Real strike, Time maturity, Time bondMaturity) const

Real **swaption** (const **Swaption::arguments** &arguments, **Rate** fixedRate, Real range, Size intervals) const

**DiscountFactor** **discount** (Time t) const

*Implied discount curve. *

### Protected Member Functions

void **generateArguments** ()

Real **A** (Time t, Time T) const

Real **B** (Real x, Time t) const

### Friends

## Detailed Description

Two-additive-factor gaussian model class.

This class implements a two-additive-factor model defined by [ dr_t = nd $ y_t $ are defined by [ dx_t = -a x_t dt + igma dW^1_t, x_0 = 0 ] [ dy_t = -b y_t dt + igma dW^2_t, y_0 = 0 ] and $ dW^1_t dW^2_t = ho dt $.

**Bug**

- This class was not tested enough to guarantee its functionality.

**Examples: **

**BermudanSwaption.cpp**.

## Author

Generated automatically by Doxygen for QuantLib from the source code.