The data - historical gold prices

Regression analysis is a statistical tool to understand the relationship between variables. In this chapter, we will implement a nonlinear regression to predict the gold price based on historical gold prices. For this example, we will use the historical gold prices from January 2003 to May 2013 in a monthly range obtained from www.gold.org. Finally, we will forecast the gold price for June 2013, and we will contrast it with the real price from an independent source. The complete dataset (since December 1978) is at http://www.gold.org/research/download-the-gold-price-since-1978.

The first seven records of the CSV file (gold.csv) look like this:

date,price 1/31/2003,367.5 2/28/2003,347.5 3/31/2003,334.9 4/30/2003,336.8 ...

Get Practical Data Analysis - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.