Free Essay

Gold Price Forescasting

In:

Submitted By moh728
Words 3877
Pages 16
Forecasting Gold Price, using linear regression model and ARIMA
DIANE MAHAMEDOU Department of Economics, Business and Finance, Brooklyn College, 2900 Bedford Avenue Brooklyn, N.Y. 11210, USA
Instructor:Prof. Yusheng Peng

Abstract: Forecasting is a function in management to assist decision making. Forecasting arises when you need to estimate future unknown situations, such price of commodities, GDP, unemployment rate etc, for the coming period. We can’t accurately predict without referring time series estimation. Gold is a precious yellow commodity once used as money. Illegal couple years ago, now once again is accepted as a potential currency, because of the falling of dollar against the Euro and also the rising of uncertainty in our geopolitical environment. Objective of this study is to develop a forecasting model for predicting gold prices based on two currency price movements and the oil price movements. Following the melt-down of US dollars, investors are putting their money into gold because gold plays an important role as a stabilizing influence for investment portfolios. With the increasing demand of the Gold around the world, we have fund necessary to develop a linear regression model that reflects the structure and pattern of gold market and forecast movement of gold price. The most appropriate approach to the understanding of gold prices is the multiple linear regression (MLR) models. MLR is a study on the relationship between a single dependent variable and one or more independent variable. The fitted of MLR will be used to predict the future gold prices. Variables are defined as follow: Average Gold Prices in USD: GP Exchange rate of Euro to USD: EUROUSD Exchange rate of Japanese Yen to USD: JPYUSD Average oil Prices: OP

Introduction
Price forecasting is an integral part of economic decision making. Forecasts may be used in numerous ways; for different purposes, such as to gain from speculative activities, to determine optimal government policies, or to make business decisions. Like any other goods, goods, gold’s price depends on supply and demand. Gold is the most traded precious metal and play an important role in shaping economy. Gold is also safe haven against depreciation risk. In contrast to other commodities gold is storable and supply is accumulated over centuries. Today, gold like other commodities are predominantly quoted in U.S. Dollars. An important fact that everyone should know from 1944 to 1971, U.S dollars were convertible into gold, in order to prevent trade imbalances between countries. Then and there price of gold was fixed at $35 per troy ounce. After 1971, when the dollar convertibility into gold was cancelled, price stability of this researched commodity has vanished. Gold behaves less like a commodity but rather like long-lived assets such as stocks or bonds, gold prices are forward looking and today price depend heavily on future supply and demand. Thus, the forecast of gold price depends on the market’s psychological perception of the value of gold which in turn depends on a myriad of interrelated variables, including inflation rate, currency fluctuation and political turmoil for instance the Iraq war 2003, the subprime crisis 2008-2009. In this study we will first present the forecasting model for predicting future gold price using Multiple Linear Regression method. Then we will use a little Technical and Chart Analysis end up by a discussion point about the selected model.

Variable GP OP EUROUSD JPYUSD

Source www.kitco.com www.iea.org www.federalreserve.gov www.federalreserve.gov

Problem statement: The gold prices are time series data of gold prices fixed twice a day in London. Factors influencing gold prices are many so that for accuracy purpose we need to make a serious and selective study to ensure that that the model developed is significant otherwise we’ll end up with a biased result. It is common practice in gold trade to use London PM Fix as the factor for pricing of gold and these become the published benchmark price used by the producers, consumers, investors and central banks. In this study, we proposed the development of forecasting model for predicting future gold price using Multiple Linear Regression (MLR). The data used in this study are the Gold Prices (GP) from the London PM Fix (Noon fixing time) that we have turned into monthly Gold average Prices. GP will the single dependent variable in this model. We have chosen identified three independent variables which influence the gold prices based on our own experience as “Chartists” such as: Exchange rate of Euro to USD (EUROUSD), Exchange rate of Japanese Yen to USD (JPYUSD), Average oil Prices (OP). However, these are not the only factors influencing gold prices. The data used in this study were downloaded from couple sources from the addresses as shown below:

