1. Trang chủ
  2. » Luận Văn - Báo Cáo

Final assignment course ai in the era of digital transformation

38 0 0
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Final Assignment Course: AI in the Era of Digital Transformation
Tác giả Phạm Vũ Minh, Tran Minh Thiờn
Người hướng dẫn Dr. Lộ Trung Thanh, Dr. Nguyễn Thị Hoàng Anh
Trường học Foreign Trade University — HCM Campus
Chuyên ngành AI in the Era of Digital Transformation
Thể loại Final Assignment
Năm xuất bản 2024
Thành phố Ho Chi Minh City
Định dạng
Số trang 38
Dung lượng 2,66 MB

Cấu trúc

  • 1. Libraries needed (5)
  • 3. DATA VISUALIZATION AND ANALYSIS................. .LL 1n 1011111111121 ye 5 (6)
    • 3.1 Close Price of Hoang Anh Gia Lai JSC....................... L1. SH SH H011 1H re, 5 3,2 Close Price of Hoang Anh Gia Lai JSC with Bollinger Bands.......................... cà co 6 1. Close Price (Blue LIn€):...................... ác n1 1 1111111111111 11111111 11H HH HH Hà HH0 7 2. Simple Moving Average (Red Li€):.................. L1. 11 1H HH 0110111101101 11 01111111, 7 EREL0)006::< 457. -5(6)c--)i 815i) -)iaiaadđaiaiaẳíiÝ (6)
    • 3.3 Trading Volume of Hoang Anh Gia Lai JS.,..................... cà 1. 1S 1 1010110118118 re 8 (9)
  • 6. Evaluate using pẽOfSĐ............... ỏc c1 19 101111211111111 1111111111 1111k HH HH HH HH 1111011160 15 VH®9))1HiiiiiaiaiiidảdaảỶŸ4ÝỶỶÝ (16)
  • 3. How does 0.4000 2A. vn ồn (0)

Nội dung

By leveraging time series forecasting techniques, we aim to demonstrate how AI can be utilized to predict stock price movements, trading volume, and returns with higher accuracy and reli

Libraries needed

# Import necessary packages from vnstock3 import Vnstock import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns

To enhance data visualization and analysis, we configure display options in pandas by setting the maximum number of columns to 50 and rows to 100 Additionally, we apply the 'ggplot' style for improved aesthetics in plots To ensure a smooth execution without unnecessary warnings, we suppress warnings using the warnings module Lastly, we import TensorFlow for advanced machine learning capabilities.

The code imports essential libraries to establish the environment for stock market data analysis, data visualization, and machine learning Key libraries include pandas for data structures, numpy for numerical computing, and seaborn and matplotlib.pyplot for visualizing data Additionally, to facilitate time series prediction using ARIMA, the time libraries are imported Finally, TensorFlow is included as the foundation for our machine learning model.

For our assignment, the key library we utilize is VNSTOCK3, which allows us to access stock data from the Vietnamese stock market This library serves as the primary source of the data we have collected.

Our dataset comprises 1,598 rows of information about various companies and industries, with a focus on the Farming and Fishing sectors We specifically selected Hoang Anh Gia Lai, a long-listed company on the stock exchange, due to its extensive availability of stock data, which facilitates our analysis.

DATA VISUALIZATION AND ANALYSIS .LL 1n 1011111111121 ye 5

Close Price of Hoang Anh Gia Lai JSC L1 SH SH H011 1H re, 5 3,2 Close Price of Hoang Anh Gia Lai JSC with Bollinger Bands cà co 6 1 Close Price (Blue LIn€): ác n1 1 1111111111111 11111111 11H HH HH Hà HH0 7 2 Simple Moving Average (Red Li€): L1 11 1H HH 0110111101101 11 01111111, 7 EREL0)006::< 457 -5(6)c )i 815i) -)iaiaadđaiaiaẳíiÝ

Close Price of Hoang Anh Gia Lai JSé¢ rm, ự NHA

Figure 1.1: An image shows a time series of Hoang Anh Gia Lai JSC

M\„ V frm pn ơ JS stock over a period of time

Here are the key features of the plot:

X-Axis (Time): e The x-axis represents time, ranging approximately from 2008 to 2024, showing historical stock performance over 16 years

Y-Axis (Close Price): e The y-axis represents the stock's closing price, which ranges from around 5 to over 40 units (likely VND, the currency of Vietnam)

From 2008 to 2010, the stock price experienced a significant surge, reaching a peak of approximately 40 units However, this was followed by a sharp decline between 2011 and 2012, with the price continuing to fluctuate downward until 2016 Between 2016 and 2021, the stock price stabilized at a relatively low level, hovering around 5 to 10 units Beginning in 2021, the stock price entered an upward trend, although it has experienced some fluctuations along the way.

2022, showing a recovery or renewed investor interest

Current Trend: e@ In 2023-2024, there is an observable upward movement in the stock price, suggesting a potential rebound

The chart illustrates the long-term performance of Hoang Anh Gia Lai JSC stock, highlighting early price volatility followed by a phase of stability and a recent upward recovery trend This information is valuable for investors and analysts assessing historical stock performance and making informed predictions about future market behavior.

The chart illustrates the long-term performance of Hoang Anh Gia Lai JSC stock, highlighting initial fluctuations followed by a phase of stability, culminating in a significant surge in value in recent times.

