C# Class CIRProcess.CIR

Inheritance: IExtensibleProcessIR, IMarkovSimulator, IParsable, IEstimationResultPopulable, IGreeksDerivativesInfo, IExportableContainer
Afficher le fichier Open project: fairmat/InterestRatesModels

Méthodes publiques

Свойство Type Description
k IModelParameter
r0 IModelParameter
sigma IModelParameter
theta IModelParameter

Méthodes publiques

Méthode Description
Bond ( IReadOnlyMatrixSlice dynamic, double dates, int i, double t, double s ) : double

Calculates the value of a Bond under the Cox-Ingersoll-Ross model.

CIR ( ) : System

Default constructor, sets all the values to a default of 0.001.

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.

Parse ( IProject context ) : bool

Ensure the parameters are correct.

Populate ( IStochasticProcess container, EstimationResult estimate ) : void

Populate editable fields from name and value vectors specific to the CIR process.

Setup ( double dates ) : void

Called by Simulator after parse. Calculates the variables d and nu for faster execution.

a ( int i, double x, double a ) : void

This function defines the drift in the Cox-Ingersoll-Ross Markov process. The formula to calculate the A component is A = k * (theta - max(previous state, 0)).

ab ( int i, double x, double a, double b ) : void

This function calculates the drift and the volatility in the Cox-Ingersoll-Ross Markov process. as A = k * (theta - max(previous state, 0)). B = sigma * sqrt(max(previous state, 0)).

b ( int i, double x, double b ) : void

This function defines the volatility in the Cox-Ingersoll-Ross Markov process. The formula to calculate the B component is B = sigma * sqrt(max(previous state, 0)).

isLog ( bool &isLog ) : void

Sets the passed array with a Boolean stating if the process must be simulated as a log-normal process.

Private Methods

Méthode Description
SetParametersValue ( ) : void

Prepares the serialized model parameters with the provided values.

Method Details

Bond() public méthode

Calculates the value of a Bond under the Cox-Ingersoll-Ross model.
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 variable must be sampled. ///
t double /// The date in years/fractions at at which the state variable must be sampled. ///
s double /// The maturity of the bond. ///
Résultat double

CIR() public méthode

Default constructor, sets all the values to a default of 0.001.
public CIR ( ) : System
Résultat System

ExportObjects() public méthode

Creates a list of all the sub-objects that can be edited.
public ExportObjects ( bool recursive ) : List
recursive bool /// The parameter is not used. ///
Résultat List

GetDeltaFactors() public méthode

Gets the factors for Delta Greek derivative.
public GetDeltaFactors ( ) : IModelParameter[]
Résultat IModelParameter[]

GetVegaFactors() public méthode

Gets the factors for Vega Greek derivative.
public GetVegaFactors ( ) : IModelParameter[]
Résultat IModelParameter[]

Parse() public méthode

Ensure the parameters are correct.
public Parse ( IProject context ) : bool
context IProject /// The underlying project. ///
Résultat bool

Populate() public méthode

Populate editable fields from name and value vectors specific to the CIR process.
public Populate ( IStochasticProcess container, EstimationResult estimate ) : void
container IStochasticProcess /// The stochastic process which is being referenced to. ///
estimate EstimationResult /// The estimation result which contains values and names of parameters. ///
Résultat void

Setup() public méthode

Called by Simulator after parse. Calculates the variables d and nu for faster execution.
public Setup ( double dates ) : void
dates double The parameter is not used.
Résultat void

a() public méthode

This function defines the drift in the Cox-Ingersoll-Ross Markov process. The formula to calculate the A component is A = k * (theta - max(previous state, 0)).
public a ( int i, double x, double a ) : void
i int The parameter is not used.
x double The state vector at the previous state.
a double The output of the function.
Résultat void

ab() public méthode

This function calculates the drift and the volatility in the Cox-Ingersoll-Ross Markov process. as A = k * (theta - max(previous state, 0)). B = sigma * sqrt(max(previous state, 0)).
public ab ( int i, double x, double a, double b ) : void
i int The parameter is not used.
x double The state vector at the previous state.
a double
b double The output of the function.
Résultat void

b() public méthode

This function defines the volatility in the Cox-Ingersoll-Ross Markov process. The formula to calculate the B component is B = sigma * sqrt(max(previous state, 0)).
public b ( int i, double x, double b ) : void
i int The parameter is not used.
x double The state vector at the previous state.
b double The output of the function.
Résultat void

isLog() public méthode

Sets the passed array with a Boolean stating if the process must be simulated as a log-normal process.
public isLog ( bool &isLog ) : void
isLog bool /// A reference to the array to be set with the required information. /// The array contains a single member set to false as this simulation /// is not log-normal. ///
Résultat void

Property Details

k public_oe property

The k parameter of the model. It's the mean reversion speed.
public IModelParameter k
Résultat IModelParameter

r0 public_oe property

The starting point for the model.
public IModelParameter r0
Résultat IModelParameter

sigma public_oe property

The sigma parameter of the model. It's the volatility.
public IModelParameter sigma
Résultat IModelParameter

theta public_oe property

The theta parameter of the model. It's the long term mean.
public IModelParameter theta
Résultat IModelParameter