allisonmorgan / google_trends

Predicting Google Search Trends

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Predicting Google Search Trends

Final Project for CSCI 5466 - Chaotic Dynamics

Introduction

The goals of this project were to see whether of not some Google search trends are predictable. Class presentation can be found in slides.pdf.

Setup

This package requires pytrends, numpy, sklearn, matplotlib and pandas. This notebook can be used to download a Google search trend. To learn more about the data, read Samantha Molnar's blog post.

To play with one of the trends already downloaded ("baseball", "influenza", and "full moon"), you may run:

python main.py "full moon"

This will generate a plot of the time series. It will also create plots of mutual information and percentage of false nearest neighbors - the steps required to delay-coordinate embed the time series. Finally, it will produce a prediction for the last 20% of the time series.

In blue is the real time series, and in red is our single-step forecast using Lorenz Method of Analogues with k=5.

Works Cited

I would highly recommend looking over Joshua Garland and Liz Bradley's paper "Prediction in Projection" for information about delay-coordinate embedding and prediction using Lorenz Method of Analogues (LMA).

J. Garland and E. Bradley, "Prediction in projection," Chaos 25:123108 (2015)

The file embedding.py contains python wrappers for some functions from the time series analysis package, TISEAN. Binaries relevant to this project have been reproduced in the tisean folder.

R. Hegger, H. Kantz, and T. Schreiber, Practical implementation of nonlinear time series methods: The TISEAN package, CHAOS 9, 413 (1999)

About

Predicting Google Search Trends

License:GNU General Public License v3.0


Languages

Language:Jupyter Notebook 85.9%Language:Python 14.1%