Week 7 Team 2
Collecting yfinance
Downloading yfinance-0.1.63.tar.gz (26 kB)
Requirement already satisfied: pandas>=0.24 in /shared-libs/python3.7/py/lib/python3.7/site-packages (from yfinance) (1.2.5)
Requirement already satisfied: numpy>=1.15 in /shared-libs/python3.7/py/lib/python3.7/site-packages (from yfinance) (1.19.5)
Requirement already satisfied: requests>=2.20 in /shared-libs/python3.7/py/lib/python3.7/site-packages (from yfinance) (2.26.0)
Collecting multitasking>=0.0.7
Downloading multitasking-0.0.9.tar.gz (8.1 kB)
Requirement already satisfied: lxml>=4.5.1 in /shared-libs/python3.7/py/lib/python3.7/site-packages (from yfinance) (4.6.3)
Requirement already satisfied: python-dateutil>=2.7.3 in /shared-libs/python3.7/py-core/lib/python3.7/site-packages (from pandas>=0.24->yfinance) (2.8.2)
Requirement already satisfied: pytz>=2017.3 in /shared-libs/python3.7/py/lib/python3.7/site-packages (from pandas>=0.24->yfinance) (2021.1)
Requirement already satisfied: six>=1.5 in /shared-libs/python3.7/py-core/lib/python3.7/site-packages (from python-dateutil>=2.7.3->pandas>=0.24->yfinance) (1.16.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /shared-libs/python3.7/py/lib/python3.7/site-packages (from requests>=2.20->yfinance) (1.26.7)
Requirement already satisfied: charset-normalizer~=2.0.0 in /shared-libs/python3.7/py/lib/python3.7/site-packages (from requests>=2.20->yfinance) (2.0.6)
Requirement already satisfied: certifi>=2017.4.17 in /shared-libs/python3.7/py/lib/python3.7/site-packages (from requests>=2.20->yfinance) (2021.5.30)
Requirement already satisfied: idna<4,>=2.5 in /shared-libs/python3.7/py-core/lib/python3.7/site-packages (from requests>=2.20->yfinance) (3.2)
Building wheels for collected packages: yfinance, multitasking
Building wheel for yfinance (setup.py) ... done
Created wheel for yfinance: filename=yfinance-0.1.63-py2.py3-none-any.whl size=23918 sha256=0494d0d1d11634ead8657661bbbc21396a783eab90e4ea0ab300ffd4ef40d8e0
Stored in directory: /tmp/pip-ephem-wheel-cache-_bxzwzie/wheels/fe/87/8b/7ec24486e001d3926537f5f7801f57a74d181be25b11157983
Building wheel for multitasking (setup.py) ... done
Created wheel for multitasking: filename=multitasking-0.0.9-py3-none-any.whl size=8375 sha256=86e7b275954154124ae52520d58a36c0f49b6908b723d5479bccf775f5bc3067
Stored in directory: /tmp/pip-ephem-wheel-cache-_bxzwzie/wheels/ae/25/47/4d68431a7ec1b6c4b5233365934b74c1d4e665bf5f968d363a
Successfully built yfinance multitasking
Installing collected packages: multitasking, yfinance
Successfully installed multitasking-0.0.9 yfinance-0.1.63
[*********************100%***********************] 1 of 1 completed
Lab 6 Introduction
The purpose of lab 7 was to see whether there were significant differences in mean returns, volatility and trade volume for the US equity market during summer and winter. Hence, the S&P 500 index was chosen to represent the US equity market, and the months of June and December were chosen to represent summer and winter respectively. Additionally, in order to verify whether such effects are only apparent in the US, or in other global markets as well, a set of indexes (STI-Singapore and FTSE-Japan) were chosen. Finally, sets of "If" analysis codes were used to verify the H0 of each part, and to see whether the set of data shows significant differences by season and between markets.
Part 1 : Daily Volatility
H0 : There is no difference between the daily volatility of the SP500 in June and December
Difference in mean change:
104.87009214659217
p value is 0.5766377275976307
The volatility is not significantly different (fail to reject H0)
Part 2 : Trading Volume
Difference in mean trading volume:
228927097.28867626
p value is 0.026595953830519534
The difference in mean trading volume is significantly different (reject H0)
Part 3: Mean Return
H0: The is not much difference in mean returns of Jun vs Dec (2011 to 2021)
Difference in mean return:
0.048062876002546565
Difference in mean return:
0.048062876002546565
p value is nan
The difference in mean return is not significantly different (fail to reject H0)
/shared-libs/python3.7/py/lib/python3.7/site-packages/numpy/core/fromnumeric.py:3622: RuntimeWarning: Degrees of freedom <= 0 for slice
**kwargs)
/shared-libs/python3.7/py/lib/python3.7/site-packages/numpy/core/_methods.py:226: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
Part 4: SP500 vs STI Index vs FTSE Japan Index
[*********************100%***********************] 1 of 1 completed
Difference in mean return:
0.013033034384900131
p value is 0.8629443027686803
The difference in mean return is not significantly different (fail to reject H0)
[*********************100%***********************] 1 of 1 completed
Difference in mean return:
0.08518987242704516
p value is 0.4158831346551267
The difference in mean return is not significantly different (fail to reject H0)
Conclusion
#1 Volatility: The data shows that there is not a significant difference in level of volatility between data from June vs December.
#2 Trading Volume: As the p-value is only 0.027, we can reject the Ho and thus conclude that the trading volume of S&P 500 in June and December from 2011 to 2021 is significantly different.
#3 Mean Return: The data shows that there is no significant difference between the average monthly returns in June and Decemeber over the past 10 years (2011-2021).
#4 SP500 vs STI Index vs FTSE Japan Index: When looking at other index funds of other countries (Singapore and Japan), data suggests that there is not really any difference between returns on June and December. However, it is important to note that SP500 almost always have positive return (distribution is positively skewed). This suggest that the SP500 is a better performing index.