2026-04-12

Introduction

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

Stock Prices Over Time

This line plot shows how stock prices changed over the year.

Daily Return Distribution

Here is how we are calculating daily returns:

\[ R_t = \frac{P_t - P_{t-1}}{P_{t-1}} \]

Daily Returns Distribution, visualized

  • TSLA daily returns vary dramatically, indicating much more volatility than MSFT and AAPL

Interactive Stock Price Chart

Risk vs Return Scatterplot

  • farther right = more volatile

  • higher up = better average return

Linear Regression Model

We model Apple returns using Microsoft returns:

\[ R_{AAPL} = \beta_0 + \beta_1 R_{MSFT} + \epsilon \]

Linear Regression Model, visualized

This shows how well the two stocks move together.Up and to the right appears to be a positive relationship.

R Code Example

Here is the R code used to calculate daily returns:

returns = stocks %>%
  group_by(symbol) %>%
  arrange(date) %>%
  mutate(return = (adjusted - lag(adjusted)) / lag(adjusted))
  • We start by gathering the stocks and grouping by symbol, then mutating to create a new column that calculates lag adjusted return.

Conclusion

Key Findings

  • 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