Financial options have an intrinsic and a time value. The intrinsic value for a call option is simply the spot (S) minus the strike price (X). The time value of the call option can be derived using the Black-Scholes formula. The resulting price of the option minus the intrinsic value of the option results in the time value of the option.
The following graph illustrates the intrinsic value (red line), the price of the option (grey line) and the time value of the option (dark grey area).
Using the following code you can replicate the figure:
In every finance class, one of the first topics students are confronted with is the efficient frontier. Even though the intuition behind the efficient frontier might be easy to grasp, I show you that it can also be very easy to derive the efficient frontier – even using multiple assets.
Using the following code you can replicate the image:
stocks <- c("TSLA","AAPL", "FB")
x<- dailyReturn(TSLA) y <- dailyReturn(AAPL) z <- dailyReturn(FB)
g <- as.data.frame(cbind(x,y,z)) a <-as.data.frame(cov(g[2000:2620,]))
Writing a financial paper is often associated with an OLS regression model. One major issue can be heteroskedasticity: the variance of the error terms vary. I show you how you can detect heteroskedasticity and how to implement robust standard errors in R.
Step 1: Implement a regression model in R
model1 <- lm(dist ~ speed, data=cars) # initial model using car data
Step 2: Detect heteroskedasticity using the Breush Pagan Test. When the p-value is below the 10% we can reject the null hypothesis that the variance of the residuals is constant.