- Prepare for the evaluation of your final work.
- Draft a prompt that outlines the key points and questions you would like ChatGPT to evaluate in your final work. This will help in assessing the quality and depth of your analysis. ChatGPT should give your a grade for this assignment.
- Understand what time series data is and how it is relevant in the financial sector.
- Research and write Python comments in a VS Code file summarizing what time series data is and its applications in finance.
- Look into the definition of time series data and its importance in financial analysis.
- Learn how to collect and import financial time series data.
- Yahoo Finance
- Use Python libraries like
yfinance
to collect stock price data for a company of your choice from Yahoo Finance. Import the data into a Python file in VS Code.
- Use the
yfinance
library to fetch data. The functionyf.download('AAPL')
can be used to download Apple's stock data, for example.
- Visualize the collected time series data.
- Use Python libraries like
matplotlib
orseaborn
to create line plots, candlestick charts, and other visualizations for the collected data.
- Use
plt.plot()
for line plots andsns.candlestick_ohlc()
for candlestick charts.
- Learn how to manipulate time series data and generate returns and lagged returns.
- Perform tasks like resampling, calculating moving averages, and handling missing values. Generate returns and 5 lagged returns on the collected data.
- Use
df.pct_change()
to calculate returns. For lagged returns, you can usedf['Lagged_Return'] = df['Return'].shift()
.
- Understand the concept of seasonality in time series data.
- Use the Freddie Mac House Price Index data to analyze seasonality in housing prices.
- Use
seasonal_decompose
fromstatsmodels.tsa.seasonal
to decompose the time series into trend, seasonal, and residual components.
- Use a simple machine learning model to make projections using lagged returns and think about the implications.
- Implement a machine learning model like Linear Regression using libraries like
scikit-learn
to forecast future returns based on the 5 lagged returns you've generated. Reflect on the implications of your analysis and how it connects to any financial knowledge you may have.
- Use
LinearRegression()
fromsklearn.linear_model
and fit the model using.fit(X, y)
, whereX
is the matrix of lagged returns andy
is the return.