Now our main purpose is to determine the regression model which accurately predicts the gold price. After running the regression on R, we end up with 7 regression models. Let’s define the variables as follows: Y-GP X1-EUROUSD JPYUSD-X2 OP-X3 A first order equation is hypothesized to be: β0 + β1X1 + β2X2 + β3X3 +ε Model 1: this model included all the potential independent variables that we chosen for our study. The model obtained is: Yhat = 4212.1509 -944.6394X1 -25.8220X2 + 7.6330X3 R-squared: 0.8742; Residual standard error: 121.4; 59 degrees of freedom. Model 2: Yhat= 3875.748 + 56.071X1 -30.061X2 Multiple R-squared: 0.7196; Residual standard error: 179.7; 60 degrees of freedom. Model 3: Yhat = 3999.541 -2654.096X1 + 10.643X3 R-squared: 0.5029; Residual standard error: 239.3; 60 degrees of freedom Model4: Yhat= 3472.5478 -30.2774X2 + 5.7808X3 Multiple R-squared: 0.8388; Residual standard error: 136.3; 60 degrees of freedom Model 5: Yhat= 3446.0 -1580.5X1 R-squared: 0.1817; Residual standard error: 304.5; 61 degrees of freedom. Model 6:

Yhat= 828.244 + 5.198X3 Multiple R-squared: 0.09663; Residual standard error: 319.9, 61 degrees of freedom Model 7: Yhat= 3928.317 -29.787X2 R-squared: 0.7195; Residual standard error: 178.3; 61 degrees of freedom After assessing all the 7 models, we find out the model 1 is the best fit for gold prices forecasting, with R-squared: 0.8742, that means 87.42% of variation of the gold prices around the mean price is explained by the time series equation Yt= 4212.1509 -944.6394X1t -25.8220X2t + 7.6330X3t + εt . The table I shows the actual prices of gold compare to its predicted prices.

GP periods GP predicted 1 889.595 746.2789 2 922.298 781.9908 3 968.434 950.0628 4 909.705 931.8997 5 888.663 1005.1718 6 889.488 1003.6484 7 939.772 982.9438 8 839.025 865.5322 9 829.932 898.4731 10 806.62 962.7148 11 760.863 942.8759 12 816.092 894.0441 13 858.69 952.5379 14 943.163 902.9478 15 924.273 818.7859 16 890.2 791.0647 17 928.645 879.1235 18 945.67 925.3758 19 934.228 933.4524 20 949.375 956.4642 21 996.591 1008.6155 22 1043.159 1057.3594 23 1027.036 1094.8481

residuals 143.3161 140.3072 18.3712 -22.1947 -116.509 -114.16 -43.1718 -26.5072 -68.5411 -156.095 -182.013 -77.9521 -93.8479 40.2152 105.4871 99.1353 49.5215 20.2942 0.7756 -7.0892 -12.0245 -14.2004 -67.8121

24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Table I

1134.724 1117.963 1095.413 1113.337 1148.688 1205.434 1232.92 1192.966 1215.81 1270.977 1342.024 1369.886 1390.553 1356.4 1372.725 1424.011 1473.806 1510.438 1528.659 1572.81 1755.805 1771.852 1665.214 1738.977 1652.306 1656.119 1742.619 1673.773 1650.066 1585.505 1596.697 1593.909 1626.034 1744.45 1747.011 1721.136 1688.529 1670.955 1627.588 1592.863

1079.422 1109.1935 1175.6199 1207.9034 1176.4429 1214.0787 1287.8386 1325.5071 1375.162 1370.9728 1413.7597 1433.7753 1490.9076 1498.1043 1474.6566 1565.233 1538.3565 1536.7029 1509.8205 1514.4563 1529.7302 1584.0219 1595.4191 1670.7061 1713.0345 1770.4 1715.8229 1645.6287 1659.6032 1668.0885 1608.4024 1685.2724 1726.9756 1700.409 1629.9998 1594.4053 1482.8075 1378.5197 1277.4538 1251.6433

55.302 8.7695 -80.2069 -94.5664 -27.7549 -8.6447 -54.9186 -132.541 -159.352 -99.9958 -71.7357 -63.8893 -100.355 -141.704 -101.932 -141.222 -64.5505 -26.2649 18.8385 58.3537 226.0748 187.8301 69.7949 68.2709 -60.7285 -114.281 26.7961 28.1443 -9.5372 -82.5835 -11.7054 -91.3634 -100.942 44.041 117.0112 126.7307 205.7215 292.4353 350.1342 341.2197

