Is Gold a Good Investment? Gold Price Prediction Using Machine Learning Techniques

[ad_1]

This weblog put up is tailored from a capstone venture created by Aihui Ong for Springboard’s Data Science Career Track. This put up initially appeared on Aihui’s Medium page.

Image for post

GLD vs S&P 500 from 2005 to 2019

Image for post

So: is gold nonetheless a superb funding?

Image for post

adfuller_result = adfuller(knowledge['Open'])
print('ADF Statistic: ', adfuller_result[0])
print('p-value: ', adfuller_result[1])
ADF Statistic:  -1.8025174981713052
p-value:  0.3792125439071432

GLD price before transformation

GLD price after transformation

Splitting data into training and test set

outcomes = auto_arima(arima_data,
seasonal=True,
start_p = 1,
start_q = 1,
start_P=1,
start_Q=1,
max_P=3,
max_Q=3,
m=7, #seasonal interval
information_criterion='aic',
hint=True,
error_action='ignore',
stepwise=True)

Using Auto Arima to Forecast Opening Price and Compare With Test Data

Image for post

Using Facebook Prophet to Forecast gold prices

all_auto_arima_model = SARIMAX(arima_data,
seasonal=True,
order=(0,1,0),
seasonal_order=(0,0,0,7),
development='c')

Forecast of gold prices from 2019 to 2021 using Auto Arima

Gold price google trend

Need to study extra? Take a look at Springboard’s Data Science Career Track.

[ad_2]

Source link

Write a comment