You are on page 1of 2

ANUJ KESWANI

1236

EXPERIMENT 4

AIM:
Obtain the results of the following problems using R.

EXPERIMENT:
1) Calculate the monthly payment required for a loan of Rs. 200000 at a monthly interest rate of 0.005
based on 300 monthly installments in 1 months time.
2) Calculate the monthly payment for the above setup if the monthly rates are 0.002, 0.03, 0.0035,
0.0042 and 0.0048.

THEORY:

 The monthly payment R is calculated by:

R = p*{i/[1-(1+i)^(-N)]}

Where,

P is the loan amount


i is the monthly interest rate
N is the no. of installments

SCRIPT:
P<-200000
P
I<-c(0.003,0.002,0.0035,0.0042,0.0048)
I
N<-300
N
R<-P*(I/(1-((1+I)*(-N))))
R
i<-1
for(val in I)
{
cat("The monthly payment for",I[i]*100,"% rate of interest is",R[i],"\n")
i<-i+1
}

RESULT:
> P<-200000
> P
[1] 2e+05
> I<-c(0.003,0.002,0.0035,0.0042,0.0048)
> I
[1] 0.0030 0.0020 0.0035 0.0042 0.0048
> N<-300
ANUJ KESWANI
1236

> N
[1] 300
> R<-P*(I/(1-((1+I)*(-N))))
> R
[1] 1.987413 1.326260 2.317497 2.779064
[5] 3.174183
> i<-1
> for(val in I)
+ {
+ cat("The monthly payment for",I[i]*100,"% rate of interest is",R[i],"\n")
+ i<-i+1
+ }
The monthly payment for 0.3 % rate of interest is 1.987413
The monthly payment for 0.2 % rate of interest is 1.32626
The monthly payment for 0.35 % rate of interest is 2.317497
The monthly payment for 0.42 % rate of interest is 2.779064
The monthly payment for 0.48 % rate of interest is 3.174183

You might also like