Analyzing the trend, we can see a perfect correlation between the current price and the expected price of gold. Our model can serve as basis for projecting the future prices of gold but unfortunately we don’t the future values of the explanatory variables. And we decide to base solely on the gold itself, to do so we are going through the ARIMA method to figure out this project, which may be a little ambitious, but once done, can serve as a guide for economic operators and even for policymakers. The chart and technical analysis may also be helpful. Analysis of Data: 1. The basic ARIMA model analysis of the historical Gold prices: To perform the basic ARIMA time series analysis on the historical stock prices, we first make a plot of the raw data, i.e. the monthly average prices of Gold over period. The plot is shown below:

This plot shows that the average prices of Gold have increased in general over the past five years. However, there is no apparent pattern in the movement of the Gold price. From period 1 to period 20 was in trading range, above the period 20(august 2007), Gold prices have moved sharply and made a high around $1800 during the period 45(September 2010), since this period the prices entered in a new congestion zone, price between $1800 and $1600. These observations tell us quickly the movement of Gold prices has different variances. We need to correct the non constant variance, to deal with the problem we are going to plot the autocorrelation function and the partial autocorrelation function of the first differences of the transformed data:

From these plots, the ACF and the PACF did not report any clear pattern. However, the plot of first differenced data and the PACF plot with decreasing Auto correlation indicated a tentative model ARIMA (1, 1, 0). The forecasts obtained for the 12 month periods are shown below:

s This graph shows two major trends the downward trend below the $1400 price line and an upward trend above the $1400 price line. So we need to do a little technical and chart analysis to make sure in what direction the Gold prices will the next coming period. 2. Technical and Chart Analysis We plot the monthly Gold prices chart that we got from investing.com showing the prices movement from 2005 up to now. Since the end of 2003 the price of gold has continued to appreciate until a major top is reached during July and August 2011 around $1900.00. The level of $1900.00 (resistance) was tested 2 times and then the market fall and entered in a congestion zone where the prices have oscillated between $1800 and $1556. The shape of the Harami (reverse pattern in technical and chart analysis) which occurred during August and September 2012 was already an important signal of reverse pattern. The shape of the Harami led to the fall of the market and the support level at 1556 which has been tested 2 times was finally broken, and the new target point is the support level around 1178.11 this could probably be reached according the ARIMA forecasting during period 74 and 75(February and march 2014).

Discussion Forecasting Prices is an important component in many economic decisions making. Forecasts may be used in numerous ways and in this study we have proposed the development of forecasting models using the multiple linear regressions (MLR). Initially, we include all the potential independent variables. In the final analysis, we concluded the model 1 is the best fit for gold prices forecasting, Yhat = 4212.1509 -944.6394X1 -25.8220X2 + 7.6330X3 where Y-GP (gold price), X1-EUROUSD (Exchange rate of Euro to USD), JPYUSD-X2(Exchange rate of Japanese Yen to USD: JPYUSD), X3- OP (Average oil Prices). This model seems to be appropriate because the amount of variance explained is about 87.42%. We use linear regression equations to forecast the dependent variable by plugging likely value of the independent variables into the estimated equations and calculating a predicted value of Y; this bases the prediction of the dependent variable on the independent variables (and on their estimated coefficients). ARIMA is an increasingly popular forecasting technique that completely ignores independent variables in making forecasts. ARIMA is a highly refined curve-fitting device that uses current and past values of the

dependent variable to produce often accurate short term forecasts of that variable. The use of ARIMA is appropriate when little or nothing is known about the dependent variable to be forecasted, when the independent variables known to be important really cannot be forecasted effectively, or when all that is needed is a one or two period forecast. ARIMA has the potential to provide short-term forecasts that are superior to more theoretically satisfying regression models. Conclusion Gold is market is expanding rapidly today because of the buoyant gold prices and the demand from the demand the countries like India and China. With the rising of gold demand, forecasting the price of gold is seen essential but difficult. The paper makes an attempt to forecast the price of gold in the short run through time series modeling using the monthly prices of gold. ARIMA associated with some technical analysis instrument could be an awesome tool for forecasting price of commodities, currencies and so on. The forecasts obtained for 12 periods ahead gave us the new target point is the support level around 1178.11 this could probably be reached according the ARIMA forecasting between period 74 and 75(February and march 2014). However we notice another method of forecasting using the Elliot wave theory associated with Gann angles which are essentially used by market technicians or chartists.

Appendix (R code) Models estimation > GOLD str(GOLD) 'data.frame': 63 obs. of 5 variables: $ periods: int 1 2 3 4 5 6 7 8 9 10 ... $ GP : num 890 922 968 910 889 ...

