An Analysis of Apple, Microsoft, and Tesla Stock of the year spanning from 4/12/2025 thru 4/12/2026
We Will:
Compare stock price behavior
Measure daily return distributions
Visualize volatility
Explore regression relationships
2026-04-12
An Analysis of Apple, Microsoft, and Tesla Stock of the year spanning from 4/12/2025 thru 4/12/2026
Compare stock price behavior
Measure daily return distributions
Visualize volatility
Explore regression relationships
This line plot shows how stock prices changed over the year.
Here is how we are calculating daily returns:
\[ R_t = \frac{P_t - P_{t-1}}{P_{t-1}} \]
farther right = more volatile
higher up = better average return
We model Apple returns using Microsoft returns:
\[ R_{AAPL} = \beta_0 + \beta_1 R_{MSFT} + \epsilon \]
This shows how well the two stocks move together.Up and to the right appears to be a positive relationship.
Here is the R code used to calculate daily returns:
returns = stocks %>% group_by(symbol) %>% arrange(date) %>% mutate(return = (adjusted - lag(adjusted)) / lag(adjusted))
Tesla tends to show the greatest volatility
Apple and Microsoft often move together, showing a positive return relationship
Looking at average return alone is not enough, as it tends to hides risk