CIRProcess.CIR2.ab C# (CSharp) Method

ab() public method

This function calculated drift and volatility in the Cox-Ingersoll-Ross Two factors Markov process. The formula to calculate the B component is B[0] = sqrt(previous state) * sigma1 B[1] = sqrt(previous state) * sigma2.
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 drift.
return void
        public void ab(int i, double* x, double* a,double *b)
        {
            a[0] = this.k1.fV() * (this.theta1.fV() - x[0]);
            a[1] = this.k2.fV() * (this.theta2.fV() - x[1]);

            b[0] = AdjSqrt(x[0]) * this.sigma1.fV();
            b[1] = AdjSqrt(x[1]) * this.sigma2.fV();
        }