$ EUROUSD: num 1.47 1.48 1.55 1.58 1.56 ... $ JPYUSD : num 108 107 101 103 104 ... $ OP : num 93 95.3 105.6 112.6 125.4 ...

> summary(GOLD) periods GP EUROUSD JPYUSD

Min. : 1.0 Min. : 760.9 Min. :1.222 Min. : 76.64 1st Qu.:16.5 1st Qu.: 941.5 1st Qu.:1.308 1st Qu.: 80.78 Median :32.0 Median :1232.9 Median :1.356 Median : 89.27 Mean :32.0 Mean :1277.3 Mean :1.372 Mean : 89.00 3rd Qu.:47.5 3rd Qu.:1611.4 3rd Qu.:1.434 3rd Qu.: 94.83 Max. :63.0 Max. :1771.9 Max. :1.576 Max. :109.36 OP Min. : 39.16 1st Qu.: 76.09 Median : 87.93 Mean : 86.39 3rd Qu.: 97.20 Max. :133.93 > out1 summary(out1)

Call: lm(formula = GP ~ EUROUSD + JPYUSD + OP, data = GOLD)

Residuals: Min 1Q Median 3Q Max

-182.01 -86.97 -14.20 52.41 350.13

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4212.1509 240.3017 17.529 < 2e-16 *** EUROUSD JPYUSD OP --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -944.6394 231.8868 -4.074 0.00014 *** -25.8220 7.6330 1.9573 -13.193 < 2e-16 ***

0.8968 8.512 7.5e-12 ***

Residual standard error: 121.4 on 59 degrees of freedom Multiple R-squared: 0.8742, Adjusted R-squared: 0.8678

F-statistic: 136.6 on 3 and 59 DF, p-value: < 2.2e-16

> anova(out1) Analysis of Variance Table

Response: GP Df Sum Sq Mean Sq F value Pr(>F) EUROUSD 1 1255533 1255533 85.173 4.756e-13 *** JPYUSD OP 1 3717849 3717849 252.211 < 2.2e-16 *** 1 1067967 1067967 72.449 7.503e-12 ***

Residuals 59 869720 14741 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > out2 summary(out2)

Call: lm(formula = GP ~ EUROUSD + JPYUSD, data = GOLD)

Residuals: Min 1Q Median 3Q Max

-391.49 -118.59 16.42 123.14 493.35

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3875.748 350.836 11.05 4.31e-16 *** EUROUSD JPYUSD --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 56.071 295.839 0.19 -30.061 0.85

2.802 -10.73 1.39e-15 ***

Residual standard error: 179.7 on 60 degrees of freedom Multiple R-squared: 0.7196, Adjusted R-squared: 0.7103

F-statistic: 77 on 2 and 60 DF, p-value: < 2.2e-16

> anova(out2) Analysis of Variance Table

Response: GP Df Sum Sq Mean Sq F value Pr(>F) EUROUSD 1 1255533 1255533 38.877 4.956e-08 *** JPYUSD 1 3717849 3717849 115.122 1.390e-15 ***

Residuals 60 1937687 32295 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > out3 summary(out3)

Call: lm(formula = GP ~ EUROUSD + OP, data = GOLD)

Residuals: Min 1Q Median 3Q Max

-487.72 -129.20 -20.07 156.19 641.60

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3999.541 472.527 8.464 7.95e-12 *** EUROUSD OP --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -2654.096 379.004 -7.003 2.47e-09 *** 10.643 1.709 6.227 5.12e-08 ***

Residual standard error: 239.3 on 60 degrees of freedom Multiple R-squared: 0.5029, Adjusted R-squared: 0.4863

F-statistic: 30.35 on 2 and 60 DF, p-value: 7.815e-10

> anova(out3) Analysis of Variance Table

Response: GP Df Sum Sq Mean Sq F value Pr(>F) EUROUSD 1 1255533 1255533 21.928 1.665e-05 *** OP 1 2220140 2220140 38.775 5.116e-08 ***

Residuals 60 3435396 57257 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > out4 summary(out4)

Call: lm(formula = GP ~ JPYUSD + OP, data = GOLD)

Residuals: Min 1Q Median 3Q Max

