Learn R Programming

brfinance (version 0.8.0)

calc_rate: Interest Rate (RATE)

Description

Calculates the interest rate per period.

Usage

calc_rate(
  n,
  pv,
  fv = 0,
  pmt = 0,
  type = 0,
  guess = 0.1,
  max_iter = 100,
  tol = 1e-08
)

Value

Interest rate per period.

Arguments

n

Number of periods.

pv

Present value.

fv

Future value.

pmt

Payment per period (optional, default = 0).

type

Payment timing: 0 for end of period, 1 for beginning of period.

guess

Initial guess for the rate (default = 0.1).

max_iter

Maximum number of iterations (default = 100).

tol

Tolerance for convergence (default = 1e-8).

Examples

Run this code
calc_rate(n = 12, pv = -1000, fv = 2000)
calc_rate(n = 60, pv = -20000, fv = 0, pmt = 386.66)

Run the code above in your browser using DataLab