IFinance.Rate

Syntax

Rate(PeriodCount: Integer; PeriodPayment: Double; PresentValue: Double; [FutureValue: Double = 0;] [Type: Integer = 0;] [Guess: Double= 0.1]): Double;

Rate(PeriodCount: integer; PeriodPayment: double; PresentValue: double; FutureValue: double; Type: integer; Guess: double): double;

Parameters

PeriodCount. Total number of annuity payment periods. Parameter value must be greater than zero

PeriodPayment. The payment, made each period; this value cannot change during the whole payments period. The parameter value must differ by sign from the PresentValue parameter value.

PresentValue. The present value or total sum that at the moment is equal to the future payments. The parameter value must differ by sign from the PeriodPayment parameter value.

FutureValue. Value of the future value, that is, the desired remainder after the last payment. The default value is 0.

Type. Selecting payment time. Available values:

The default value is 0.

Guess. Expected interest rate. Default value is 0.1.

Description

The Rate method returns annual interest rate for one period.

Comments

Rate is calculated by converging iteration process, that is why if consequent results of the Rate function are not equal with the accuracy up to 0.0000001, Rate returns error message.

If the Rate function does not converge, try to change value of the Guess parameter. The Rate function usually converges if value of this parameter is set between 0 and 1.

Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: String;
Begin
    r := 
CultureInfo.Current.FormatDoublePrec(Finance.Rate(48, -2008000000.01), 2);
    Debug.WriteLine(r);
End Sub UserProc;

Imports Prognoz.Platform.Interop.MathFin;
Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params: StartParams);
Var
    r: String;
    Finance: FinanceClass = New FinanceClass();
    CultInf: CultureInfoClass = New CultureInfoClass();
Begin
    r := CultInf.Current.FormatDoublePrec(Finance.Rate(48, -2008000000.01), 2);
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

After executing the example the console window displays the interest rate equal to 0.01 or 1%.

See also:

IFinance