Tools for Google Data

47
1 Tools for Google Data Hal Varian Kauffman Blogger Conference April 2013

Transcript of Tools for Google Data

Page 1: Tools for Google Data

1

Tools for Google Data

Hal VarianKauffman Blogger Conference

April 2013

Page 2: Tools for Google Data

2

Google Trends

Google Correlate

Google Consumer Surveys

Page 3: Tools for Google Data

Searches for [hangover]

Which day of the week are there the most searches for [hangover]?

1: Sunday

2: Monday

3: Tuesday

4: Wednesday

5: Thursday

6: Friday

7: Saturday

Page 4: Tools for Google Data

Search index for [hangover]

Page 5: Tools for Google Data

Hangover geo

Page 6: Tools for Google Data

Hangover-vodka time series

Page 7: Tools for Google Data

Searches for [civil war]

Page 8: Tools for Google Data

Searches for [term paper]

Page 9: Tools for Google Data

Gift for boyfriend v Gift for girlfriend

Forboyfriend

For girlfriend

Page 10: Tools for Google Data

Gift for husband v Gift for wife

Forhusband

For wife

Page 11: Tools for Google Data

11

Google Trends

Google Correlate

Google Consumer Surveys

Page 12: Tools for Google Data

Searches correlated with [weight loss]

Page 13: Tools for Google Data

Plot of [weight loss] and [best vacation spots]

New Year

Page 14: Tools for Google Data

Correlated with [weight loss] 3 weeks later

Page 15: Tools for Google Data

15

Unemployment

Page 16: Tools for Google Data

Initial claims: good leading indicator for recessions

Grey bars indicate recessions

Page 17: Tools for Google Data

Google Correlate with initial claims data

Page 18: Tools for Google Data

Initial claims and [unemployment filing]

Page 19: Tools for Google Data

Regression models

Baseline model yt = a yt-1 + c + et gives an in-sample MAE of 3.1%

Adding the “filing for unemployment” query yt = a yt-1 + b qt + c + et gives an in-sample MAE of 3.0%

Train using t weeks, forecast t+1 (rolling window forecast)MAE of baseline = 3.2%, MAE with query = 3.2%, 0% improvement

During recession MAE of baseline = 3.7%, MAE with query = 3.3%, 8.7% improvement

Page 20: Tools for Google Data

Weekly pattern for [unemployment office]

Page 21: Tools for Google Data

Gun sales

Page 22: Tools for Google Data

FBI gun sales background check

Page 23: Tools for Google Data

NICS time series

[stack on] has highest raw correlation[gun shops] is chosen by statistical model

Page 24: Tools for Google Data

Trend

Page 25: Tools for Google Data

Seasonal

Page 26: Tools for Google Data

[gun shops]

Page 27: Tools for Google Data

Searches on [gun shop]

Page 28: Tools for Google Data

28

Google Trends

Google Correlate

Google Consumer Surveys

Page 29: Tools for Google Data

29

How it works

Page 30: Tools for Google Data

30

Page 31: Tools for Google Data

31

Page 32: Tools for Google Data

32

Page 33: Tools for Google Data

33

b

Page 34: Tools for Google Data

34

How this changes surveys

Anyone can do them

The cost is dramatically lower

Results come back in a few hours

Surveys can be replicated … or not

You can measure sensitivity wording

Page 35: Tools for Google Data

35

Consumer Sentiment

Page 36: Tools for Google Data

Consumer sentiment and retail sales

Page 37: Tools for Google Data

Methodology

Time series = trend + seasonal + regression + error

Find the best predictors for regression

Fat regression problem (aka p > n)

Sometimes get good fit by chance alone

Want predictors that work out of sample

Does regression provide incremental value over trend+seasonal?

Page 38: Tools for Google Data

BSTS: Bayesian Structural Time Series

Estimating time series: use Kalman filter techniquesExpress time series as trend + seasonal + noise (“basic structural model”)

Forecast univariate model using Kalman filter

Advantages: flexibility, adaptive, interpretable, handles non-stationarity well

Model selection using “spike and slab” Bayesian regressionSpike: prior probability that coefficient is included in regression

Slab: diffuse prior for coefficient, conditional on inclusion

Estimate a posterior probability that variable is in model

Combines well with Kalman techniques

Final forecast is weighted average of many models, with weights given by posterior probabilities (Bayesian model averaging)

Example of “ensemble estimation”

Agnostic with respect to “true model”

Tends to avoid overfitting by avoiding choice of “best” single model

Page 39: Tools for Google Data

Probability of inclusion of predictor (n=98, k= 195)

White: procyclicalBlack: countercyclical

Page 40: Tools for Google Data

Start with “trend”

Page 41: Tools for Google Data

Start with “trend”

Page 42: Tools for Google Data

Add “financial planning”

Page 43: Tools for Google Data

Add “Investing”

Page 44: Tools for Google Data

Add “Business News”

Page 45: Tools for Google Data

Add “Search Engines”

Page 46: Tools for Google Data

Add Energy and Utilities

Page 47: Tools for Google Data

Challenges for the future

Private sector has high-frequency, real time data and a lot of it!

Visa, Mastercard, American Express

UPS and FedEx

Wal-Mart, Target, etc

Supermarket scanner data

Search engines

Government agencies

Long historical series, but usually low frequency

Carefully constructed but labor intensive, with delayed release and periodic revisions

How to combine the public and private data?

How to integrate massive amounts of private sector real-time information with traditional government statistics