3.2 Close Price of Hoang Anh Gia Lai JSC with Bollinger Bands

+e ose Price of Hoang Anh Gia Lai JSC with Bollinger Bands

Figure 1.2: Close Price of Hoang Anh Gia Lai JSC with Bollinger Bands

For this image, we decided to enhance the previous time-series plot with Bollinger Bands and a Simple Moving Average (SMA):

1 Close Price (Blue Line): e The blue line represents the stock's actual closing price over time, similar to the previous chart It fluctuates significantly between 2008 and 2024, showing both high volatility in the early years and a recent upward trend

2 Simple Moving Average (Red Line): e The red line represents the SMA, a common technical indicator that smooths out price data by averaging it over a set period (usually 20 or 50 days) This gives a clearer view of the stock's overall trend by filtering out short-term fluctuations

3 Bollinger Bands (Green Line): e The green dashed lines are Bollinger Bands, which are plotted two standard deviations away from the SMA They create an upper and lower boundary around the stock price These bands expand and contract based on the stock's volatility: © When the price is highly volatile (like around 2010-2011), the bands widen © During periods of lower volatility (2016-2020), the bands narrow.

The interplay between the closing price, Simple Moving Average (SMA), and Bollinger Bands offers crucial insights into a stock's volatility and potential price reversals When the price approaches the upper Bollinger Band, it may signal overbought conditions, whereas a movement toward the lower band could suggest oversold conditions Additionally, the SMA serves to smooth out the data, enhancing the visibility of trends over time.

Trading Volume of Hoang Anh Gia Lai JS., cà 1 1S 1 1010110118118 re 8

Volume of Hoang Anh Gia Lai /SC

Figure 1.3: Volume of Hoang Anh Gia Lai JSC

This image displays a time-series line plot representing the trading volume of Hoang Anh Gia Lai JSC stock over time Here's a breakdown of the key features:

1 X-Axis (Time): © The x-axis represents the timeline, ranging from around 2008 to 2024, covering about 16 years of stock trading data

2 Y-Axis (Volume): © The y-axis shows the trading volume, which appears to reach over 6 million shares at its peak The units are likely in shares traded during a specific period (e.g., daily)

3 Volume Fluctuations: © From 2008 to around 2013, trading volume remained relatively low, showing little activity © After 2013, the trading volume starts to increase with more frequent spikes © From 2016 onwards, trading volume sees significant growth, with many sharp peaks This indicates periods of increased trading activity and higher market interest in the stock © From 2021 to 2024, there are even more dramatic spikes, suggesting major trading events, higher liquidity, or changes in investor behavior

This chart illustrates the evolution of the stock's trading volume over time, emphasizing significant periods of heightened market activity Notable spikes in volume often correlate with events like earnings reports, news releases, or major price fluctuations By examining trading volume, investors can assess interest in the stock, identify potential price trends, and understand overall market sentiment.

3.4 Returns of Hoang Anh Gia Lai JSC:

Returns of Hoang Anh Gia Lai JSC

Figure 1.4: Returns of Hoang Anh Gia Lai JSC

The graph shows a time-series line plot representing the returns of Hoang Anh Gia Lai JSC stock over time Here's a breakdown of the key features:

X-Axis (Time): The x-axis represents the timeline, ranging from around 2008 to 2024, covering approximately 16 years of stock returns data.

Y-Axis (Returns): The y-axis shows the returns, which appear to fluctuate between -0.4 and 0.2 The units are likely in percentage terms, representing the percentage change in stock price over a specific period (e.g., daily)

Return fluctuations show considerable volatility, characterized by alternating periods of positive and negative returns Notable spikes in returns may suggest the impact of significant events or news on stock prices In recent years, however, the returns have appeared relatively stable compared to earlier periods.

This chart illustrates the evolution of the stock's returns over time, emphasizing significant periods of performance fluctuations By examining these returns, investors can assess the stock's profitability, understand its risk profile, and evaluate its potential for future growth.

Next, we dive deeper into the ARIMA model:

ARIMA (AutoRegressive Integrated Moving Average) is a powerful statistical model used for time series prediction, comprising three key components The AR (AutoRegressive) aspect focuses on analyzing independent values alongside several lagged observations, known as past values The I (Integrated) component ensures the system is stationary by eliminating trends or seasonality, which is crucial for accurate forecasting Lastly, the MA (Moving Average) part examines the relationship between observations and residual errors from a moving average model, applying this analysis to the lagged observations for improved predictive accuracy.

An ARIMA model, denoted as ARIMA(p,d,q), consists of three key components: p represents the order of the autoregressive (AR) part, indicating the number of lagged observations; d signifies the degree of differencing, which measures how many times the differencing process is applied to achieve stationarity; and q denotes the order of the moving average (MA) part, reflecting the number of lagged forecast errors included in the model.

2 Check for stationary from statsmodels.tsa.stattools import adfuller def adf_test(series): result = adfuller(series) print(‘ADF Statistic: %f % result[0]) print(‘p-value: %f' % result[1]) print(‘Critical Values:’) for key, value in result[4].items(Q): print(\t%s: %.3f % (key, value)) ifresult[1]

Ngày đăng: 18/01/2025, 19:50

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w