Select at least 5 stock codes, minimum period of 5 years from December 31, 2021 or earli Use the Markov model to select the optimal portfolio and draw the efficient portfolio curve.. Nor
Trang 1
TON DUC THANG UNIVERSITY FACULTY OF FINANCE AND BANKING
BAL Hi TON BUC THANG
‘ON DUC THANG UNIVERSITY Oc
FINAL REPORT METHODS OF ECONOMIC ANALYSIS
Group 04: Nguyén Bao Chau B18h0433
Đào Lê Phương Thao B20H0595
Group: 11 Practice group: 01
Lecturers: Bui Đức Nhã
Tran An Nguyén
Ho Chi Minh city, date 30 month 05 year 2022
Trang 2
Select at least 5 stock codes, minimum period of 5 years from December 31, 2021 or earli Use the Markov model to select the optimal portfolio and draw the efficient portfolio curve
k+wuxx*x+*®
TEAM WORK ASSESSMENT TABLE TEAM
- Create report frame and outline -Compose the Markov model part Nguyễn Báo Châu| B18H0433 | - Introduction to data run method 100% (A)
- Compose Ideas to make PowerPoint
- Print documents
- Introduction of stock codes ar reasons
- Download data & Run data
- Making Excel files B20H0595 ; ; 100% (A) Thao - Making PowerPoint
Dao Lé Phuong
- Method of running data
- Result
- Conclusion
Trang 3
TABLE OF CONTENTS
H099 0à oi nh 4
1.1 A brief overview of the Markov mOd6l: 2221111121212 11EEETEELEEETETEEEEEkEkEkrkCrrrir 4 1.1.1 Hidden Markov Model (Hidden Markov Model): ch Hy HH Tri ren 4 U95 0 ion 4
1.2 AMarkov chain or Markov 5 nh ố 4
2 Introduction of securities codes and reasons for sel@CfiO: s2 Hrgrre 5 a DHG - Hau Giang Pharmaceutical Joint Stock Company: chen 5 b SSI - SSI Joint Stock Company: ch 11111111111 KHE TT TT hà 6 c DPM - Phu My Petrochemical and Fertilizer Joint Stock Company: che 6 d PVI - Vietnam Oil and Gas Insurance Joint Stock Companìy: - sec ri, 7 e HAG - Hoang Anh Gia Lai Joint Stock Companiy: cày 7 E9 7
khi» Ẳ co 7
K8 ccsc in .ằ.- 8
4 Datta na on 8
4.1 Cach tai Solver Add-in trong EXCel tt 11111111111 111k KHE 8 4.2 Need to build an objectfive function (Objective Funcfion) cty 8 4.3 Organize data on Excel spreadsheefs LH 1111111111111 T111 KH HH TH HH, 8 4.4 Use Solver to find the optimal SOlUfiOI cà + +2 t2 112221311111 1711 111K EEEEkTEEkrkrkrkre 9 5 RESUIt — 9
SP S is 0B - vi o0 0n 9
b9 0u n 10
99 ° 5 14
Trang 41 Introduction of the Markov model:
1.1A brief overview of the Markov model:
The Markov model was studied and introduced in 1960 In recent years, this method È gradually become popular There are two reasons leading to this model becoming m‹ popular, the first is that for the mathematical structure, this model is very rich and it ce form a theoretical basis to apply in practice; The second thing is that if applied correctly can be very beneficial for mission-critical applications Normally, investors will be interested in the volatility of the stock market or in other words the volatility of stocks ir particular, since the Markov model is widely used to forecast the price of securities as we Calculating the probability of a stock going up or down has helped solve a lot of problen for investors It can also compare current and past stock prices This helps investors mi easy, convenient and right decisions With the Markov model, investors will know that th probability of maintaining each market position is quite high and also know the averac number of days in each cycle to take reasonable action Besides, investors can also com with other technical analysis tools such as moving averages to increase investm efficiency For managers, it is very important to grasp market trends in order to mak appropriate decisions in each state of the market
1.1.1 Hidden Markov Model (Hidden Markov Model):
Is a system model in which the system has been modeled and is assumed to be a Mai process with unknown parameters and the task is to determine the hidden parameters fi the observable parameters The extracted model parameters are then used to pert subsequent analyses, such as pattern recognition applications
1.1.2 In a typical Markov model:
The observed state is observed directly from the observer, so the state transition probabili are found to be the only parameters Each state has a probability allocation over possi output manifestations Take a look at the sequence of expressions generated by the HN which does not directly indicate the sequence of states
1.2 A Markov chain or Markov chain:
- Is a discrete-time stochastic process with Markov property In such a process the pi has nothing to do with predicting the future, but it depends only on knowledge and tt present And this Marov model is named after the Russian mathematician Andrey Markc Besides, the Markov chain is widely applied as a statistical model in real-life processe
Trang 5research on cruise control systems in motorcycles, etc., currency exchange rates ; population changes
- A Markov process is a random process that satisfies the Markov property (nor memorability) To make it easier to understand, it is based on the present state of the syst independent past and future states
- A Markov chain is also defined as a Markov process in continuous or discrete tin with a countable (any time) state space
1.2.1 Discrete time Markov chains:
Is a sequence of random variables X1,X2,X3 with Markov property The probability of going to the next state depends only on the current state and not on the previous state
- Discrete time with countable state space is a discrete time Markov Chain over a fini
or countable state space
- Discrete time with a continuous state space or in general a Markov Chain over measured state space (Harris Chain)
1.2.2 Continuous time Markov chain:
Defined by a finite or countable state space S , a transition rate matrix Q with dimensio equal to that of the state space, and an initial probability distribution over that state space
- Continuous time with countable state space is a continuous time Markov process
- Continuous time with continuous state space or in general any continuous randc process with Markov property (VViener process)
In addition to the above four types, there are some extensions of the Markov process, bu has no special name
2 Introduction of securities codes and reasons for selection:
At the request of the lecturer, the group chose 5 securities codes in 5 different field DHG, SSI, DPM, HAG and PVI
a DHG — Hau Giang Pharmaceutical Joint Stock Company:
Hau Giang Pharmaceutical Joint Stock Company mainly operates in the field ‹ manufacturing and trading pharmaceuticals, supplies, equipment, medical instrumer functional foods and cosmetics, and providing health care services strong DHG h
Trang 6been listed on the Ho Chi Minh City Stock Exchange (HOSE) since 2006 DHG hold the leading position in the pharmaceutical industry in Vietnam in terms of revenue profit and production capacity with 7.5 billion units products/year On December 30
2019, Forbes Vietnam officially announced the list of "100 largest public companies’ This is the first time Forbes Vietnam has made this list in Vietnam DHG Pharma is ve honored to be in the list of "100 largest public companies" assessed by Forbes Vietni based on four criteria: revenue, profit, total assets and market capitalization value Because of the position and achievements that DHG has achieved in recent years, will be a reliable stock to invest in
b SSI — SSI Joint Stock Company:
SSI Securities Joint Stock Company (SSI — HOSE) was established in December 19!
is one of the oldest operating companies in the Vietnam Stock Market After 21 years operating under the market mechanism, the Company has developed into the larg financial institution in the market, with the fastest growth rate with a charter capita increase of more than 1500 times With strong financial potential, corporate governan activities according to international standards, strong and professional staff, SSI alwa provides customers with outstanding and comprehensive products and services, ensu customer satisfaction maximize the interests of shareholders The company has qt good financial ratios Especially now that the stock market is receiving the attention : many people after the Covid-19 epidemic, they should choose a securities company their investment portfolio
c DPM — Phu My Petrochemical and Fertilizer Joint Stock Company:
PetroVietnam Fertilizer and Chemicals Corporation (DPM) is a member of the Vietnar National Oil and Gas Group, established in 2003 In 2007, the Company was transforn into a joint stock company and listed on HOSE DPM's main business is manufacturit and trading fertilizers and chemicals Currently, the Corporation's main products are cle grain nitrogen (urea) fertilizers, NPK, Potassium, SA, DAP fertilizers to serve the country's agriculture; Liquid Ammonia gas, chemicals UFC85/Formaldehyde, H202 chemicals used in oil and gas extraction
Overcoming many challenges, PetroVietnam Fertilizers and Chemicals Corporatic continues to maintain its position as the leading enterprise in the industry in terms of bc equity size, business efficiency, total revenue and total revenue Total profit before tax
Trang 7d PVI — Vietnam Oil and Gas Insurance Joint Stock Company:
Established in 1996, by 2006, PVI was one of the first enterprises in Vietnam to k equitized to become the Vietnam Oil and Gas Insurance Corporation and listed on t stock exchange in 2007 with the code: PVI securities In August 2011, PVI continued | carry out restructuring according to the model of parent company - subsidiary compar PVI's main products and services include non-life insurance business: energy insuran marine insurance, technical insurance, property insurance, liability insurance, aviatic insurance, child insurance people, motor vehicle insurance, voluntary health insuran Business reinsurance; Life insurance business; Financial investment activitie Investment in real estate business
e HAG — Hoang Anh Gia Lai Joint Stock Company:
Hoang Anh Gia Lai Joint Stock Company (HAG), formerly Known as Hoang Anh Self- Property Enterprise, was established in 1993 In 2006, the Company switched operating under the joint stock model with a charter capital of 296 billion VND The Company's business fields changed in three main phases: the start-up period 1990-1 (wood furniture production), the massization period 2002-2012 (real estate), tr restructuring phase from 2013 (promoting investment in agriculture; divestment of re estate, hydropower, sugar cane, minerals) Currently, HAG owns 47,122 hect ares rubber, 18,675 hectares of fruit trees and 20,488 hectares of oil palm in Vietnam, La and Cambodia Regarding the consumption market, the Group is developing exp: distribution channels to potential markets such as China, Korea, Singapore and a focusing on exploiting the domestic market
3 Data
3.1 Data sources:
First, my team took historical data on the prices of 5 stocks selected at Investing.cc website and data from December 31, 2016 to December 31, 2021 (5-year period) )
The first step of data retrieval is to go to Investing.com website and then enter tt selected stocks in turn into the search field After the selected stock code is displaye
go to the "Historical data" section Next we will enter the time frame from Decembe
31, 2016 to December 31, 2021, the website will give us the data and then downlo the data Perform in turn with each selected stock code
Trang 83.2 Data processing:
After having fully retrieved the data of the securities codes, the team then calculate the daily profitability ratio of each stock ticker by the formula:
% Ty suit sinh lời qua ngày = Giá đóng cửa của ngày sau - Gía đóng cửa của ngày trước
Gía đóng cửa của ngày trước
After finding the return rate of each stock, the average return rate of each ticker w
be calculated
Then use the Markov model to calculate the rising, falling, and constant probabilitie
of 5 stocks and from there make a decision
4 Data run method:
To run the data should apply to a tool in Excel to solve the problems, that tool i called Solver Add-in This tool will help solve the problems of maximizing profit or minimizing cost faster and more convenient The following is the procedure for implementing the Solver tool:
4.1 Cach tai Solver Add-in trong Excel
- Click File and then select Options
- Inthe Add-in section, select Solver Add-in, then click the Go button
- Check the Solver Add-in box and click the OK button
- Finally, check the Data tab in the Analyze group to see if the Solver table i visible
4.2 Need to build an objective function (Objective Function)
- Identifies decisions that need to be made
- Find constraints on the problem
- Overall measure of the performance of the problem
4.3 Organize data on Excel spreadsheets
- Calculating using the SUMPRODUCT function
- A\trial-and-error approach can be used to solve the problem
Trang 94.4 Use Solver to find the optimal solution
Data tab in the Analyze group, click Solver
Import TotalProfit for Objective
Click Min or Max (depending on the condition of the post)
Add more binding conditions
Check Select a Solving Method and convert to Simplex LP
Finally click Solver
5 Result:
5.1 Statistical Description Return:
NGAY
MA CHUNG KHOAN DHG SSI DPM HAG PVI
MIN -0.066315789 -0.069936327 -0.06965Ï741 -0.069912609 -0.09 MAX 0.069950739 0.069958848 0.069931334 0.07 0.1020
MEAN 0.000588484 0.0016201174 0.000887761 0.00110364 0.0008
How to calculate Return (by date): Use the formula (( Pt+1) — Pt)/ Pt) to calculate
Return
In there:
Pt+1 : Current closing price
Pt : Closing price of the previous day
Then calculate the indexes MAX, MIN, MEDIAN, MEAN ( AVERAGE ) using the function in Excel
Trang 10
TUAN
MA CHUNG KHOAN DHG SSI DPM HAG PVI MIN -0.094735988 -0.203594592 -0.143239901 -0.192546584 -0.136 MAX 0172864324 0.1745657119 0.198279862 0.327546132 0.295% MEDIAN 0 0.007533089 0.0022168B1 0 0 MEAN 0.00341730{ 0.007701801 0.005626747 0.005589311 0.0044
How to calculate Return (by week): Use the same formula as by date However, data need to be reloaded weekly on Investing.com
Result:
On a daily basis, SSI and HAG stocks have the highest averages On a weekly ba SSI still has the highest index and DPM ranks 2 However, HAG is still in the hig index group
5.2 Convar Matrix:
After calculating the Return index data, we will use the Data analysis tool in Exce
to create a Markov model Here are the results:
DHG 0.000316656
Ssl 8.8577E-05 0.000563603
DPM 4.48604E-05 0.000183298 0.000480658
HAG 5.84775E-05 0.000184065 0.000150762 0.000752456
PVI 5.84452E-05 0.000131002 8.47553E-05 8.27909E-05 0.000398907
Next, based on the Stocks’ Daily Return data to calculate the AVERAGE
RETURN, VARIANCE, STD, STANDARD DEVIATION(STD) values:
0.023736 0.021923 0.027364 0.019972
0.000316 0.000561 0.000477 0.000746 0.000399
0.000588 0.00162 0.000883 0.001104 0.000822
After having obtained the above data, the group began to calculate % ‹ investment in securities codes Assuming % wright of the tickers then calculat the values ( Wi*Ri : Wright*Return of each ticker) and ( (Wi*2)*Var(x) : Wright*2 * Variance of each ticker stock):