Pemodelan dan Teori Risiko
~ Financial Mathematics ~

| Kontak | : \(\downarrow\) |
| diyasaryanugroho@gmail.com | |
| https://www.instagram.com/diasary_nm/ | |
| RPubs | https://rpubs.com/diyasarya/ |
No 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.
Stock_price <- 100 # Price stock currently per share
Maturity <- 6 # Time period in Month
Interest_risk_free <- 0.05/12
sd_volatility <- 0.2/sqrt(252) # Assuming 252 days in one year, exclude weekend and holiday
Interest <- Interest_risk_free - sd_volatility # Interest affected by volatility
# Calculate future value risk-free and volatility
Future_value <- Stock_price * (1 + Interest)^Maturity
Future_value## [1] 95.04617
Price of European call option stock is $95.05, assumsing the interest used is risk-free interest affected by volatility. Because with the volatility, the risk-free interest will be eroded.
Stock_price <- 100
Maturity <- 6
Interest_risk_free <- 0.05/12
# Calculate future value only risk-free
Future_value <- Stock_price * (1 + Interest_risk_free)^Maturity
Future_value## [1] 102.5262
If the interest used only risk-free interest, the price of European call option stock is $102.53.
No 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.
# Scenario of Investment
money <- 12000 # Amount of money
return_stock <- 0.09 # Return stock 9% per annum
interest_saving <- 0.02 # Interest rate of saving 2% per annum
t <- 5 # Time period of simulation investment
# Build variables
Invest_now <- numeric(t)
Invest_next_year <- numeric(t)
# Calculate using future value
for (i in 1:t) {
Invest_now[i] <- money * (1 + return_stock)^i
saving <- money * (1 + interest_saving)
Invest_next_year[1] <- saving
Invest_next_year[i] <- saving * (1 + return_stock)^(i-1)
}
# Create data frame for cash flow
cash_flow <- data.frame(Year = 1:t,
Invest_now = Invest_now,
Invest_next_year = Invest_next_year)
cash_flowThere are two investment options, namely investing this year for
option A or waiting for next year for option B. The cashflow above shows
a scenario for the next five years with a return on investment of 9% per
annum. Over the next five years, money will grow by 54% from 12,000 to
18,463.49 if option A chooses. While if option B chooses, money will
grow by 44% from 12,000 to 17,277.76.
This is because option A earns 9% for the return annually while
option B in the first year only earn 2% and 9% in the next year and
on.
No 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%
# Assumptions
Initial_invest <- 10000
Monthly_contribution <- 500
time <- 7
periods <- time * 12
Interest_rate <- c(0.06, 0.07, 0.08, 0.09, 0.06, 0.06, 0.06) # 6% on sixth and seventh year
# Build variables
Future_value <- numeric(periods + 1)
Future_value[1] <- Initial_invest
# Calculate with future value
for (i in 1:periods) {
year <- ceiling(i/12)
monthly_rate <- Interest_rate[year]
monthly_rate <- monthly_rate/12
Future_value[i+1] <- Future_value[i] * (1 + monthly_rate) + Monthly_contribution
}
# Create investment flow
Investment_flow <- data.frame(Year = 1:(periods+1),
Future_value = Future_value)
Investment_flow## Value of Investment 7 Years is: $ 69597.12
The interest rate known assumption is only for the fifth year while
the investment period reaches seven years, so for the sixth and seventh
years using the first year’s interest.
Over the next seven years, the value of investment is $76,152.28
or can be seen from the investment flow above.