Property | Type | Description | |
---|---|---|---|
_a1 | IModelParameter | ||
_a2 | IModelParameter | ||
_rho | IModelParameter | ||
_s1 | IModelParameter | ||
_s2 | IModelParameter |
Method | Description | |
---|---|---|
Bond ( IReadOnlyMatrixSlice dynamic, double dates, int i, double t, double s ) : double |
Calculates the value of a Bond under the Hull and White Two factors model.
|
|
ExportObjects ( bool recursive ) : List |
Creates a list of all the sub-objects that can be edited.
|
|
GetDeltaFactors ( ) : IModelParameter[] |
Gets the factors for Delta Greek derivative.
|
|
GetVegaFactors ( ) : IModelParameter[] |
Gets the factors for Vega Greek derivative.
|
|
GetZeroRateReference ( ) : string |
Gets the zero rate reference.
|
|
HW2 ( ) : System |
Initializes a new instance of the HullAndWhiteTwoFactors.HW2 class. This is the default constructor and sets the default values of several components of the model: * alpha 1 = 0.1 * sigma 1 = 0.001 * alpha 2 = 0.01 * sigma 2 = 0.001 * rho = 0.001 * No zero rate. * drift correction = 0.
|
|
Parse ( IProject p_Context ) : bool |
Parses the data and ensures the parameters are correct.
|
|
Populate ( string names, double values ) : void |
Populate editable fields from name and value vectors specific to HW2.
|
|
SetZeroRateReference ( string zr ) : void |
Associate the process to a zero rate defined in the Fairmat model (e.g. @zr1).
|
|
Setup ( double dates ) : void |
Called by Simulator after parse. Initializes here time-dependant but not state dependent variables.
|
|
a ( int i, double x, double a ) : void |
This function calculates the drift in the HW2 Markov process.
|
|
ab ( int i, double x, double a, double b ) : void | ||
b ( int i, double x, double b ) : void |
This function updates the volatility parameters (vector b) of the HW2 process.
|
|
isLog ( bool &isLog ) : void |
Sets the passed array with a Booleans stating if the process components must be simulated as a log-normal process.
|
|
va ( int i, System.Matrix x, System.Matrix a ) : void |
Vectorial version of method a.
|
Method | Description | |
---|---|---|
DF ( double t, double dt ) : double |
Numerically calculates the derivative of function F().
|
|
F ( double t, double dt ) : double |
Numerically calculates the instantaneous forward rate.
|
|
Theta ( double t, double dt ) : double |
Calculates the theta element of the Hull And White formula which will be stored in the theta in order to be used during simulation.
|
Method | Description | |
---|---|---|
BondHW2 ( Project context, SPCache cache, |
Price of a zcb at t > 0 with maturity TT > t as a function of the rate R, of the factor u at t and of the current zr curve (ZR) using the Hull & White two-factor model dr = (theta(t) + u - a * r) * dt + sigma1 * dz1 du = -b * du * dt + sigma2 * dz2 with dz1 * dz2 = rho * dt (see Hull-White (1994) Journal of Derivatives).
|
|
CalculateInnerModelParameters ( ) : void |
Calculates and caches the model parameters for use during the simulation.
|
|
DPhi ( double t, double dt ) : double |
Calculates either the right numerical derivative or the central numerical derivative of Phi.
|
|
OnDeserialized ( |
||
Phi ( double t ) : double |
Calculates the standard normal cumulative distribution function.
|
|
Preprocessing ( ) : void |
Does a preliminary processing of all the parameters and required data which will be used during the simulation.
|
|
ZCB ( double t ) : double |
Calculates the value of a Zero Coupon Bond.
|
|
Zr ( double t ) : double |
Evaluates the referenced zr.
|
public Bond ( IReadOnlyMatrixSlice dynamic, double dates, int i, double t, double s ) : double | ||
dynamic | IReadOnlyMatrixSlice | /// The simulated process. /// |
dates | double | /// The vector of reference dates. /// |
i | int | /// The index at which the state variables must be sampled. /// |
t | double | /// The date in years/fractions at at which the state variables must be sampled. /// |
s | double | /// The maturity of the bond. /// |
return | double |
protected DF ( double t, double dt ) : double | ||
t | double | /// Time at which calculate the derivative. /// |
dt | double | /// Semi-interval to be used in the numerical derivative. /// |
return | double |
public ExportObjects ( bool recursive ) : List |
||
recursive | bool | /// The parameter is not used. /// |
return | List |
protected F ( double t, double dt ) : double | ||
t | double | /// Time at which calculate the forward rate. /// |
dt | double | /// Interval to be used in the numerical derivative. /// |
return | double |
public GetDeltaFactors ( ) : IModelParameter[] | ||
return | IModelParameter[] |
public GetVegaFactors ( ) : IModelParameter[] | ||
return | IModelParameter[] |
public Parse ( IProject p_Context ) : bool | ||
p_Context | IProject | /// The underlying project. /// |
return | bool |
public Populate ( string names, double values ) : void | ||
names | string | /// An array with the names of the variable, /// will search for alpha1 (or a1), sigma1 (or sigma), alpha2 (or a2), sigma2 and rho. /// |
values | double | The values associated to the parameters in names. |
return | void |
public SetZeroRateReference ( string zr ) : void | ||
zr | string | /// The zero rate reference. /// |
return | void |
public Setup ( double dates ) : void | ||
dates | double | /// The dates at which the process realizations will be requested. /// |
return | void |
protected Theta ( double t, double dt ) : double | ||
t | double | The position in which this value will be calculated. |
dt | double | The delta between this t position and the previous one. |
return | double |
public a ( int i, double x, double a ) : void | ||
i | int | The time step of the simulation. |
x | double | The state vector at the previous state. |
a | double | The drift,output of the function. |
return | void |
public ab ( int i, double x, double a, double b ) : void | ||
i | int | |
x | double | |
a | double | |
b | double | |
return | void |
public b ( int i, double x, double b ) : void | ||
i | int | The parameter is not used. |
x | double | The parameter is not used. |
b | double | The output of the function. |
return | void |
public isLog ( bool &isLog ) : void | ||
isLog | bool | /// A reference to the array to be set with the required information. /// |
return | void |
public va ( int i, System.Matrix x, System.Matrix a ) : void | ||
i | int | The discrete time-step. |
x | System.Matrix | The actual state matrix. |
a | System.Matrix | The output drift matrix. |
return | void |