Stock Analysis Report
Stock Analysis Report
Stock Analysis Report
(AAPL)
Introduction:
This report presents an analysis of historical stock data for Apple Inc. (AAPL). The goal is to
gain insights into the daily, weekly, monthly and quarterly trends, identify potential patterns and
utilize visualization techniques to perform decision-making.
Data Overview:
The historical stock data is provided via yfinance library in python environment. The data is
already in time series data frame structure, which makes it easier to analyze it according to
1. Data Preparation:
1.1 Data Download:
Historical stock data throughout the year of 2022 for AAPL was downloaded from Yahoo
1.2 Analyzes:
1 Analyzes the data on daily, weekly, monthly, and quarterly intervals using resample and agg.
2 Plots the stock prices over time.
3.Prints the descriptive statistics for each interval.
2. Descriptive Statistics:
Descriptive statistics are performed to summarize the central tendency, dispersion and shape of a
dataset’s distribution. During this process NaN values are excluded not to cause any confusion.
2.1 Daily Statistics:
The following code is utilized to analyze the data on daily base;
daily_stats = stock_data['Close'].describe()
The daily statistics results for Apple stock prices are shown below;
Mean: $154.84
Standard Deviation: $13.06
Min: $126.04
25th Percentile: $144.65
Median: $154.09
75th Percentile: $165.92
Max: $182.01
# Monthly analysis
monthly_stats = stock_data['Close'].resample('M').agg(['mean', 'std', 'min', 'max'])
# Quarterly analysis
quarterly_stats = stock_data['Close'].resample('Q').agg(['mean', 'std', 'min', 'max'])
The result of weekly, monthly and quarterly statistics are shown below;
Weekly Statistics:
mean std min max
Date
2022-01-07 176.159998 4.514347 172.000000 182.009995
2022-01-14 173.612003 1.594652 172.190002 175.529999
2022-01-21 165.737499 3.126525 162.410004 169.800003
2022-01-28 162.128000 4.675583 159.220001 170.330002
2022-02-04 174.103998 1.424265 172.389999 175.839996
2022-02-11 172.706000 2.968784 168.639999 176.279999
2022-02-18 170.080002 2.452210 167.300003 172.789993
2022-02-25 162.995007 2.146105 160.070007 164.850006
2022-03-04 164.855997 1.616022 163.169998 166.559998
2022-03-11 158.588000 2.989176 154.729996 162.949997
2022-03-18 157.979996 5.198158 150.619995 163.979996
2022-03-25 170.640005 3.859280 165.380005 174.720001
2022-04-01 176.250003 2.032870 174.309998 178.960007
2022-04-08 173.512000 3.282648 170.089996 178.440002
2022-04-15 167.274998 2.322333 165.289993 170.399994
2022-04-22 165.581998 2.311097 161.789993 167.399994
2022-04-29 159.508002 3.459085 156.570007 163.639999
2022-05-06 159.502002 3.783639 156.770004 166.020004
2022-05-13 148.547998 4.743359 142.559998 154.509995
2022-05-20 142.108002 5.180586 137.350006 149.240005
2022-05-27 143.482001 3.763922 140.360001 149.639999
2022-06-03 148.535004 2.396755 145.380005 151.210007
2022-06-10 144.516003 4.747645 137.130005 148.710007
2022-06-17 132.337997 1.983862 130.059998 135.429993
2022-06-24 137.787502 2.877921 135.350006 141.660004
2022-07-01 138.795999 1.907703 136.720001 141.660004
2022-07-08 144.467499 2.646374 141.559998 147.039993
2022-07-15 146.972000 2.254023 144.869995 150.169998
2022-07-22 152.110001 3.237149 147.070007 155.350006
2022-07-29 156.239999 4.277882 151.600006 162.509995
2022-08-05 163.762000 2.805021 160.009995 166.130005
2022-08-12 167.924002 3.075802 164.869995 172.100006
2022-08-19 173.288000 1.176612 171.520004 174.550003
2022-08-26 167.195999 2.295210 163.619995 170.029999
2022-09-02 158.256003 2.081524 155.809998 161.380005
2022-09-09 155.580002 1.379055 154.460007 157.369995
2022-09-16 155.129996 4.945426 150.699997 163.429993
2022-09-23 153.653998 2.369215 150.429993 156.899994
2022-09-30 146.609998 5.959154 138.199997 151.759995
2022-10-07 144.093997 2.732276 140.089996 146.399994
2022-10-14 139.822000 1.960773 138.339996 142.990005
2022-10-21 144.136002 1.842738 142.410004 147.270004
2022-10-28 150.336002 4.050424 144.800003 155.740005
2022-11-04 145.256000 6.753330 138.380005 153.339996
2022-11-11 141.971997 6.115069 134.869995 149.699997
2022-11-18 149.823996 1.270012 148.279999 151.289993
2022-11-25 149.342499 1.525374 148.009995 151.070007
2022-12-02 145.907999 3.130019 141.169998 148.309998
2022-12-09 143.058002 2.135410 140.940002 146.630005
2022-12-16 140.836002 4.981989 134.509995 145.470001
2022-12-23 132.841998 1.471145 131.860001 135.449997
2022-12-30 128.902498 1.916721 126.040001 130.029999
Monthly Statistics:
mean std min max
Date
2022-01-31 169.861500 6.760574 159.220001 182.009995
2022-02-28 169.830001 4.706935 160.070007 176.279999
2022-03-31 165.310435 7.935551 150.619995 178.960007
2022-04-30 166.820999 6.001495 156.570007 178.440002
2022-05-31 148.430477 7.895313 137.350006 166.020004
2022-06-30 139.798573 6.309182 130.059998 151.210007
2022-07-31 149.670499 5.902944 138.929993 162.509995
2022-08-31 166.885218 4.967536 157.220001 174.550003
2022-09-30 153.002856 5.273234 138.199997 163.429993
2022-10-31 145.013333 4.890081 138.339996 155.740005
2022-11-30 145.843331 5.115472 134.869995 151.289993
2022-12-31 137.876666 6.970030 126.040001 148.309998
Quarterly Statistics:
mean std min max
Date
2022-03-31 168.163549 6.954480 150.619995 182.009995
2022-06-30 151.439194 13.116664 130.059998 178.440002
2022-09-30 156.950468 9.273935 138.199997 174.550003
2022-12-31 142.911110 6.694805 126.040001 155.740005
Trend Analysis:
In this project, to be able to interpret the dataset and make prediction, the mean values and
standard deviation information is utilized.
The mean values of closing prices for Apple stock given in the analyzes indicate the average
daily value of the stock.
The standard deviation is used to provide insights into the variability of the data. Standard
deviation is also known as historical volatility and is used by investors as a gauge for the amount
of expected market volatility. A large standard deviation usually indicates that the data points are
far from the mean and a small standard deviation indicates that they are clustered closely around
the mean.
1- Daily Statistics:
The mean daily closing price for Apple stock over the analyzed period is approximately $154.84.
2- Weekly Statistics:
Weekly average values fluctuate, showing a slight volatility between each following week. For
instance, the week ending on 2022-01-07 had a mean closing price of $176.16, while the week
ending on 2022-01-14 had a similar but slightly lower mean of $173.61. But overall stock price
follows a decreasing trend as the weeks go through.
3- Monthly Statistics:
Monthly mean closing prices range from $137.88 (December 2022) to $169.86 (January 2022),
reflecting variations in average stock prices throughout the year. It can be seen that there is more
fluctuation in average values at monthly statistics when compared to weekly statistics. For
instance, the month ending on 2022-04-30 had a mean closing price of $166.82, while the
following month had very lower mean of 148.43.
4- Quarterly Statistics:
Quarterly means show a similar pattern, ranging from a high of $168.16 (Q1 2022) to a low of
$142.91 (Q4 2022). The fluctuation can be seen more easily on quarterly statistics.
Volatility Analysis:
Standard Deviation:
The standard deviation values indicate volatility. For instance, The daily standard deviation is
approximately $13.06. This number is approximately %10 of the mean value, which is quite high
and giving rise to day to day price fluctuations. But when we check the standard deviation on
weekly statistics, the values range from $1 to $7. This means that stock prices don’t show big
variation around average on weekly base and they are close to related mean values.
Extreme Values:
Minimum and Maximum:
The minimum closing price is $126.04, and the maximum is $182.01. Investigating these
extreme values may reveal events or news that influenced these significant price movements.
Seasonality:
Monthly and Quarterly Trends:
There seems to be a pattern of higher mean prices in the earlier months, potentially indicating a
seasonal effect.
Comparative Analysis:
Benchmarking:
Compare Apple's stock performance with a market index or other relevant stocks to understand
how it fared relative to broader market trends.
3. Visualizations:
3.1 Line Chart for Daily Closing Prices:
The line chart illustrates the daily closing prices of AAPL over the analysis period.
3.2 Candlestick Chart for Weekly Closing Prices:
The candlestick chart provides a visual representation of weekly closing prices, including open,
high, low, and close values.
4. Trend Analysis:
The mean daily closing price indicates an overall negative trend.
Volatility, as measured by the standard deviation, fluctuates but remains within
reasonable bounds.
Potential seasonality is observed in monthly and quarterly trends.
The red points in the following graph give idea about when to buy apple stock.
The green points in the following graph give idea about when to sell apple stock .
Conclusion:
The analysis provides valuable insights into AAPL's historical performance. However, investing
decisions should consider various factors, including fundamental analysis, external news, and
individual risk tolerance.
In this project, Apple stock prices are analyzed and interpreted on daily, weekly, monthly and
quarterly basis.
The most beneficial dates to sell or buy regarding Apple stock is also given to be utilized by
people who are interested.
The visualizations and statistical summaries in this report serve as a foundation for further
research and decision-making.