-194.09 -91.11 -43.86 65.82 451.80

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3472.5478 176.7034 19.652 < 2e-16 *** JPYUSD OP --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -30.2774 5.7808 1.8220 -16.618 < 2e-16 ***

0.8676 6.663 9.38e-09 ***

Residual standard error: 136.3 on 60 degrees of freedom Multiple R-squared: 0.8388, Adjusted R-squared: 0.8334

F-statistic: 156.1 on 2 and 60 DF, p-value: < 2.2e-16

> anova(out4) Analysis of Variance Table

Response: GP Df Sum Sq Mean Sq F value Pr(>F) JPYUSD 1 4972221 4972221 267.720 < 2.2e-16 ***

OP

1 824499 824499 44.394 9.377e-09 ***

Residuals 60 1114349 18572 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > out5 summary(out5)

Call: lm(formula = GP ~ EUROUSD, data = GOLD)

Residuals: Min 1Q Median 3Q Max

-670.85 -228.41 -15.51 288.27 575.23

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3446.0 EUROUSD --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -1580.5 590.6 5.835 2.21e-07 *** 429.5 -3.680 0.000496 ***

Residual standard error: 304.5 on 61 degrees of freedom Multiple R-squared: 0.1817, Adjusted R-squared: 0.1683

F-statistic: 13.54 on 1 and 61 DF, p-value: 0.0004957

> anova(out5) Analysis of Variance Table

Response: GP Df Sum Sq Mean Sq F value Pr(>F) EUROUSD 1 1255533 1255533 13.542 0.0004957 *** Residuals 61 5655536 92714 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > out6 summary(out6)

Call: lm(formula = GP ~ OP, data = GOLD)

Residuals: Min 1Q Median 3Q Max

-634.98 -207.12 12.98 298.67 498.57

Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 828.244 180.372 4.592 2.25e-05 *** OP --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 5.198 2.035 2.554 0.0131 *

Residual standard error: 319.9 on 61 degrees of freedom Multiple R-squared: 0.09663, Adjusted R-squared: 0.08182 F-statistic: 6.525 on 1 and 61 DF, p-value: 0.01315

> anova(out6) Analysis of Variance Table

Response: GP Df Sum Sq Mean Sq F value Pr(>F) OP 1 667834 667834 6.5251 0.01315 *

Residuals 61 6243235 102348 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > out7 summary(out7)

Call: lm(formula = GP ~ JPYUSD, data = GOLD)

Residuals: Min 1Q Median 3Q Max

-393.41 -117.57 9.44 125.99 487.46

Coefficients:

Estimate Std. Error t value Pr(>|t|) (Intercept) 3928.317 213.139 18.43 F) JPYUSD 1 4972221 4972221 156.44 < 2.2e-16 ***

Residuals 61 1938847 31784 --Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Appendix(R code)(ARIMA) GOLD str(GOLD) 'data.frame': 63 obs. of 5 variables:

$ periods: int 1 2 3 4 5 6 7 8 9 10 ... $ GP : num 890 922 968 910 889 ...

$ EUROUSD: num 1.47 1.48 1.55 1.58 1.56 ... $ JPYUSD : num 108 107 101 103 104 ... $ OP : num 93 95.3 105.6 112.6 125.4 ...

> plot(GOLD$GP,type="l") > par(mfrow=c(2,1)) > acf(GOLD$GP) > pacf(GOLD$GP) > dGOLD ndifGOLD plot(1:ndifGOLD,dGOLD,type="l") > par(mfrow=c(2,1)) > acf(dGOLD) > pacf(dGOLD) > length(GOLD$GP) [1] 63 > nobs=length(GOLD$GP) > GOLD.fit GOLD.fit

Call: arima(x = GOLD$GP, order = c(1, 1, 0), xreg = (1:63), include.mean = FALSE)

Coefficients:

ar1 (1:63) 0.0211 11.3348 s.e. 0.1269 6.7836

sigma^2 estimated as 2736: log likelihood = -333.31, aic = 672.62 > coef(GOLD.fit) ar1 (1:63)

0.02111697 11.33477849 > GOLD.pred plot(GOLD$GP,type="l",xlim=c(63,75),ylim=c(800,1800)) > lines(GOLD.pred$pred,col="blue") > lines(GOLD.pred$pred+2*GOLD.pred$se,col="red") > lines(GOLD.pred$pred-2*GOLD.pred$se,col="red") > title(main="Forecast and interval for Gold Price") >

Similar Documents