You are on page 1of 2

Name: Abdullah Amin Reg:MAF223002 Quiz: 1

Submitted to: Dr Jaleel Subject: Financial analytics Date: 27 Mar, 2023

1-Nominal vs Real Interest rate.


In R software, nominal and real interest rates can be calculated and compared using several
functions and packages.
Nominal interest rate is the rate of interest without any adjustment for inflation. Real interest
rate, on the other hand, is the nominal interest rate adjusted for inflation. In other words, the
real interest rate reflects the purchasing power of money, while the nominal interest rate does
not.
Here are some functions and packages that can be used to calculate nominal and real interest
rates in R:
Nominal interest rate:
The simplest way to calculate the nominal interest rate is by dividing the annual interest rate by
the number of compounding periods per year. For example, to calculate the nominal interest
rate for an annual interest rate of 6% compounded monthly, you can use the following formula:
nominal_rate <- 0.06 / 12
This will give you a monthly nominal interest rate of 0.005.
Real interest rate:
To calculate the real interest rate, you need to adjust the nominal interest rate for inflation. The
inflation rate can be obtained from various sources, such as the Consumer Price Index (CPI). In
R, you can use the inflation() function from the fImport package to obtain inflation rates for
different countries. For example:
library(fImport)
inflation_rate <- inflation("USA")
This will give you the inflation rate for the United States.
To calculate the real interest rate, you can use the following formula:
real_rate <- (1 + nominal_rate) / (1 + inflation_rate) - 1
This will give you the real interest rate adjusted for inflation.
Overall, R software provides several functions and packages that can be used to calculate
nominal and real interest rates. The choice of method will depend on the specific research
question and the availability of data.
Name: Abdullah Amin Reg:MAF223002 Quiz: 1
Submitted to: Dr Jaleel Subject: Financial analytics Date: 27 Mar, 2023

2-Effective and discount rate.


In R software, the effective and discount rates can be calculated using several functions and
packages.
The effective rate is the actual rate of interest earned or paid on an investment, taking into
account compounding over a given period of time. The discount rate, on the other hand, is the
rate used to determine the present value of future cash flows.
Here are some functions and packages that can be used to calculate effective and discount rates
in R:
Effective rate:
The effective rate can be calculated using the following formula:
effective_rate <- (1 + nominal_rate / n)^n - 1
where "nominal_rate" is the nominal rate of interest and "n" is the number of compounding
periods per year. For example, to calculate the effective rate for an annual interest rate of 6%
compounded monthly, you can use the following formula:
effective_rate <- (1 + 0.06 / 12)^12 - 1
This will give you an effective annual rate of 6.17%.
Discount rate:
The discount rate is used to determine the present value of future cash flows. In R, you can use
the PV() function from the financial package to calculate the present value of a series of future
cash flows. For example:
library(financial)
cash_flows <- c(1000, 2000, 3000, 4000, 5000)
discount_rate <- 0.1
present_value <- PV(cash_flows, discount_rate)
This will give you the present value of the cash flows using a discount rate of 10%.
Overall, R software provides several functions and packages that can be used to calculate
effective and discount rates. The choice of method will depend on the specific research question
and the availability of data.

You might also like