Analysis of Apple Inc. (AAPL) Stock Prices Using a VAR Model

Verified

Added on  2022/12/05

|7
|1676
|284
Report
AI Summary
This report presents a Vector Autoregressive (VAR) model for analyzing Apple Inc. (AAPL) stock prices. The study utilizes daily stock price data from Yahoo Finance, spanning from May 1, 2018, to May 1, 2019, focusing on the adjusted closing prices of Apple and the NASDAQ market. The analysis includes descriptive statistics, correlation matrix, and the development of a VAR(1) model to predict Apple stock prices based on lagged Apple stock prices and NASDAQ market data. The report details the model's implementation in STATA, forecasting using Microsoft Excel, and a comparison of forecasted and actual stock prices for April 2019. The findings validate a relationship between a stock's current and previous prices, as well as a correlation between individual stock prices and market trends, demonstrating the VAR model's effectiveness in stock price prediction.
Document Page
Running head: VECTOR AUTOREGRESSIVE MODEL FOR APPLE INC (AAPL) STOCK PRICES 1
Vector Autoregressive Model for Apple Inc (AAPL) Stock Prices
Student’s Name
Professor’s Name
Affiliation
Date
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
VECTOR AUTOREGRESSIVE MODEL FOR APPLE INC (AAPL) STOCK PRICES 2
Vector Autoregressive Model for Apple Inc (AAPL) Stock Prices
The daily stock prices for apple and the NASDAQ market were collected from yahoo finance for the
time interval 1st of May 2018 to 1st of May 2019. The adjusted closing stock prices were used in the assessment
and all other variables were dropped from the assessment (with the exception of the data). The NASDAQ
market was used because Apple Inc is registered under this market. The time series data collected for both
Apple Inc and NASDAQ stock prices will be used to develop one period lag variables. The one period lag is
represented by “t-1” while the original data is showcased by “t”. Therefore, we want to predict the Apple stock
price a time t using three variables: the apple stock price at time t-1, the NASDAQ stock price at time t, and the
NASDAQ stock price at time t-1. There hypothesis here is that there is a relationship between the price of
Apple stock price at time t with the lagged Apple Stock price, the NASDAQ stock price at time t, and the
NASDAQ stock price at time t-1. We expect that the stock price of Apple at time t can be predicted using the
VAR (1) model. The assumption here is that there is an association between the market stock price and the
individual stock price; moreover, we hypothesize the existence of some correlation between the stock price f
Apple at time t and its price at time t-1 (Gaston, 2014).
Descriptive Statistics
Apple (t) Apple (t-1) NASDAQ (t) NASDAQ (t-1)
Mean 189.7837399 Mean 189.6328 Mean 87.73416508 Mean 87.71185145
Standard Error1.325247413 Standard Error 1.328879 Standard Error 0.253917463 Standard Error 0.253327426
Median 188.217972 Median 188.16 Median 88.481857 Median 88.470001
Mode 186.042618 Mode 186.0426 Mode 92.487724 Mode 92.487724
Standard Deviation20.99586761 Standard Deviation 21.05341 Standard Deviation 4.022809159 Standard Deviation 4.013461216
Sample Variance440.8264568 Sample Variance 443.2461 Sample Variance 16.18299353 Sample Variance 16.10787093
Kurtosis -0.757706116 Kurtosis -0.77336 Kurtosis -0.362105924 Kurtosis -0.355948982
Skewness -0.058496356 Skewness -0.0454 Skewness -0.556023079 Skewness -0.548750244
Range 88.692703 Range 88.6927 Range 18.942222 Range 18.942222
Minimum 141.582779 Minimum 141.5828 Minimum 76.352936 Minimum 76.352936
Maximum 230.275482 Maximum 230.2755 Maximum 95.295158 Maximum 95.295158
Sum 47635.71871 Sum 47597.83 Sum 22021.27544 Sum 22015.67471
Count 251 Count 251 Count 251 Count 251
Document Page
VECTOR AUTOREGRESSIVE MODEL FOR APPLE INC (AAPL) STOCK PRICES 3
There is considerable difference between the measures of location and dispersion for Apple and
NASDAQ stock prices. However, there is very little difference with regard to the same measures when it comes
to comparing the Apple and NASDAQ to their respective lag variables. For example, the mean price for
NASDAQ stock prices is $87.73 while that of Apple is $189.78 (a difference in pricing of $102.05). However,
the average stock price for NASDAQ at time t is greater than that of NASDAQ at time t-1 by roughly $0.02. A
similar situation can be reported for Apple Inc stock prices at time t ($189.78) and at time t-1 ($189.63). All
variables are normally distributed based on the kurtosis and skewness values. Looking at the standard deviations
for all four variables, we can see that the data points are clustered close to the mean this examples the relatively
small range value observed for each of them. The mean and median are not equivalent for any of the variables
this means that none of them are symmetrical under the normal distribution curve.
Correlation Matrix
From the correlation Matrix below, we can see that the variable Apple (t) has a strong positive
correlation with Apple (t-1). In addition, Apple (t) has a weak positive correlation with NASDAQ (t) and
NASDAQ (t-1). Therefore, when one variable increases the other variables will also follow an incremental
trend. Since, there is correlation between the four variables it would be appropriate to develop a vector
autoregressive VAR (1) model for the data excluding the last month of the data. This last month will be later
used as the forecasting period over which the actual values of Apple (t) will be compared with the estimated
values of Apple (t).
Apple (t) Apple (t-1) NASDAQ (t) NASDAQ (t-1)
Apple (t) 1
Apple (t-1) 0.9866771 1
NASDAQ (t) 0.3304052 0.315878829 1
NASDAQ (t-1) 0.32596526 0.329378846 0.968090127 1
Vector Autoregressive VAR(1) Model
Document Page
VECTOR AUTOREGRESSIVE MODEL FOR APPLE INC (AAPL) STOCK PRICES 4
The data less the month of April 2019 was loaded into STATA for VAR assessment. The dependent
variable in the model is Apple (t) that is the Apple stock price at time t; and the independent variables are Apple
(t-1), NASDAQ (t), and NASDAQ (t-1). The model can be represented as showcased below; however, we will
run another VAR assessment because the constant term is not significant in the current model (Golberg & Cho,
2010).
_cons -2.360877 5.184881 -0.46 0.649 -12.52306 7.801303
NASDAQt1 -1.593726 .2381905 -6.69 0.000 -2.060571 -1.126881
NASDAQt 1.6297 .2358557 6.91 0.000 1.167431 2.091969
L1. .9970409 .0115983 85.96 0.000 .9743085 1.019773
Applet
Applet
Applet Coef. Std. Err. z P>|z| [95% Conf. Interval]
Applet 4 3.18743 0.9785 8065.275 0.0000
Equation Parms RMSE R-sq chi2 P>chi2
Det(Sigma_ml) = 9.930142 SBIC = 5.250427
FPE = 10.38934 HQIC = 5.20776
Log likelihood = -454.3105 AIC = 5.17865
Sample: 5/2/2018 - 3/29/2019, but with gaps Number of obs = 177
Vector autoregression
In the new VAR model we will suppress the constant term to see whether all the coefficients will be significant.
Hence, the new model appears as:
Apple ( t )= 1 Apple (t1)+ 2 NASDAQ (t )+ 3 NASDAQ (t1)
The results of the second VAR assessment are presented below we can see that both the model and the
independent variables are significant. We can rewrite the equation above as follows:
Apple ( t )=0.9963 Apple ( t1 ) +1.6163 NASDAQ ( t ) 1.6057 NASDAQ (t1)
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
VECTOR AUTOREGRESSIVE MODEL FOR APPLE INC (AAPL) STOCK PRICES 5
NASDAQt1 -1.605662 .2368823 -6.78 0.000 -2.069943 -1.141381
NASDAQt 1.616286 .2341456 6.90 0.000 1.157369 2.075203
L1. .9963381 .0115019 86.62 0.000 .9737947 1.018881
Applet
Applet
Applet Coef. Std. Err. z P>|z| [95% Conf. Interval]
Applet 3 3.18012 0.9997 648946.2 0.0000
Equation Parms RMSE R-sq chi2 P>chi2
Det(Sigma_ml) = 9.941774 SBIC = 5.222354
FPE = 10.28459 HQIC = 5.190353
Log likelihood = -454.4141 AIC = 5.168521
Sample: 5/2/2018 - 3/29/2019, but with gaps Number of obs = 177
Vector autoregression
Forecasting
We can use the model developed in the prior segment to forecast stock prices for Apple Inc for the
month of April 2019. The forecasts will be compared to the actual values for assessment of errors in prediction.
The assessment will be conducted in Microsoft Excel. The table of results below compared the values of
forecasted Apple (t) and the actual values of Apple (t). The mean square error is considerable low
demonstrating that the VAR model is appropriate to employ in the prediction of stock prices for Apple Inc at
time t.
Conclusion
The results met my expectation by validating that a relationship exists between the price of a stock at
time t and its price at time t-1. Also the results proved my hypothesis that the stock price of company listed
under a given stock exchange market has a positive correlation with a market’s stock price at time t and t-1. A
Document Page
VECTOR AUTOREGRESSIVE MODEL FOR APPLE INC (AAPL) STOCK PRICES 6
VAR model can be used to predict a company’s stock price at t based on past and/or present company and
market prices
Date Apple (t) Forecast for Apple (t) Error Squared Error
4/1/2019 191.240005 191.6547396 -0.41473457 0.172004763
4/2/2019 194.020004 192.4647993 1.555204693 2.418661637
4/3/2019 195.350006 194.723889 0.626117035 0.392022542
4/4/2019 195.690002 195.3894179 0.300584124 0.090350816
4/5/2019 197 194.9672379 2.032762103 4.132121769
4/8/2019 200.100006 197.4945641 2.605441865 6.788327311
4/9/2019 199.5 198.5969748 0.903025192 0.815454498
4/10/2019 200.619995 199.3779234 1.242071633 1.542741942
4/11/2019 198.949997 200.0552886 -1.105291604 1.22166953
4/12/2019 198.869995 200.3906154 -1.520620401 2.312286402
4/15/2019 199.229996 200.1574486 -0.927452585 0.860168297
4/16/2019 199.25 201.5091854 -2.259185432 5.103918816
4/17/2019 203.130005 200.2011943 2.928810724 8.577932256
4/18/2019 203.860001 203.0050296 0.854971441 0.730976165
4/22/2019 204.529999 203.6493135 0.880685477 0.77560691
4/23/2019 207.479996 204.6050177 2.874978348 8.2655005
4/24/2019 207.160004 206.913009 0.246995029 0.061006544
4/25/2019 205.279999 207.7690907 -2.489091694 6.195577461
4/26/2019 204.300003 206.1573333 -1.857330257 3.449675682
4/29/2019 204.610001 207.0764377 -2.466436744 6.083310215
4/30/2019 200.669998 206.0445189 -5.374520905 28.88547496
Mean Squared Error 4.23213281
Document Page
VECTOR AUTOREGRESSIVE MODEL FOR APPLE INC (AAPL) STOCK PRICES 7
References
Gaston, L. (2014). Hypothesis Testing Made Simple (1st Edition ed.). Leonard Gaston .
Golberg, M., & Cho, H. A. (2010). Introduction to Regression Analysis (2nd Edition ed.). Ashurst, United
Kingdom: Wessex Institute of Technology, WIT press.
chevron_up_icon
1 out of 7
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]