# allisonmorgan/google_trends

Predicting Google Search Trends
Jupyter Notebook Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
 Failed to load latest commit information. data tisean .gitignore LICENSE.txt README.md chaoticdynamics_final.pdf embedding.py knn.py main.py ordinal_TSA.so parse_google_trends.ipynb slides.pdf utilities.py

# 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)
``````