stock prediction using exponential smoothing method, markov chain, and queing model 20092401...
TRANSCRIPT
Stock prediction using Exponential smoothing method, Markov chain, and Queing model
Industrial Engineering
20092401 윤영규20090822 최상민20092403 최귀동
Stock prediction using Markov chain
INDEX
Stock prediction using Queing model
Stock prediction using Exponential smoothing method
Stock prediction using Exponential smoothing method
01
Abstract
1. We explore proper weight through exponential smooth-
ing of forecasting model
- When we anticipate stocks, we used to traditional finance
analysis of time-series. Surely, high prediction during a lot of
predictions exists. But, this prediction is difficult so we use
the exponential smoothing.
2. Error analysis
- This weight is proper? Plus, we analyze the historical data &
Forecasts for not different with result of prediction in next
day.
3. Established Algorithm for strategy
- Based on this strategy, we establish strategy for revenue,
and anlyze algorithm for day-trader or program trading.
<Background>
We do not anticipate a future. Especially, there is a different
about stocks of our country of price formation In other
words, either disadvantage or advantage, there is a effective
larger or smaller. But, Because of difference about influence
of news, we anticipate stocks on the basis of Linear model
and proper weight. But, Prediction is a dangerous way that
to predict the price on the basis of linear model. We estab-
lish strategies so, we will help to investors.
※ Stocks of target : KIA Motors (000270)
<Objective>
• We explore the proper weight using exponential smooth-
ing
• We analyze the proper weight through error analysis
• We establish stocks trading strategy algorithm for proper
decision making
• We introduce a suggestion & plan
1.1 Project background & objective 1.2 Project process
02Sumption & problem of existing research
2.1 About the company
Quotes and stocks holders
EPS : 9,416 BPS: 50,014 PER 5.99Type of busi-
ness PER: 5.77PBR : 1.13
Dividend rate : 1.24%
A. A subsidiary company of KIA Motors make progress production of parts, sale, rent, and maintenance.B. Car industry invests many capital. So each country builds the oligopoly system. Although big company make progress for car indus-try, possibility of success is low.C. Jan ~ Jun 2014,KIA Motors occupies 27.1%, a market share decrease 3.0%. D. KIA Motors is awarded Red dot design award for five consecutive years. Plus, ‘SOUL’is awarded IF design award, Red dot design award. So KIA Motors receive recognition about design.E. Sales construction occupied 62.8% about home, Europe-50.47%, North America-47.54%, etc-1.57%, and consolidated adjustments-62.38%
1. Although the accuracy of prediction is high, this prediction need a lot of mathematical knowledge. So we need a method easily. Therefore, In this project, we use the exponential smoothing.
2. Many investors anticipated stocks using day news. Therefore, it is right that we anticipate stocks using proper weight.
3. If the stocks price prediction, stocks data is severe deviation each event, industrial classification. If some studies, we anticipate specially designated industries. Therefore, To obtain objective results, we need applicable techniques.
2.2 Problem of existing research & prediction method
02
Chosen because the exponential smoothing)
1) One of features of the exponential smoothing is linear. But, the prediction for tomorrow which see price trend during a month is bad prediction. If we made a constrains well, pre-dicted stock price is maximum value and real stock price get below the value. In other words, this establish critical threshold
2) If we searched for approximate weight approximated real value, we get the accurate results using numerical analysis In other words, when we intend for each weight is x1, x2, and predicted values are y1, y2, if real price exist between x1, x2, we are easy to numerical analysis of linear.
3) Famous price prediction formulas are on the basis of linear regression. In other words, because Identify trends through line type is easy.
4) If we judge influence in future given, we are to determine the proper weight because influence is different each infor-mation.
2.3 Reason of supposition & selection
Supposition)1. we assumed that day news is no influence. (Features of exponential smoothing consider influence of historical data.)2. After starting the stock value for the month( 18th/Aug~ 16th /Sep), the next day, we add the day for prediction.3. 0.1 to 0.9, we analyze data for each result differ by as much as 0.1.4. We determined to influence in future. Stocks does not move in random walk.
Predicted stock price
Real stock price
Sumption & problem of existing research
03Stock prediction through the exponential smoothing
Way)For example, 18th/Aug to 15th/Sep based on the closing price of stocks, we anticipated 16th/Sep.1. We establish weight 0.1 to 0.9. we anticipate closing price of stocks.2. Since, Real price(yellow) and result price (red circle) compared to value.(Generally, when weight is 0.9, price is similar to closing price of stocks.)3. In other words, if we interpreted result of 16th/Sep, when weight is 0.9, weight increase or decrease is low value.( In other words, Be expressed as follows : 0.9<w ; w= weight)
Predicted price de-pending on weight
Real stock price
3.1 Analysis depending on weight
03
real stock price 54400seleted stock price
0.8<w<0.9
real stock price 54900
seleted stock price
0.9<w
As follow : The results of the build up data on a daily basis., primarily when weight is 0.9, weight is close it. Next, between 0.8<w<0.9, we know existed real prices. When weight is also 0.9, the closer to the current, we know that this influence can be seen high sensitive.
real stock price 53100seleted stock price
0.9<w
result
example
Stock prediction through the exponential smoothing
3.1 Analysis depending on weight
03
1 2 3 4 5 6 7 8 9
Series1
56808.71088148
83
55190.39680980
4
54294.34685041
29
53803.44769017
47
53545.94076573
85
53420.89864483
14
53369.61280012
15
53359.65681657
63
53373.41961035
5
51500
52500
53500
54500
55500
56500
57500
Results sensitized form depending on weight) 25th /Sep result.As follow : we express graph predictable prices of 0.1 to 0.9, when weight is 0.8, this increase after low point. But when weight is 0.9, mostly real price is similar to closing price of stocks. When we also rounded this number, this number correspond to real price or greater than the actual value. This becomes significant critical threshold.
real stock price
53400
seleted stock price
53373.42
0.9<w
It is 9/26
1 2 3 4 5 6 7 8 951000
52000
53000
54000
55000
56000
57000
real stock price 53000selected stock price
53037.34
w>0.9
Stock prediction through the exponential smoothing
3.1 Analysis depending on weight
When weight is 0.8, predicted price is 53359. It is rounded 10, 53400.When weight is 0.9, It is rounded 10 = 53400. In other words, we get a re-sult like a real price.Eventually, when weight is 0.9, we must use this value.
This chart is result which is each day. In other words, When weight is 0.9, this value decrease.
Proper weight exist in which greater than 0.9. When weight is 0.9, price is similar to real price. In this case, When weight is 0.9, pre-dicted value is 53037won. It is rounded 10 = 53000won In this case, When weight is 0.9, we consider Threshold.
03
1 2 3 4 5 6 7 8 952000
52500
53000
53500
54000
54500
55000
55500
56000
56500
It is 9/30(Coping when an exception occurs)
real stock price 53700seleted stock price
53696w= 0.3
5369653648
53468.24
3.2 Error analysis
1 2 3 4 5 6 7 8 91.25
1.3
1.35
1.4
1.45
1.5
1.55
There are exceptions. This chart de-crease slowly. Plus, when weight is 0.5, value has the smallest value. But, when this is exception, this value have similar values in which different weight.
When weight is 0.3, this point has a simi-lar value. but, When weight is 0.9,this value is similar. Surely it is rounded this value that this value become different value. If we can a rising, value is similar to real price. In other words. When weight is 0.9, we consider boundary value.
real stock price 59000seleted stock price
0.9<w
For example, 16th/Sep 0.1 to 0.9. we analyze real prices and pre-dicted prices. This chart is MAPE. In other words, we consider er-ror analysis. In other words, When weight is 0.8, difference be-tween real price and predicted price are very low. But, When weight is 0.9, this value is similar to real value. In other words, Error analysis is meaningless. In other words, we compared to error analysis chart and sensi-tized chart depending on weight, we know that this chart is differ-ent. Plus, we don’t see a error analysis to risk.
3.1 Analysis depending on weight
Stock prediction through the exponential smoothing
03 3.2 Error analysis
1 2 3 4 5 6 7 8 90
0.2
0.4
0.6
0.8
1
1.2Result of 17th SepSmallest weight = 0.5
1 2 3 4 5 6 7 8 90
0.5
1
1.5
2
2.5
3
real stock price 53100seleted stock price
0.9<w
Result of 22th SepSmallest weight = 0.9
When weight is 0.9, we compared to predicted price in 24th Sep and 30th Sep.
3.3 Algorithm through the strategy
1 4 7 10 13 16 19 22 2548000
50000
52000
54000
56000
58000
60000
62000
f(x) = − 217.47843429511 x + 61430.257170234
1 4 7 10 13 16 19 22 25 2848000
50000
52000
54000
56000
58000
60000
62000f(x) = − 261.2337245249 x + 61852.27690266
Of course, exceptions are existed. Look at this chart, when weight is 0.5, we consider very low value different real price to pre-dicted price. When weight is 0.9, this value is similar to real price. In this, Error analysis is meaningless.
When error analysis is analyzed, this chart is the result.When weight is 0.9, this value decrease, In other words, when weight is 0.9, The difference be-tween the actual value and the predicted value the smallest.Therefore, when weight is 0.9, we consider this value.
When weight is 0.9, if we consider this value, KIA Motors decrease. 30th Sep is steeper than 24th Sep, This mean is we don’t buy the stocks. But, It is possible that strategy use through the ex-ponential smoothing.
Stock prediction through the exponential smoothing
03
Start(data collection 1
month or 3 month)
weight(0.1~0.9) we conduct exponential smoothing.
When weight is 0.9, Each pre-dicted prices, we seize trend-
lines.
Trend line slope is steep?
(Negative direc-tion)
No
yes
Buy stocks
W>0.9 ?
When weight is 0.9, we round a predicted price. => w’
W’-a <= 현주식
<= w’+a
waiting(Next day, we judge after using
the exponential smoothing)
Buy or sell END
Stop loss <= Current stocks <=w’-a
sell
w’+a<= Current stocks또는Current stocks <= Stop loss
yes
No
3.3 Algorithm through the strategy
Stock prediction through the exponential smoothing
04
Result
4.1 Result & Summation
1. Result of prediction using weight, When weight is primarily 0.9, this value similar to real value. In other words, Getting smaller the effect.
2. Result of error analysis, we don’t judge measure of risk. Although value is no relationship with pre-dicted value, when weight is 0.9, we know that value is the smallest.
3. We know that we analyze data with Markov chain. Because, When weight is 0.9, value is similar, we know that It is independent in the past. So, we judge that it is accessed with exponential distribution or poisson distribution.
4. We judge that this form is weak form.
5. This form is right with short-term plan than long-term plan. This form suitable for day-trading or sys-tem-trading or algorithm trading.
Unfortunately, when we progress this project, period of data is short. So we supplement this data.
Stock prediction using Markov chain
01
Abstract
Actually, continuous bear market (Decrease trend)
Expected terminal valueSettlement of upper boundary through linear
Real stock price
Linear have strength and weakness.
When weighting was 0.9, we were found that expected price bigger than real price. But this is not a good condition for short. For easy short, we should sell the stock in the case of expected price bigger than real price. but this case is rare. (Sure, we are able to anticipate expected price.)
1.2 Result of the last time & Defect
1. Appropriacy of information & making of probability model
through the bayesian theory
- The Bayesian theory obtain the prior probability based on poste-
rior probability. It can be import decisions. We can be determined
to appropriate any probability information. We also can be mak-
ing of probability model. This situation is very important role
making procession model of the makov chain.
2. Making of probability of long time & short time
- Greater specificity of the Markov chain is that the memory has a
non-polarity characteristic of the past that is not affected. We
help you to find the influence of the cycle. Based on this informa-
tion, returning selling point, and determine the time of purchase,
obtain, and will get the expected value.
3. Future plans and results presented
-Then concluded, based on the results of today, is expected to in-
troduce a risk hedging using options strategies using cost-average
effect and the strategy of the queue in order to avoid the risk of
searching for security point.
<Background>
We get a condition through expected price for ‘Day trading’.
But bettermost expected price is bigger than real price. So,
we are difficult to catch for the timing.
In order to improve the timing, 0.9 weight is not transmit for
information of the past. Therefore, we use to the makov
chain using irrevant temper based on information. So, we
want to know short time & long time.
※ An object of study : KIA Motors (000270)
<Objective>
- Appropriacy of probability information & making of proba-
bility model through the Bayesian theory
- Making of probability & short time & long time Through
the makov chain
- Suggestion of direction & result
2.1 Background of a research & Objective 2.2 Project progress
01
Abstract
2.3 Character of markov chain
For example)
0.1 0.1 0.3 0.50.30.5
0.1 0.50.3
** As a result, the frog is jumping with same pattern.
** we assume that there are probability about frog.
** Therefore, we found high & low probability for the 4 days like a same pattern. (Source by 대신증권 )
High Low
35.29% 64.71%
01
Abstract
2.4 Appropriacy of probability through the bayesian theory
Assumption)
1. If stock is high tomorrow.2. Stock price increases probability of 0.5 (Probabilistic reliability : 0.5)3. Another probability increases probability of 0.5 (Probabilistic reliability : 0.5)D= This is data of increasing stock price for tomorrowA= Increasing probability ‘p’ : 0.5B= Increasing probability ‘p’ : 0.3529
P(D) = = 0.42645
** AnalysisActually, If probability of 35% increased, it is probability of 42%.In the future, it is smaller than increased value but we determine to use this data.
01
Abstract
02
Analysis using the markov chain
3.1 Making of a probability model
Pattern
I ) Probability of increase: 35.29% ≒ 0.3529ii) Probability of decrease : 64.71% ≒ 0.6471
Situation
0 : High, High : 0.3529 * 0.3529 = 0.1251 : High, Low : 0.3529 * 0.6471 = 0.22842 : Low, High : 0.6471 * 0.3529 = 0.22843 : Low, Low : 0.6471 * 0.6471 = 0.4187
Result of stock prediction using exponential smoothing
a : Expected price higher than real price: 0.37 -> Short strategy b : Real price lower than expected price : 0.63 -> Long Strategy or stay
ㅂㅈㅈ
** Probability of increase ① P( 상 ) = P(a)P(0|a) + P(b)P(2|b) = a’ + b’ = 0.37*0.125 + 0.63*0.2284 = 0.1901
** Probability of decrease ② P( 하 ) = P(a)P(1|a) + P(b)P(3|b) = a’’ + b’’ = 0.37*0.2284 + 0.63*0.4187 = 0.3483
ㅂㅈㅈ
①’P(a’| 상 ) =
= = 0.2431
①’’P(b’| 상 ) =
= = 0.7569
②’P(a’’| 하 ) =
= = 0.2426
②’’P(b’’| 하 ) =
= = 0.7574
02
Analysis using the markov chain
3.2 Analysis of the markov chain
ㅂㅈㅈ P=
Short Long
High
Low
** making of transition probability ‘P’
ㅂㅈㅈ
**N stage of safety probability using chepeuman Kolmogorov equationChange of P^n
We got a high & low probability along with stock model of same pattern for 4 days. However, Stock haven’t influence.
ㅂㅈㅈ
** Returnig time of average first
** Interpretation1. Surely, we should have to short the stock after 4 days. (Once a week)
** Solution
03
Conclusion & Direction of presentation
4.1 Result & Summary
4.2 Suggestion of direction
가 . We got a new strategy that we know returning term of short through the markov chain. However, we don’t know how much of risk.
나 . Short time is coming after 4 days. Short time is also coming once a month So, we will make a new strategy.
가 . risk-hedge using cost-average effect making waiting matrix
나 . Risk hedge using option
Stock prediction using Queing model
01
Last class
ㅂㅈㅈ
※ An object of study : KIA Motors (000270)
<Objective>
• Search of a proper weighting in accordance with demand
prediction model of exponential smoothing
• Analysis through error analysis.
1.2 Result of the last time & Defect
ㅂㅈㅈ
1. In case of 0.9, this is analogous to the actual value. In other words, it is sensitive to recent news. Further, little impact to-ward the past.
2. According to error analysis result, This is not a mea-sure of risk. Although this is irrelevant to predictive value, this is small differences in the case of 0.9.
3. We could know that prediction is possible though the markov chain. When weighting was 0.9, Predictive value likes a actual value. In other words, we were found that there is no connection with the past. As a result, we judge that we should approach with exponential distribution and poisson distribution.
4. We could judge that it has weak form.
1.1 Summary of the last time When weighting was 0.9, Trendline comparison of predictive value(9/24, 9/30 )
48000
50000
52000
54000
56000
58000
60000
62000
f(x) = − 217.478434295112 x + 61430.2571702338
48000
50000
52000
54000
56000
58000
60000
62000f(x) = − 261.233724524947 x + 61852.2769026566
Expected to continue declining(Prediction of bear market)
02
Abstract
Actually, continuous bear market (Decrease trend)
Expected terminal valueSettlement of upper boundary through linear
Real stock price
Linear have strength and weakness.
When weighting was 0.9, we were found that expected price bigger than real price. But this is not a good condition for short. For easy short, we should sell the stock in the case of expected price bigger than real price. but this case is rare. (Sure, we are able to anticipate expected price.)
1.2 Result of the last time & Defect
02
Abstract
1. Appropriacy of information & making of probability model
through the bayesian theory
- The Bayesian theory obtain the prior probability based on poste-
rior probability. It can be import decisions. We can be determined
to appropriate any probability information. We also can be mak-
ing of probability model. This situation is very important role
making procession model of the makov chain.
2. Making of probability of long time & short time
- Greater specificity of the Markov chain is that the memory has a
non-polarity characteristic of the past that is not affected. We
help you to find the influence of the cycle. Based on this informa-
tion, returning selling point, and determine the time of purchase,
obtain, and will get the expected value.
3. Future plans and results presented
-Then concluded, based on the results of today, is expected to in-
troduce a risk hedging using options strategies using cost-average
effect and the strategy of the queue in order to avoid the risk of
searching for security point.
<Background>
We get a condition through expected price for ‘Day trading’.
But bettermost expected price is bigger than real price. So,
we are difficult to catch for the timing.
In order to improve the timing, 0.9 weight is not transmit for
information of the past. Therefore, we use to the makov
chain using irrevant temper based on information. So, we
want to know short time & long time.
※ An object of study : KIA Motors (000270)
<Objective>
- Appropriacy of probability information & making of proba-
bility model through the Bayesian theory
- Making of probability & short time & long time Through
the makov chain
- Suggestion of direction & result
2.1 Background of a research & Objective 2.2 Project progress
02
Abstract
2.3 Character of markov chain
For example)
0.1 0.1 0.3 0.50.30.5
0.1 0.50.3
** As a result, the frog is jumping with same pattern.
** we assume that there are probability about frog.
** Therefore, we found high & low probability for the 4 days like a same pattern. (Source by 대신증권 )
High Low
35.29% 64.71%
02
Abstract
2.4 Appropriacy of probability through the bayesian theory
Assumption)
1. If stock is high tomorrow.2. Stock price increases probability of 0.5 (Probabilistic reliability : 0.5)3. Another probability increases probability of 0.5 (Probabilistic reliability : 0.5)D= This is data of increasing stock price for tomorrowA= Increasing probability ‘p’ : 0.5B= Increasing probability ‘p’ : 0.3529
P(D) = = 0.42645
** AnalysisActually, If probability of 35% increased, it is probability of 42%.In the future, it is smaller than increased value but we determine to use this data.
03
Analysis using the markov chain
3.1 Making of a probability model
Pattern
I ) Probability of increase: 35.29% ≒ 0.3529ii) Probability of decrease : 64.71% ≒ 0.6471
Situation
0 : High, High : 0.3529 * 0.3529 = 0.1251 : High, Low : 0.3529 * 0.6471 = 0.22842 : Low, High : 0.6471 * 0.3529 = 0.22843 : Low, Low : 0.6471 * 0.6471 = 0.4187
Result of stock prediction using exponential smoothing
a : Expected price higher than real price: 0.37 -> Short strategy b : Real price lower than expected price : 0.63 -> Long Strategy or stay
ㅂㅈㅈ
** Probability of increase ① P( 상 ) = P(a)P(0|a) + P(b)P(2|b) = a’ + b’ = 0.37*0.125 + 0.63*0.2284 = 0.1901
** Probability of decrease ② P( 하 ) = P(a)P(1|a) + P(b)P(3|b) = a’’ + b’’ = 0.37*0.2284 + 0.63*0.4187 = 0.3483
ㅂㅈㅈ
①’P(a’| 상 ) =
= = 0.2431
①’’P(b’| 상 ) =
= = 0.7569
②’P(a’’| 하 ) =
= = 0.2426
②’’P(b’’| 하 ) =
= = 0.7574
03
Analysis using the markov chain
3.2 Analysis of the markov chain
ㅂㅈㅈ P=
Short Long
High
Low
** making of transition probability ‘P’
ㅂㅈㅈ
**N stage of safety probability using chepeuman Kolmogorov equationChange of P^n
We got a high & low probability along with stock model of same pattern for 4 days. However, Stock haven’t influence.
ㅂㅈㅈ
** Returnig time of average first
** Interpretation1. Surely, we should have to short the stock after 4 days. (Once a week)
** Solution
04
Conclusion & Direction of presentation
4.1 Result & Summary
4.2 Suggestion of direction
가 . We got a new strategy that we know returning term of short through the markov chain. However, we don’t know how much of risk.
나 . Short time is coming after 4 days. Short time is also coming once a month So, we will make a new strategy.
가 . risk-hedge using cost-average effect making waiting matrix
나 . Risk hedge using option