Pemodelan dan Teori Risiko

Task 1 - Financial Mathematics


Kontak : \(\downarrow\)
Email
Instagram https://www.instagram.com/saram.05/
RPubs https://rpubs.com/sausanramadhani/

After understanding the financial mathematics in the second meeting yesterday, here’s the work of 3 cases for practice:

1

Suppose you work for a financial institution, and your team is tasked with pricing European call options on a stock. The stock in question is currently trading at $100 per share, and the risk-free interest rate is 5% per annum. The volatility of the stock is estimated to be 20% per annum. The option has a maturity of 6 months.

Answer :

Assumptions:
- Current Stock Price: $100
- Strike Price: $100
- Risk-free Interest Rate: 5%
- Time to maturity in years: 50%
- Volatility: 20%

In this calculation, it should be possible to use the BlackScholes library in rstudio, but I used posit cloud which cannot be used in posit cloud. So the calculation becomes as follows:

bs_call <- function(S, K, r, T, sigma) {
  d1 <- (log(S / K) + (r + 0.5 * sigma^2) * T) / (sigma * sqrt(T))
  d2 <- (log(S / K) + (r - 0.5 * sigma^2) * T) / (sigma * sqrt(T))
  call_price <- S * pnorm(d1) - K * exp(-r * T) * pnorm(d2)
  return(call_price)
}

S <- 100 # current stock price
K <- 100 # strike price
r <- 0.05 # risk-free interest rate
T <- 0.5 # time to maturity in years
sigma <- 0.20 # volatility

call_price <- bs_call(S, K, r, T, sigma)
print(call_price)
## [1] 6.888729

The price of the European call option which is calculated using the Black-Scholes formula (manually) is about $6.888729.

2

Let’s consider a scenario where an investor is evaluating two investment opportunities: investing in a stock market index fund or depositing the same amount of money in a savings account. The investor has $12,000 to invest and has to decide whether to invest it now or wait for a year. Suppose the expected return from the stock market index fund is 9% per year, while the interest rate on the savings account is 2% per year.

Answer:

To consider which investor to choose to generate two investment opportunities, it is first necessary to investing in a stock market index fund and depositing the same amount of money in a savings account. The greater the future value, the more profits the investor will gain. So the largest value must be chosen by investors.

Here’s the calculation to find a large investment in a stock market index fund:

PV <- 12000
n <- 1
r <- 0.09

FV <- PV*(1+r)^n
FV
## [1] 13080

The future value obtained if the investor invests in a stock market index fund is $13080. After knowing the future value if an investor invests in a stock market index mutual fund, the future value must also be calculated if the investor keeps the same amount of money in a savings account. Here’s the calculation using r:

PV <- 12000
n <- 1
r <- 0.02

FV <- PV*(1+r)^n
FV
## [1] 12240

The future value is obtained if the investor keeps the same amount of money in the savings account, which is $12240.

As explained earlier, the greater the future value, the more investors gets. Based on the results above, the largest value is the future value of the stock market index, which is $13080. So, an investor would rather invest in a stock market index fund than keep the same amount of money in a savings account.

3

Calculate the future value of an investment with regular contributions. The investment is compounded monthly, and the interest rate varies over time. Assumptions:
- Initial investment (PV): $10,000
- Monthly contribution: $500
- Time horizon: # years (replace

with the last two digits of your student ID number)
- Annual interest rate:
- First year: 6%
- Second year: 7%
- Third year: 8%
- Fourth year: 9%
- Fifth year: 9.5%

Answer:

In case 3, the calculation is different from the simple future value calculation. Since the interest rate is different every year and with a fixed contribution of $500, Here’s the calculation in r:

PV <- 10000
monthly_contribution <- 500
years <- 5
months <- years*12
interest_rates <- c(0.06, 0.07, 0.08, 0.09, 0.095)

FV <- numeric(months+1)
FV[1] <- PV

# Calculate monthly future value
for (i in 1:months) {
  year <- ceiling(i/12)
  monthly_rate <- interest_rates[year]
  FV[i+1] <- FV[i]*(1+monthly_rate/12)+monthly_contribution
}

FV
##  [1] 10000.00 10550.00 11102.75 11658.26 12216.56 12777.64 13341.53 13908.23
##  [9] 14477.77 15050.16 15625.41 16203.54 16784.56 17382.47 17983.87 18588.77
## [17] 19197.21 19809.19 20424.74 21043.89 21666.65 22293.03 22923.08 23556.79
## [25] 24194.21 24855.50 25521.21 26191.35 26865.96 27545.06 28228.70 28916.89
## [33] 29609.67 30307.07 31009.11 31715.84 32427.28 33170.48 33919.26 34673.66
## [41] 35433.71 36199.46 36970.96 37748.24 38531.35 39320.34 40115.24 40916.10
## [49] 41722.98 42553.28 43390.16 44233.67 45083.85 45940.76 46804.46 47675.00
## [57] 48552.42 49436.80 50328.17 51226.60 52132.15

Based on the above results, the future value of investment with regular contributions is $52132.15.