## 14. Transportation and Storage: Regression Results

## Source details

**Canonical URL:** [14. Transportation and Storage: Regression Results](https://www.imf.org/-/media/files/publications/wp/2021/english/wpiea2021295-print-pdf.pdf)

## Other formats

- [Markdown version](/-/media/files/publications/wp/2021/english/wpiea2021295-print-pdf.pdf.md)
- [Structured JSON version](/-/media/files/publications/wp/2021/english/wpiea2021295-print-pdf.pdf.json)

---

### I. Motivation
- Policymakers require more frequent, timely and granular economic statistics to monitor daily/near‑real‑time developments and to identify recovery shapes (V, W, U, K).
- Traditional production of official statistics often takes at least 45 to 60 days following the reference period to produce initial readings; many countries produce only annual GDP released 9 to 12 months following the reference period.
- Just over two-thirds of the 190 IMF member countries produce quarterly GDP; the remainder produce annual measures.
- Three core challenges for statistical organizations in leveraging new data sources:
  - (1) acquiring the source data;
  - (2) processing these data;
  - (3) integrating these data with high quality official measures to improve timeliness and frequency.
- Google Places and Google Trends data are presented as potential partial solutions to these challenges.

### II. Source data: Google Places and Google Trends
- Access and terms:
  - Google Places data available via the Google Places API (returns JSON or XML). Uses must comply with Places API Policies and Google Maps Platform Terms of Service.
  - API provides seamless access to over 20 fields of information for each Place; Google’s depreciation policy provides at least one year’s notice of field changes.
  - Fees may apply depending on volume; Google launched an initiative to support nonprofit COVID-19 response efforts with free access for public good applications.
  - Google Trends is a public website (trends.google.com); no charge to use. Google does not provide an official API for Trends but web‑scraping scripts exist. Google documents the methodology for Trends on its website.
- Coverage:
  - Google Places and Google Trends have wide (near census) coverage where Google operates and is unrestricted.
  - Google Places platform contains a near census of Places (businesses, places of interest, government offices), enabling drawing scientific samples and inferring population characteristics.
  - Google Trends offers near worldwide geographic coverage and can calculate trends for individual businesses and products.
- Conceptual alignment summary:
  - Google Places statistical unit = Place ID; aligns with local unit / establishment (alignment: High).
  - Business status field identifies “operational,” “temporarily closed,” or “permanently closed” (alignment: High).
  - Location fields align with territory concept (alignment: High).
  - Atmosphere Data Fields (Reviews, Price Level, Rating, User Ratings Total) potential proxies for size (Reviews: Medium; Rating: Low; Price Level: Low).
  - Google Trends measures interest in topics relative to all other topics over time and can indicate turning points when mapped to business/industry/product demand.
- Google Places fields (listed):
  - Basic Fields: Address Component; Address; Business Status; Formatted Address; Viewport; Location; Icon; Name; Photo; Place ID; Plus Code; Type; URL; UTC Offset; Vicinity.
  - Contact Fields: Phone Number; International Phone Number; Opening Hours; Website.
  - Atmosphere Fields: Price Level; Rating; Reviews; User Ratings Total.
- Google Trends index construction example (exact):
  - Week 1: Total Searches 10000; “Restaurant” Searches 1000; Search Intensity .1; Trends Index 83.
  - Week 2: Total Searches 10000; “Restaurant” Searches 800; Search Intensity .08; Trends Index 67.
  - Week 3: Total Searches 10000; “Restaurant” Searches 900; Search Intensity .09; Trends Index 75.
  - Week 4: Total Searches 10000; “Restaurant” Searches 1200; Search Intensity .12; Trends Index 100.
  - Week 5: Total Searches 15000; “Restaurant” Searches 1200; Search Intensity .8; Trends Index 67.
  - Week 6: Total Searches 12500; “Restaurant” Searches 1000; Search Intensity .8; Trends Index 67.
  - Week 7: Total Searches 10000; “Restaurant” Searches 800; Search Intensity .8; Trends Index 67.
  - Week 8: Total Searches 10000; “Restaurant” Searches 700; Search Intensity .7; Trends Index 58.
  - Week 9: Total Searches 10000; “Restaurant” Searches 600; Search Intensity .6; Trends Index 50.
  - Week 10: Total Searches 10000; “Restaurant” Searches 500; Search Intensity .5; Trends Index 42.

### III. Methods: transforming Google data into economic indicators
- Overview:
  - Goal: process Google Places and Google Trends to produce high-frequency indicators that align with international statistical concepts (e.g., ISIC Rev. 4).
  - Two families of indicators developed: Operating Status Indicators and Business Activity Indicators.

- A. Operating Status Indicators
  - Operational Indicator (weighted by reviews):
    - Definition: share of Places in a geographic region that are operational at a point in time, weighted by number of reviews (reviews used as proxy for relative size).
    - Sampling: API does not permit full census extractions for every region each period; each extraction is treated as a random and representative sample; approach uses repeated representative samples.
    - Worked example (exact):
      - Week 1 sample: Places A 1000 reviews (40% share) Operational; B 500 (20%) Operational; C 500 (20%) Operational; D 100 (4%) Operational; E 400 (16%) Temporarily Closed. Total reviews 2500; Operational Indicator 84.
      - Week 2 sample: F 1000 (37%) Temporarily Closed; G 700 (26%) Operational; H 500 (19%) Operational; I 100 (4%) Operational; J 400 (14%) Operational. Total reviews 2700; Operational Indicator 63.
      - Week 3 sample: F 1000 (33%) Operational; K 700 (24%) Operational; L 500 (17%) Operational; M 400 (13%) Operational; J 400 (13%) Operational. Total reviews 3000; Operational Indicator 100.
      - Week 4 sample: A 1100 (30%) Operational; B 900 (25%) Operational; C 600 (17%) Operational; M 500 (14%) Operational; L 500 (14%) Operational. Total reviews 3600; Operational Indicator 100.
      - Week 5 sample: A 1200 (31%) Operational; K 900 (24%) Operational; L 600 (15%) Closed Permanently; P 600 (15%) Operational; Q 600 (15%) Operational. Total reviews 3900; Operational Indicator 75.
    - Empirical application: Operational indicator constructed for several major city centers for the period April 24, 2020 (baseline) to August 10, 2021. Weighting by reviews increases variability and aligns with timing of COVID-19 waves and lockdown scope by place type.
    - Data extraction window: Data extracted between April 24, 2020 and August 10, 2021.
  - Business Re-opening Indicator:
    - Definition: tracks share of businesses that were temporarily closed in the baseline period that are now open; starts from baseline cohort of temporarily closed Places.
    - Example (exact):
      - Five firms A–E status across Period B and Periods 1–5 (1=open, 2=temporarily closed):
        - A: 2,2,2,2,2,2
        - B: 2,2,2,2,2,1
        - C: 2,2,1,2,1,1
        - D: 2,2,1,1,1,1
        - E: 2,1,1,1,1,1
      - Indicator sequence: 100, 20, 60, 40, 60, 80
    - Empirical application: Re-opening indicator constructed for major city centers from April 24, 2020 baseline (some cities had different baselines) to August 10, 2021. Results reflect differences in government lockdown and exit strategies.
    - Selected city re-opening results (exact entries preserved for each city: sample size, baseline date, series of indicator values):
      - Atlanta: sample size 503; baseline 2-May-20; values: 59, 82.9, 96, 97, 96.8, 97.6, 98.6, 98.8, 99.
      - Bogota: sample size 339; baseline 2-May-20; values: 37.2, 76.4, 76.7, 87.6, 90, 92, 100, 97.9, 94.1.
      - Casablanca: sample size 209; baseline 17-May-20; values: 9.1, 32.5, 40.7, 47.4, 54.5, 60.3, 93.8, 65.1, 67.9.
      - Istanbul: sample size 566; baseline 24-Apr-20; values: 0, 41.7, 64.7, 78.3, 83.6, 83.9, 88.5, 94.9, 88.7, 91.5.
      - Lagos: sample size 180; baseline 24-Apr-20; values: 0, 25, 38.3, 38.9, 53.9, 58.3, 62.8, 98.3, 76.7, 76.1.
      - London: sample size 842; baseline 24-Apr-20; values: 0, 53.4, 84.8, 93.1, 97.1, 80.8, 79, 89.7, 97.9, 98.5.
      - Los Angeles: sample size 1,001; baseline 2-May-20; values: 40, 64, 72.8, 79.1, 82, 88.8, 95, 95, 96.6.
      - Madrid: sample size 1,437; baseline 24-Apr-20; values: 0, 44.6, 75.9, 87.3, 92.3, 92.9, 94.7, 98.3, 95.8, 95.9.
      - Manila: sample size 2,750; baseline 24-Apr-20; values: 0, 41, 70.1, 79.6, 84.6, 88.1, 89.8, 96.6, 92.1, 92.8.
      - Milan: sample size 936; baseline 24-May-20; values: 0, 59.1, 77.1, 84, 81.9, 86.3, 95.8, 92, 90.5.
      - Mumbai: sample size 2,939; baseline 24-Apr-20; values: 0, 45.6, 66, 72.8, 85.7, 92.8, 94.2, 97.2, 93.4, 93.9.
      - New York: sample size 1,278; baseline 24-Apr-20; values: 0, 47.4, 75.7, 84.7, 92.4, 92.3, 94.3, 96.9, 97.2, 97.
      - Paris: sample size 1,645; baseline 24-Apr-20; values: 0, 53.5, 86, 92.5, 87.7, 89.7, 85.6, 87.4, 96.2, 96.9.
      - Rome: sample size 1,343; baseline 17-May-20; values: 25.4, 64.6, 82.7, 88.2, 88.3, 89.4, 97.2, 93.8, 94.6.
      - Sao Paulo: sample size 526; baseline 24-Apr-20; values: 0, 35.6, 64.4, 66.5, 79.7, 84.6, 81.2, 93, 89.7, 89.4.
      - Sydney: sample size 359; baseline 2-May-20; values: 47.4, 84.7, 86.9, 91.6, 94.4, 95.8, 97.2, 76, 74.9.
      - Tel Aviv‑Yaffo: sample size 1,045; baseline 17-May-20; values: 16.2, 62.3, 70.8, 76.3, 77.1, 85.4, 98.7, 94.6, 87.4.
      - Tokyo: sample size 416; baseline 24-Apr-20; values: 0, 51.2, 95, 94.7, 96.6, 96.4, 96.4, 88, 97.6, 97.8.
      - Toronto: sample size 978; baseline 24-Apr-20; values: 0, 42.1, 90.8, 93.4, 94.7, 84.6, 89.9, 87.1, 88.9, 95.9.

- B. Business Activity Indicators
  - Google Reviews as activity proxy:
    - Reviews extracted via Google Places API include number of reviews and average rating (scale 1–5).
    - Adjusted reviews = (average rate / 5) * (number of reviews). Example exact:
      - Place A: Reviews 100; Rating 1; Weighted Rating .2; Adjusted Reviews 20.
      - Place B: Reviews 100; Rating 3; Weighted Rating .6; Adjusted Reviews 60.
      - Place C: Reviews 100; Rating 5; Weighted Rating 1; Adjusted Reviews 100.
    - Reviews are a stock variable (accumulated). Indicator of activity uses change in stock period‑to‑period via matched‑sample month‑to‑month linking to form continuous time series.
    - Matched sample example for Paris beauty salons (exact linked numbers preserved):
      - Matched sample pairs: April–May 1,289 | May–June 1,694 | June–July 1,772 | July–August 1,664.
      - Linked stock of reviews by month: Apr‑20 1,289; May‑20 1,306; Jun‑20 1,344; Jul‑20 1,381; Aug‑20 1,433.
      - Change in reviews by month (exact): 17, 38, 37, 52.
    - Empirical results: monthly review change indicators align with lockdown slowdowns and show the most pronounced slowdowns during the first wave of COVID‑19; subsequent waves show less pronounced slowdowns despite higher case severity.
    - Data extraction window for review activity charts: April 2020 to June 2021.
  - Google Trends as activity proxy:
    - Challenge: millions of possible topics — need to map trends into meaningful aggregates consistent with official classifications (ISIC Rev. 4).
    - Approach: textual matching between Google Trends category/topic terms and ISIC Rev. 4 textual descriptions (construct vector of category/topic terms and match to ISIC class text).
    - Google provides aggregated category algorithms (1000+ trend categories) which constitute a starting point for mapping to ISIC classes.
    - Aggregation by ISIC Rev. 4 enables use of Google Trends in producing high‑frequency indicators aligned with official statistical activity groupings.

### IV. Empirical notes, assumptions, and limitations
- Key assumptions:
  - Google Places platform has near census coverage where Google operates.
  - Number of reviews is a reasonable proxy for relative size/popularity of consumer‑facing establishments (assumption less valid for non‑consumer‑facing businesses).
  - Average reviews per visitor is constant over time (implicit assumption for reviews-based activity proxy).
  - Google Trends interest correlates with business activity when topics correspond to businesses, industries, or products.
- Limitations:
  - Google Places API does not allow full census extraction each period; samples are used and matched samples are required to form continuous series.
  - Historical Places data are limited, constraining the construction of long time series of reviews.
  - Conceptual misalignment risk between big data signals and official statistical concepts requires modeling and “second best” mapping where necessary.
  - Use cases most applicable to consumer-facing establishments; non‑consumer sectors may require register or survey adjustments.

### Box 1. Methodology: mapping Google Trends to ISIC
- NLP method: word2vec (score Google Trends category/topic description against ISIC 4-digit industry class description).
- Retain any Google Trends category matched to an ISIC industry within threshold; aggregate matched categories by simple average.
- At ISIC 4-digit level average Google Trends SVIs of all matched categories; at ISIC section level average SVIs of matched categories to ISIC 4-digit removing duplicate categories.

- Aggregation examples and exact SVI series (Australia, selected ISIC 4-digit and section):
  - ISIC 5610 — Total 5610 Average SVIs: 80.0, 74.0, 73.0, 82.0, 77.5 (months Jan-21 to May-21).
  - ISIC 5629 — Total 5629 Average SVIs: 86.5, 80.0, 79.5, 88.5, 85.5.
  - ISIC 5630 — Total 5630 Average SVIs: 90.3, 83.3, 79.7, 90.0, 91.7.
  - ISIC Section total (Accommodation and food service activities) Total Average SVIs by month: 86.2, 79.6, 77, 86.8, 86.

- Data processing and smoothing:
  - A 5-year moving interval is used.
  - Weekly trends smoothed using a five-week moving average.
  - Monthly and quarterly series derived by averaging weekly series for the month or quarter.
  - Consideration of lag effects is series-specific.

### Regression nowcasting: Transportation and Storage (H)
- Nowcasting model:
  - Regression in logs, no lags, plus constant. Seasonally adjusted data. Period: 2015-Q4-2020-Q3.
  - Variables: TRE-H (Google Trends for Transportation and Storage), REOP (reopening indicator dummy available only for 2020-Q2, 2020-Q3, and 2020-Q4).
- Regression results (exact table entries: R2 | TRE-H Coeff. t-stat | REOP Coeff. t-stat):
  - Australia: R2 0.83; TRE-H Coeff. 0.43 t-stat 3.22**; REOP Coeff. 0.19 t-stat 2.43**
  - Brazil: R2 0.91; TRE-H Coeff. 0.10 t-stat 2.21**; REOP Coeff. 0.30 t-stat 13.20**
  - Canada: R2 0.88; TRE-H Coeff. 0.89 t-stat 5.57**; REOP Coeff. 0.38 t-stat 6.44**
  - France: R2 0.92; TRE-H Coeff. 0.25 t-stat 2.15**; REOP Coeff. 0.48 t-stat 7.28**
  - Philippines: R2 0.95; TRE-H Coeff. 0.45 t-stat 6.40**; REOP Coeff. 1.28 t-stat 15.96**
  - South Africa: R2 0.92; TRE-H Coeff. 0.25 t-stat 2.47**; REOP Coeff. 0.34 t-stat 8.90**
- Interpretation:
  - Model fitting is very good for all countries, with an R2 above 80 percent.
  - Coefficients for both indicators are positive and statistically significant.
  - The reopening indicator (REOP) closely matches the fall and subsequent rebound in official data for the pandemic period.
- Nowcast performance:
  - Regression models produced nowcasts for 2020-Q2 and 2020-Q3 that accurately captured the large drop in 2020-Q2 and adequately anticipated the recovery in 2020-Q3.
  - Advantage: Google data from Trends and Places API are available in real-time, so nowcasts could have been produced a few days after the end of each quarter.

### Conclusions and policy recommendations
- The pandemic highlighted the need to use nontraditional data to prepare more timely and detailed economic indicators.
- Google data advantages:
  - Long and high-frequency time series that help understand turning points.
  - Easily accessible in all countries (Google Trends publicly available at no cost; Places API available for a small fee relative to survey costs).
- Recommended uses and next steps:
  - Combine and benchmark Google-based indicators with official measures to improve timeliness and frequency of preliminary estimates.
  - Test and validate quality of these indicators against official high-frequency indicators (industrial production indexes, retail sales, VAT indicators).
  - Countries with significant lags in quarterly national accounts production may test these indicators to release early estimates of quarterly GDP.
  - Countries producing only annual GDP may use these indicators to produce sub-annual experimental estimates for selected sectors.
  - Encourage countries to develop experimental high-frequency indicators using the methodology; the technical annex and the R package provided with the paper can reproduce the step-by-step procedure.
  - If indicators show accurate and robust results vis‑à‑vis traditional data, consider publishing experimental products to provide faster signals on the status of the economy.
  - Invest resources to develop innovative statistical products based on nontraditional sources to be better equipped for future economic turbulence.

### Annex I. Technical Aspects of Google Trends and Google Places API (key points)
- Google Places API: definitions, sampling design, IMF sample of 24 cities (initially 13 listed), query approach (up to 60 responses via concatenating 3 queries of 20), frequency of collection (weekly/bi-weekly early in pandemic, then monthly on last day), variables collected (Basic, Contact, Atmosphere Fields), business status variable.
- Cost notes:
  - By signing up and setting up a billing account, each user receives $300 in credits (~170K queries).
  - Calculated cost example for study: each collection cost $300 (60 establishments by 96 types by 24 cities at $.0017 per query is $235).
  - Note: Google updated terms and conditions (as of April 2021) charging $.032 per call.
- Data processing highlights:
  - Tools: googleway package in R.
  - De-duplication of (place_id, type) pairs; geographic filtering using lat/lng bounds with approximation 1 degree ≈ 110 km.
  - Imputation for missing periods and ISIC class assignment.
- Google Trends collection:
  - Queried weekly data for the past 5 years at category level using gtrendsR.
  - Query rate limitation: approximately one country every 24 hours for same IP.
  - Default outputs: Trends, Related Topics and Related Queries; main measure SVI.
- Linking Trends categories to ISIC (algorithm overview):
  - Build hierarchies; concatenate hierarchy elements into sentences; transform text into 50-d GloVe embeddings; compute distances; keep closest 5 categories per ISIC 4-digit; custom weighted score filters requiring sum_dist_w >= 4 and count_dist_w >= 3 with weights Complete=3, Top=2, Bottom=1.
  - Example computations provided (e.g., sum_dist_w = 3*0.863 + 2*0.922 + 1*0.736 = 4.984; count_dist_w = 3*1 + 2*1 + 1*0 = 4).
- From weekly Trends to monthly ISIC indicators:
  - Monthly SVIs = average of weekly SVIs; ISIC 4-digit monthly SVI = average of monthly SVIs for matched categories; ISIC section monthly SVI = average of monthly SVIs for all unique categories mapped to section.
- Bias and noise reduction:
  - Bottom-up aggregation of categories to ISIC section reduces noise; multiple weekly samples averaged to reduce variance.
- Chaining and rescaling SVI series:
  - Rescaling needs to be multiplicative per Woloszko (2020); practical solution: multiply SVI_b by mean of ratio SVI_a/SVI_b over common observations.

### Annex II. Data and Methods with the imfgoogle R Package (key points)
- Installation example (exact):
  - install.packages("C:/R/R-3.6.3/library/imfgoogle_0.1.0.tar.gz", repos = NULL, type="source")
  - library(imfgoogle)
- Included datasets (examples preserved):
  - Trends_categories_codes_full_hierarchy
  - ISIC_4d_full_hierarchy
  - Google_Places_types_ISIC_NAICS
  - mapping_isic4d_trendsCategories
  - match_Trends_categories_ISIC_products
  - cities_places
- Implemented functions and parameters (exact defaults/preserved values):
  - biz_status_places(..., city_pop_limit = 1e+06, sample_freq = "month", write_out = TRUE)
  - biz_reopening_places(..., exclude_periods = c("2020-06-29"), longitudinal = FALSE, groupby_var = "city", method = "reopening", interpolate = FALSE, min_sample_size = 50, write_out = TRUE)
  - biz_reviews_places(..., city_pop_limit = 1e+06, sample_freq = "month", write_out = TRUE)
  - biz_activity_trends(..., only_interest = FALSE, time_span = "today+5-y", write_out = TRUE)
  - match_categ_trends defaults: refresh = FALSE, dist_threshold = 0.8, custom_dist_threshold = 0.85, removeDup = FALSE, keepTop_n = 5, weight_score = 4, count_score = 3
- Examples of output formats and columns are provided in the package documentation and the technical annex.

*Source: Extracted from wpiea2021295-print-pdf (chapter/section: 14. Transportation and Storage: Regression Results) — Google Places API and Google Trends methods and indicators, data extracted April 24, 2020 to August 10, 2021.*

### REFERENCES..............................................................................................................

### wpiea2021295-print-pdf - REFERENCES..............................................................................................................

### Box
- 1. Textual Description of the Manufacture of Consumer Electronics Industry .....................22

### Figures
- 1. Google Trend “Flights” - Can ad a...................................................................................12
- 2. Google Trends: Demand for Ford Escape - Canada ........................................................14
- 3. Operating Indicator (weighted by reviews) for Selected City Centers ..............................16
- 4. Business Re-opening Indicator for Selected City Centers................................................18
- 5. Review Activity Indicator .............................................................................................21
- 6. Change in Google Trends Compared to Change in Real Quarterly GDP ..........................25
- 7. Transportation and Storage: Comparison between Of ficial Data (GDP-H), Google Trends (TRE-H), and Reopening Indicator (REOP) for Selected Countries ....................................27
- 8. Transportation and Storage: Nowcasts for 2020-Q2 and 2020-Q3 ...................................29

### Tables
- 1. Fields of Information that can be Extracted for Each Place using Google Places API.........9
- 2. Statistical Concept: Units ..............................................................................................10
- 3. Statistical Concept: Operating Status .............................................................................11
- 4. Statistical Concept: Territory .........................................................................................11
- 5. Statistical Concept: Size ................................................................................................12
- 6. Construction of Google Trends Index: Example .............................................................12
- 7. Search Topics Related to Consumer Electronics for Australia .........................................13
- 8. Construction of Operational Indicator-Example..............................................................15
- 9. Reopening Indicator ......................................................................................................17
- 10. Indicator of  Business Activity Using Reviews ..............................................................19
- 11. Stock / Change in Reviews –   Paris City Center Beauty Salons ......................................20
- 12. Monthly Google Trends SVIs at ISIC 4-digit level for Accommodation and Food Service Activities (I) for Australia .................................................................................................23
- 13. Monthly Google Trends SVIs at ISIC Section Level for Accommodation and Food Service Activities (I) for Australia .....................................................................................24

*Source: wpiea2021295-print-pdf - REFERENCES..............................................................................................................*

### 14. Transportation and Storage: Regression Results ...........................................................28

### 14. Transportation and Storage: Regression Results

### I. Motivation
- Policymakers require more frequent, timely and granular economic statistics to monitor daily/near‑real‑time developments and to identify recovery shapes (V, W, U, K).
- Traditional production of official statistics often takes at least 45 to 60 days following the reference period to produce initial readings; many countries produce only annual GDP released 9 to 12 months following the reference period.
- Just over two-thirds of the 190 IMF member countries produce quarterly GDP; the remainder produce annual measures.
- Three core challenges for statistical organizations in leveraging new data sources:
  - (1) acquiring the source data;
  - (2) processing these data;
  - (3) integrating these data with high quality official measures to improve timeliness and frequency.
- Google Places and Google Trends data are presented as potential partial solutions to these challenges.

### II. Source data: Google Places and Google Trends
- Access and terms:
  - Google Places data available via the Google Places API (returns JSON or XML). Uses must comply with Places API Policies and Google Maps Platform Terms of Service.
  - API provides seamless access to over 20 fields of information for each Place; Google’s depreciation policy provides at least one year’s notice of field changes.
  - Fees may apply depending on volume; Google launched an initiative to support nonprofit COVID-19 response efforts with free access for public good applications.
  - Google Trends is a public website (trends.google.com); no charge to use. Google does not provide an official API for Trends but web‑scraping scripts exist. Google documents the methodology for Trends on its website.
- Coverage:
  - Google Places and Google Trends have wide (near census) coverage where Google operates and is unrestricted.
  - Google Places platform contains a near census of Places (businesses, places of interest, government offices), enabling drawing scientific samples and inferring population characteristics.
  - Google Trends offers near worldwide geographic coverage and can calculate trends for individual businesses and products.
- Conceptual alignment summary:
  - Google Places statistical unit = Place ID; Google Place aligns with statistical concept of a local unit / establishment (subjective degree of alignment: High).
  - Google Places business status field identifies “operational,” “temporarily closed,” or “permanently closed” — aligns with statistical concepts of “births”/“deaths” and capacity (alignment: High).
  - Google Places provides longitude/latitude and address — aligns with territory concept (alignment: High).
  - Google Places “Atmosphere Data Fields” include Reviews, Price Level, Rating, User Ratings Total - potential proxies for size (Reviews: Medium alignment; Rating: Low; Price Level: Low).
  - Google Trends measures interest in topics relative to all other topics over time; trends can indicate economic turning points when topics map to business, industry, or product demand.

- Google Places fields (listed in source):
  - Basic Fields: Address Component; Address; Business Status; Formatted Address; Viewport; Location; Icon; Name; Photo; Place ID; Plus Code; Type; URL; UTC Offset; Vicinity.
  - Contact Fields: Phone Number; International Phone Number; Opening Hours; Website.
  - Atmosphere Fields: Price Level; Rating; Reviews; User Ratings Total.
- Google Trends index construction example (preserve exact figures from example):
  - Week 1: Total Searches 10000; “Restaurant” Searches 1000; Search Intensity .1; Trends Index 83.
  - Week 2: Total Searches 10000; “Restaurant” Searches 800; Search Intensity .08; Trends Index 67.
  - Week 3: Total Searches 10000; “Restaurant” Searches 900; Search Intensity .09; Trends Index 75.
  - Week 4: Total Searches 10000; “Restaurant” Searches 1200; Search Intensity .12; Trends Index 100.
  - Week 5: Total Searches 15000; “Restaurant” Searches 1200; Search Intensity .8; Trends Index 67.
  - Week 6: Total Searches 12500; “Restaurant” Searches 1000; Search Intensity .8; Trends Index 67.
  - Week 7: Total Searches 10000; “Restaurant” Searches 800; Search Intensity .8; Trends Index 67.
  - Week 8: Total Searches 10000; “Restaurant” Searches 700; Search Intensity .7; Trends Index 58.
  - Week 9: Total Searches 10000; “Restaurant” Searches 600; Search Intensity .6; Trends Index 50.
  - Week 10: Total Searches 10000; “Restaurant” Searches 500; Search Intensity .5; Trends Index 42.

### III. Methods: transforming Google data into economic indicators
- Overview:
  - Goal: process Google Places and Google Trends to produce high-frequency indicators that align with international statistical concepts (e.g., ISIC Rev. 4).
  - Two families of indicators developed: Operating Status Indicators and Business Activity Indicators.

- A. Operating Status Indicators
  - Operational Indicator (weighted by reviews):
    - Definition: share of Places in a geographic region that are operational at a point in time, weighted by number of reviews (reviews used as proxy for relative size).
    - Sampling: API does not permit full census extractions for every region each period; each extraction is treated as a random and representative sample; approach uses repeated representative samples.
    - Worked example (exact numbers preserved):
      - Week 1 sample: Places A 1000 reviews (40% share) Operational; B 500 (20%) Operational; C 500 (20%) Operational; D 100 (4%) Operational; E 400 (16%) Temporarily Closed. Total reviews 2500; Operational Indicator 84.
      - Week 2 sample: F 1000 (37%) Temporarily Closed; G 700 (26%) Operational; H 500 (19%) Operational; I 100 (4%) Operational; J 400 (14%) Operational. Total reviews 2700; Operational Indicator 63.
      - Week 3 sample: F 1000 (33%) Operational; K 700 (24%) Operational; L 500 (17%) Operational; M 400 (13%) Operational; J 400 (13%) Operational. Total reviews 3000; Operational Indicator 100.
      - Week 4 sample: A 1100 (30%) Operational; B 900 (25%) Operational; C 600 (17%) Operational; M 500 (14%) Operational; L 500 (14%) Operational. Total reviews 3600; Operational Indicator 100.
      - Week 5 sample: A 1200 (31%) Operational; K 900 (24%) Operational; L 600 (15%) Closed Permanently; P 600 (15%) Operational; Q 600 (15%) Operational. Total reviews 3900; Operational Indicator 75.
    - Empirical application: Operational indicator constructed for several major city centers for the period April 24, 2020 (baseline) to August 10, 2021. Weighting by reviews increases variability and aligns with timing of COVID-19 waves and lockdown scope by place type.
    - Data extraction window noted: Data extracted between April 24, 2020 and August 10, 2021.
  - Business Re-opening Indicator:
    - Definition: tracks share of businesses that were temporarily closed in the baseline period that are now open; starts from baseline cohort of temporarily closed Places.
    - Example (exact table preserved):
      - Five firms A–E status across Period B and Periods 1–5 (1=open, 2=temporarily closed):
        - A: 2,2,2,2,2,2
        - B: 2,2,2,2,2,1
        - C: 2,2,1,2,1,1
        - D: 2,2,1,1,1,1
        - E: 2,1,1,1,1,1
      - Indicator sequence: 100, 20, 60, 40, 60, 80
    - Empirical application: Re-opening indicator constructed for major city centers from April 24, 2020 baseline (some cities had different baselines) to August 10, 2021. Results reflect differences in government lockdown and exit strategies.
    - Selected city re-opening results (preserve exact table entries):
      - Atlanta: sample size 503; baseline 2-May-20; values (24-Apr-20 baseline listed as date field in header) — listed indicator values across dates: 59, 82.9, 96, 97, 96.8, 97.6, 98.6, 98.8, 99.
      - Bogota: sample size 339; baseline 2-May-20; values: 37.2, 76.4, 76.7, 87.6, 90, 92, 100, 97.9, 94.1.
      - Casablanca: sample size 209; baseline 17-May-20; values: 9.1, 32.5, 40.7, 47.4, 54.5, 60.3, 93.8, 65.1, 67.9.
      - Istanbul: sample size 566; baseline 24-Apr-20; values: 0, 41.7, 64.7, 78.3, 83.6, 83.9, 88.5, 94.9, 88.7, 91.5.
      - Lagos: sample size 180; baseline 24-Apr-20; values: 0, 25, 38.3, 38.9, 53.9, 58.3, 62.8, 98.3, 76.7, 76.1.
      - London: sample size 842; baseline 24-Apr-20; values: 0, 53.4, 84.8, 93.1, 97.1, 80.8, 79, 89.7, 97.9, 98.5.
      - Los Angeles: sample size 1,001; baseline 2-May-20; values: 40, 64, 72.8, 79.1, 82, 88.8, 95, 95, 96.6.
      - Madrid: sample size 1,437; baseline 24-Apr-20; values: 0, 44.6, 75.9, 87.3, 92.3, 92.9, 94.7, 98.3, 95.8, 95.9.
      - Manila: sample size 2,750; baseline 24-Apr-20; values: 0, 41, 70.1, 79.6, 84.6, 88.1, 89.8, 96.6, 92.1, 92.8.
      - Milan: sample size 936; baseline 24-May-20; values: 0, 59.1, 77.1, 84, 81.9, 86.3, 95.8, 92, 90.5.
      - Mumbai: sample size 2,939; baseline 24-Apr-20; values: 0, 45.6, 66, 72.8, 85.7, 92.8, 94.2, 97.2, 93.4, 93.9.
      - New York: sample size 1,278; baseline 24-Apr-20; values: 0, 47.4, 75.7, 84.7, 92.4, 92.3, 94.3, 96.9, 97.2, 97.
      - Paris: sample size 1,645; baseline 24-Apr-20; values: 0, 53.5, 86, 92.5, 87.7, 89.7, 85.6, 87.4, 96.2, 96.9.
      - Rome: sample size 1,343; baseline 17-May-20; values: 25.4, 64.6, 82.7, 88.2, 88.3, 89.4, 97.2, 93.8, 94.6.
      - Sao Paulo: sample size 526; baseline 24-Apr-20; values: 0, 35.6, 64.4, 66.5, 79.7, 84.6, 81.2, 93, 89.7, 89.4.
      - Sydney: sample size 359; baseline 2-May-20; values: 47.4, 84.7, 86.9, 91.6, 94.4, 95.8, 97.2, 76, 74.9.
      - Tel Aviv‑Yaffo: sample size 1,045; baseline 17-May-20; values: 16.2, 62.3, 70.8, 76.3, 77.1, 85.4, 98.7, 94.6, 87.4.
      - Tokyo: sample size 416; baseline 24-Apr-20; values: 0, 51.2, 95, 94.7, 96.6, 96.4, 96.4, 88, 97.6, 97.8.
      - Toronto: sample size 978; baseline 24-Apr-20; values: 0, 42.1, 90.8, 93.4, 94.7, 84.6, 89.9, 87.1, 88.9, 95.9.

- B. Business Activity Indicators
  - Google Reviews as activity proxy:
    - Reviews extracted via Google Places API include number of reviews and average rating (scale 1–5).
    - Adjusted reviews = (average rate / 5) * (number of reviews). Example exact table:
      - Place A: Reviews 100; Rating 1; Weighted Rating .2; Adjusted Reviews 20.
      - Place B: Reviews 100; Rating 3; Weighted Rating .6; Adjusted Reviews 60.
      - Place C: Reviews 100; Rating 5; Weighted Rating 1; Adjusted Reviews 100.
    - Reviews are a stock variable (accumulated). Indicator of activity uses change in stock period‑to‑period via matched‑sample month‑to‑month linking to form continuous time series.
    - Matched sample example for Paris beauty salons (exact linked numbers preserved):
      - Matched sample pairs: April–May 1,289 | May–June 1,694 | June–July 1,772 | July–August 1,664.
      - Linked stock of reviews by month: Apr‑20 1,289; May‑20 1,306; Jun‑20 1,344; Jul‑20 1,381; Aug‑20 1,433.
      - Change in reviews by month (exact): 17, 38, 37, 52.
    - Empirical results: monthly review change indicators align with lockdown slowdowns and show the most pronounced slowdowns during the first wave of COVID‑19; subsequent waves show less pronounced slowdowns despite higher case severity.
    - Data extraction window for review activity charts: April 2020 to June 2021.
  - Google Trends as activity proxy:
    - Challenge: millions of possible topics — need to map trends into meaningful aggregates consistent with official classifications (ISIC Rev. 4).
    - Approach: textual matching between Google Trends category/topic terms and ISIC Rev. 4 textual descriptions (construct vector of category/topic terms and match to ISIC class text).
    - Google provides aggregated category algorithms (1000+ trend categories) which constitute a starting point for mapping to ISIC classes.
    - Aggregation by ISIC Rev. 4 enables use of Google Trends in producing high‑frequency indicators aligned with official statistical activity groupings.

### IV. Empirical notes, assumptions, and limitations (as described)
- Key assumptions:
  - Google Places platform has near census coverage where Google operates.
  - Number of reviews is a reasonable proxy for relative size/popularity of consumer‑facing establishments (assumption less valid for non‑consumer‑facing businesses).
  - Average reviews per visitor is constant over time (implicit assumption for reviews-based activity proxy).
  - Google Trends interest correlates with business activity when topics correspond to businesses, industries, or products.
- Limitations:
  - Google Places API does not allow full census extraction each period; samples are used and matched samples are required to form continuous series.
  - Historical Places data are limited, constraining the construction of long time series of reviews.
  - Conceptual misalignment risk between big data signals and official statistical concepts requires modeling and “second best” mapping where necessary.
  - Use cases most applicable to consumer-facing establishments; non‑consumer sectors may require register or survey adjustments.

*Italic source: Extracted from wpiea2021295-print-pdf (chapter/section: 14. Transportation and Storage: Regression Results) — Google Places API and Google Trends methods and indicators, data extracted April 24, 2020 to August 10, 2021.*

### Box 1. Textual Description  of the Manufacture of Consumer

### Box 1. Textual Description of the Manufacture of Consumer Electronics Industry

### Methodology: mapping Google Trends to ISIC
- The method chosen was the natural language processing (NLP) library word2vec that scores the Google Trends category / topic description against the ISIC industry class description (at the 4-digit level).
- Any Google Trends category that matched to an ISIC industry within a given threshold is retained.
- The Google Trends by category are then aggregated using a simple average to the ISIC class.
- At ISIC 4-digit level we take the average Google Trends SVIs of all matched categories.
- At ISIC section level we take the average Google Trends SVIs of all matched categories to ISIC 4-digit removing duplicate categories to keep a simple average.

### Aggregation examples and exact SVI series (Australia, selected ISIC 4-digit and section)
- ISIC 5610 (Accommodation and food service activities; Food and beverage service activities; Restaurants and mobile food service activities)
  - Trends category Fast Food: 918 — Jan-21 90.0, Feb-21 82.0, Mar-21 85.0, Apr-21 91.0, May-21 87.0
  - Trends category Grocery & Food Retailers: 121 — Jan-21 70.0, Feb-21 66.0, Mar-21 61.0, Apr-21 73.0, May-21 68.0
  - Trends category Restaurant Supply: 816 — did not return data for Australia for this instance (listed but missing)
  - Total 5610 Average SVIs: 80.0, 74.0, 73.0, 82.0, 77.5
- ISIC 5629 (Accommodation and food service activities; Food and beverage service activities; Event catering and other food service activities; Other food service activities)
  - Trends category Fast Food: 918 — Jan-21 90.0, Feb-21 82.0, Mar-21 85.0, Apr-21 91.0, May-21 87.0
  - Trends category Food & Drink: 71 — Jan-21 83.0, Feb-21 78.0, Mar-21 74.0, Apr-21 86.0, May-21 84.0
  - Total 5629 Average SVIs: 86.5, 80.0, 79.5, 88.5, 85.5
- ISIC 5630 (Accommodation and food service activities; Food and beverage service activities; Beverage serving activities)
  - Trends category Coffee & Tea: 916 — Jan-21 92.0, Feb-21 83.0, Mar-21 82.0, Apr-21 93.0, May-21 97.0
  - Trends category Non-Alcoholic Beverages: 560 — Jan-21 96.0, Feb-21 89.0, Mar-21 83.0, Apr-21 91.0, May-21 94.0
  - Trends category Food & Drink: 71 — Jan-21 83.0, Feb-21 78.0, Mar-21 74.0, Apr-21 86.0, May-21 84.0
  - Total 5630 Average SVIs: 90.3, 83.3, 79.7, 90.0, 91.7
- ISIC Section total (Accommodation and food service activities) Total Average SVIs by month: 86.2, 79.6, 77, 86.8, 86

### Data processing, smoothing, and temporal considerations
- A 5-year moving interval is used to account for many influencing factors on search intensity.
- Weekly trends are smoothed using a five-week moving average.
- To derive monthly and quarterly series the weekly series was averaged for the month or quarter.
- Many series exhibit lag effects; for certain series (e.g., travel-type series where vacation interest precedes the trip) consideration should be given to lagging the series. This needs to be done on a case-by-case basis.
- The emphasis of the series is generally on the current period, while a long time series is required to establish relationships and models with existing official measures.

### Nowcasting application: sample, approach, and findings
- Sample: six countries with availability of quarterly GDP data by economic activity — Australia, Brazil, Canada, France, the Philippines, and South Africa.
- Period considered for the exercise: 2015-Q4 to 2020-Q3 (to match the five-year span available for the Trends series by ISIC).
- All data were used in seasonally adjusted form.
- Analysis performed: correlation analysis at the 1-digit ISIC level between Google Trends series and quarterly Gross Value Added (GVA) by economic activity over the last five years.
- Correlation findings:
  - Positive (contemporaneous) correlations were found for many ISIC sections in the service industry for most countries, most notably Transportation and Storage (H), Accommodation and Food Services activities (I), Professional, Scientific, and Technical activities (M), Arts, Entertainment and Recreation (R).
  - With few exceptions, correlation for industrial activities and the primary sector was substantially lower.
  - Correlation for Transportation and Storage (H) was strikingly consistent across countries.

### Regression nowcasting: Transportation and Storage (H)
- Model: regression in logs, no lags, plus constant. Seasonally adjusted data. Period: 2015-Q4-2020-Q3.
- Variables: TRE-H (Google Trends for Transportation and Storage), REOP (reopening indicator dummy available only for 2020-Q2, 2020-Q3, and 2020-Q4).
- Regression results (Model for GDP-H; columns: R2 | TRE-H Coeff. t-stat | REOP Coeff. t-stat):
  - Australia: R2 0.83; TRE-H Coeff. 0.43 t-stat 3.22**; REOP Coeff. 0.19 t-stat 2.43**
  - Brazil: R2 0.91; TRE-H Coeff. 0.10 t-stat 2.21**; REOP Coeff. 0.30 t-stat 13.20**
  - Canada: R2 0.88; TRE-H Coeff. 0.89 t-stat 5.57**; REOP Coeff. 0.38 t-stat 6.44**
  - France: R2 0.92; TRE-H Coeff. 0.25 t-stat 2.15**; REOP Coeff. 0.48 t-stat 7.28**
  - Philippines: R2 0.95; TRE-H Coeff. 0.45 t-stat 6.40**; REOP Coeff. 1.28 t-stat 15.96**
  - South Africa: R2 0.92; TRE-H Coeff. 0.25 t-stat 2.47**; REOP Coeff. 0.34 t-stat 8.90**
- Interpretation:
  - Model fitting is very good for all countries, with an R2 above 80 percent.
  - Coefficients for both indicators are positive and statistically significant.
  - The reopening indicator (REOP) closely matches the fall and subsequent rebound in official data for the pandemic period.
- Nowcast performance:
  - Regression models produced nowcasts for 2020-Q2 and 2020-Q3 that accurately captured the large drop in 2020-Q2 and adequately anticipated the recovery in 2020-Q3.
  - Advantage: Google data from Trends and Places API are available in real-time, so nowcasts could have been produced a few days after the end of each quarter.

### Conclusions and policy recommendations
- The pandemic highlighted the need to use nontraditional data to prepare more timely and detailed economic indicators.
- Google data advantages:
  - Long and high-frequency time series that help understand turning points.
  - Easily accessible in all countries (Google Trends publicly available at no cost; Places API available for a small fee relative to survey costs).
- Recommended uses and next steps:
  - Combine and benchmark Google-based indicators with official measures to improve timeliness and frequency of preliminary estimates.
  - Test and validate quality of these indicators against official high-frequency indicators (industrial production indexes, retail sales, VAT indicators).
  - Countries with significant lags in quarterly national accounts production may test these indicators to release early estimates of quarterly GDP.
  - Countries producing only annual GDP may use these indicators to produce sub-annual experimental estimates for selected sectors.
  - Encourage countries to develop experimental high-frequency indicators using the methodology; the technical annex and the R package provided with the paper can reproduce the step-by-step procedure.
  - If indicators show accurate and robust results vis-à-vis traditional data, consider publishing experimental products to provide faster signals on the status of the economy.
  - Invest resources to develop innovative statistical products based on nontraditional sources to be better equipped for future economic turbulence.

*Source: Author’s estimates.*

### Annex I. Technical Aspects  of Google Trends and Google Places  API

### Annex I. Technical Aspects  of Google Trends and Google Places  API

### Google Maps Platform (Google Places API) — Overview and Data collection
- Google Places API returns information about “Places” defined as establishments, geographic locations, or prominent points of interest via HTTP requests.
- IMF Staff selected a sample of 24 cities (initially 13: Bogota, Istanbul, Lagos, London, Madrid, Manila, Mumbai, New York, Paris, Sao Paulo, Sydney, Tokyo, Toronto) representing the world’s major geographical areas and most affected by the COVID-19 lockdowns.
- Sampling design:
  - Initial sample of n (<= 60) establishments for each Places Type by distance from the center of the city.
  - For most “Places Types” the number of sample units was less than 60 (n < 60).
  - Some businesses have multiple types; final sample size n for certain types could be > 60 but was limited to 60 for operational reasons.
- Query approach per city and type:
  - IMF staff queried the Google Places API 3 times (60 max responses concatenating 20 max responses per individual query) using search term = type and latitudes and longitudes of the city center.
  - Query pseudocode:
    - sstring = gsub("_"," ",t),
    - lat = y,
    - lon = x,
    - type = t,
    - num_iter = round(cat_sample_size/20)
- Frequency of collection:
  - At the beginning of the pandemic IMF staff took weekly / bi-weekly samples.
  - Since lockdowns have subsided, data are now being collected once per month on the last day of the month.
- Variables collected each cycle:
  - Basic Fields: Address Component; Address; Business Status; Formatted Address; Viewport; Location; Icon; Name; Photo; Place ID; Plus Code; Type; URL; UTC Offset; Vicinity
  - Contact Fields: Phone Number; International Phone Number; Opening Hours; Website
  - Atmosphere Fields: Price Level; Rating; Reviews; User Ratings Total
- Business status indicator:
  - A key variable collected is Business Status. Google does not provide an explanation of how they maintain this information; Partoo indicates they collect data from many sources to avoid relying exclusively on businesses to update their status.

### Google Places API — Access, costs, and practical notes
- Requirements to use the API:
  - Google account and registration with Google Cloud; create a project and enable the Places API.
  - By signing up and setting up a billing account, each user receives $300 in credits (~170K queries).
- Cost example for this study:
  - Calculated cost: each collection cost $300 (60 establishments by 96 types by 24 cities at $.0017 per query is $235).
  - Note: Google updated terms and conditions (as of April 2021) charging $.032 per call.
- Project funding:
  - Work funded by Google through Google Maps Platform credits for crisis responders.
- Practical caveat:
  - When Google does not find at least 20 establishments from a particular location, it fills the resulting data with places in the vicinity of your IP address (may return results outside specified location and radius).

### Google Places API — Data processing and pre‑processing
- Tools used:
  - IMF staff used the googleway package in R to acquire data from the Google Places API.
- Extracted variables from HTTP request:
  - business status; place_id; name; icon; city; period; type; geometry.location.lat; geometry.location.lng; rating; user_ratings_total; price level.
- De-duplication and geographic filtering:
  - Removed potential duplicates of (place_id, type) pairs.
  - Merged data with city coordinates (world_cities dataset) and filtered for outlying latitudes and longitudes with criteria:
    - lat < lat_city_center + 1 & lat > lat_city_center - 1
    - lng < lng_city_center + 1 & lng > lng_city_center – 1
  - Approximation used: 1 degree of lat/lng ≈ 110 km.
- Additional processing:
  - Imputed for missing periods and assigned an ISIC class.
  - R code for extraction, pre-processing and indicator generation provided in Annex II (imfgoogle R package documentation).

### Google Trends — Data characteristics and collection
- Google Trends provides a largely unfiltered sample of anonymized, categorized, and aggregated search requests; allows interest display from global to city-level geography.
- IMF queried data at the country level using the R package gtrendsR.
- IMF staff queried weekly data for the past 5 years (noting a methodology change around 2016) at the category level as defined by Google.
- Query rate limitation:
  - Limited by number of queries for the same IP: approximately one country every 24 hours.
  - Recommendation: maximize countries returned per day by querying only categories and countries of interest and trying different parameter combinations.
- Default query outputs:
  - Each Google Trends query returns 3 datasets: Trends, Related Topics and Related Queries.
  - Main measure: Search Volume Index (SVI) (for related topics and queries represented in column “subject”).

### Google Trends — Normalization, categories, and keywords
- Google Trends normalization process (per FAQs):
  - Each data point is divided by the total searches of the geography and time range it represents.
  - Resulting numbers are scaled on a range of 0 to 100 based on a topic’s proportion to all searches on all topics.
- Keywords vs. Categories:
  - Keywords (related queries) are granular but may suffer ambiguity and require heavy taxonomy and language work.
  - Categories: hierarchical classification developed by Google; components adjusted to prevent double counting; comparable across countries; translated across languages; constructed using an undisclosed algorithm; preferred for cross-country analysis.
- Related topics:
  - Collection of keyword terms related to a specific term; constructed using an algorithm and reduce keyword ambiguity.
- Sample results layout (fictitious country XX):
  - Interest by category: date, Search Volume Index (SVI), Geo, Time group, category (sample rows shown for early 2016 with SVI values 97, 98, 95, 94, 94).
  - Related topics: Subject, related_topics, value, Geo, category (example values: 100 Top YouTube XX 3; 32 Top Film XX 3; 19 Top MP3 XX 3; 11 Top Gambling XX 3; 11 Top Download XX 3).
  - Related queries: Subject, related_queries, Value, geo, category (examples: 100 Top youtube XX 3; 99 Top youtube XX 3; 24 top mp3 XX 3; 12 top mp3 youtube XX 3; 12 top kristal bet XX 3).

### Linking Google Trends categories and ISIC Rev. 4 products — Algorithm
- Objective: map Google-based taxonomies to ISIC Rev. 4 four-digit products to derive measures of economic activity.
- Steps:
  1. Build hierarchies for ISIC and Google Trends (examples provided).
  2. Concatenate hierarchy elements to build input sentences.
     - Example ISIC sentence: "agriculture forestry fishing crop animal production hunting growing non perennial crops growing sugar cane"
     - Example Google Trends sentence: "business industrial agriculture forestry food production"
  3. Transform text into vectors using pre-trained embeddings space based on GloVe (each word assigned a 50-d vector; each sentence assigned the average of its words’ 50-d vectors).
     - Note: used 50-dimensional vector space learned from the Wikipedia 2014 + Gigaword 5 corpus (6B tokens, 400K vocab, uncased).
  4. Compute Euclidean distance or cosine similarity between sentence vectors to measure similarity.
     - Example distance: Distance("agriculture ... sugar cane", "business industrial agriculture forestry food production") = 0.863
     - Note: higher Distance measure indicates closer match in their convention (Distance of identical sentences = 1).
  5. Compute three embeddings/distances per pair to compensate for hierarchy depth:
     - a) Complete hierarchy
     - b) Top node in the hierarchy (example: Distance("agriculture forestry fishing", "business industrial") = 0.922)
     - c) Bottom element in each hierarchy (example: Distance("growing sugar cane", "food production") = 0.736)
  6. For each ISIC sentence keep the closest 5 Google Trends categories and compute two custom weighted scores to filter matches:
     - Weighted sum of distances (0 <= sum_dist_w =< 6). Keep sum_dist_w >= 4
     - Weighted count of the number of distances > .85 (0 <= count_dist_w =< 6). Keep count_dist_w >= 3
     - Weights assigned to give extra importance to higher nodes:
       - Complete hierarchy weight = 3
       - Top node weight = 2
       - Bottom node weight = 1
     - Example computation:
       - sum_dist_w = 3*0.863 + 2*0.922 + 1*0.736 = 4.984
       - count_dist_w = 3*1 + 2*1 + 1*0 = 4
  7. Matching performed at the 4-digit ISIC Rev. 4 allowed linking ISIC sections (A, B, C, etc.) to combinations of Google Trends categories.

### From weekly Trends to monthly ISIC indicators
- Aggregation rules:
  - Monthly SVIs are calculated as the average of the weekly SVIs for a given category and country.
  - Monthly SVIs for ISIC level 4 is the average of the monthly SVIs for matched categories.
  - Monthly SVIs for ISIC section is the average of the monthly SVIs for all unique categories mapped to this section.
- Outputs produced:
  - Monthly SVIs (hits) at ISIC Rev 4 4-digit and section levels for section Q: Human health and social work activities, from October 2015 to October 2020 (figures referenced).
  - Monthly growth SVIs (hits_growth) at ISIC Rev 4 4-digit and section levels for section Q: Human health and social work activities, from October 2015 to October 2020 (figures referenced).

### Bias and noise reduction
- Rationale:
  - Individual searches may be biased by sentiment; SVIs measure popularity, not sentiment.
  - Google Trends categories aggregate related searches and help reduce sentiment bias.
- Approach to reduce noise:
  - Bottom-up approach combines several categories to produce an estimate at the ISIC section level to reduce noise associated with individual category SVIs.
  - For smaller countries and certain categories, significant sampling noise may persist.
  - Taking multiple samples on a weekly basis and averaging SVIs can reduce variance (as suggested in Woloszko (2020)).

### Chaining and rescaling SVI time series
- Operational questions when updating regularly:
  - Whether to re-query new 5-year data every week for same countries & categories (T-2 weeks overlap) or query shorter windows (e.g., 1 month with 3–4 weeks overlap) at higher frequency and aggregate.
  - Best methods to chain two SVI time series: rescale via difference, ratio, ratio between ranges, multiplicative rescaling, or other methods; whether to rescale entire series or only append new data points.
- Key methodological considerations:
  - Per Woloszko (2020), rescaling needs to be multiplicative. SVI defined as: #searches(“car”)/#searches(all) * const., where const ensures max = 100.
  - Two SVIs covering different time ranges may have different const values; naive rescaling with a single observation ratio is not recommended.
  - Possible practical solution: multiply SVI_b by the mean of the ratio SVI_a/SVI_b taken over all common observations.

*Source: IMF Working Paper — Annex I. Technical Aspects of Google Trends and Google Places API*

### Annex II. Data and Methods with the imfgoogle R Package

### Annex II. Data and Methods with the imfgoogle R Package

### A. Install and load imfgoogle
- Place the binary source package in the R library folder, typically: C:/R/R-3.6.3/library/.
- Example install and load commands:
  - install.packages("C:/R/R-3.6.3/library/imfgoogle_0.1.0.tar.gz", repos = NULL, type="source")
  - library(imfgoogle)

### B. Available datasets (included in the imfgoogle package)
- Load any dataset with:
  - data("name_of_dataset")

- Datasets included and key structure excerpts:
  - Trends_categories_codes_full_hierarchy
    - Description: Google Trends categories with indentation and full hierarchy
    - Example columns and rows shown:
      - category, indentation, categCode, full_categCode
      - All categories: 0, 1, 0, ;0
      - Arts & Entertainment: 3, 2, 3, ;3
      - Celebrities & Entertainment News: 184, 3, 184, ;3;184
      - Comics & Animation: 316, 3, 316, ;3;316
  - ISIC_4d_full_hierarchy
    - Description: ISIC Rev. 4 complete hierarchy
    - Example columns and rows shown:
      - isicCode, Description, indentation, full_isicCode
      - A, Agriculture, forestry and fishing, 2, A
      - 01, Crop and animal production, hunting and related service activities, 3, A;01
      - 011, Growing of non-perennial crops, 4, A;01;011
      - 0111, Growing of cereals (except rice), leguminous crops and oil seeds, 5, A;01;011;0111
  - Google_Places_types_ISIC_NAICS
    - Description: Google Places types matched with ISIC and NAICS products
    - Example rows shown with type, isic_codes, isic_code_label, isic_section:
      - bakery, 1061, 1062 Manufacture of starches and starch products, C
      - roofing_contractor, 4100, 410 4100 Construction of buildings, F
      - plumber, 4322, 4322 Plumbing, heat and air-conditioning installation, F
      - car_dealer, 4530, 453 4530 Sale of motor vehicle parts and accessories, G
  - mapping_isic4d_trendsCategories
    - Description: ISIC Rev. 4 products matched to Google Trends categories (used to compute Google Trends SVIs at ISIC section level)
    - Example columns and rows shown:
      - isicCode, categoryCode, dist_full, dist_top, dist_bottom
      - 0111, 749, 0.8849943, 0.9223012, 0.8423424
      - 0112, 621, 0.8711644, 0.9223012, 0.7637744
      - 0113, 749, 0.8592794, 0.9223012, 0.7195353
      - 0114, 621, 0.8631717, 0.9223012, 0.7358893
  - match_Trends_categories_ISIC_products
    - Description: Distances (cosine similarity) between Google Trends categories and ISIC Rev. 4 products greater or equal than 0.8
    - Example rows shown:
      - category: arts entertainment; isic_product: arts entertainment recreation; dist: 0.9
      - category: arts entertainment; isic_product: arts entertainment recreation creative arts entertainment; dist: 0.985
      - category: arts entertainment; isic_product: arts entertainment recreation libraries archives museums cultural; dist: 0.873
  - cities_places
    - Description: List of select cities used to collect Google Places API

### C. Methods — indicators and procedures implemented in imfgoogle
- Overview: The package implements methods that combine Google Places API data (place status, reviews) and Google Trends SVIs mapped to ISIC Rev. 4 classifications to produce business-dynamics and activity indicators.

- Operating Status Indicators
  - Google Places API provides place operating status: “Open”, “Temporarily Closed”, or “Permanently Closed”.
  - Operational index (share of Places operational in a region, weighted by number of reviews).
  - Function:
    - biz_status_places(
      in_data_path = ".",
      out_data_path = ".",
      file_prefix = "sample_Google_places_",
      city_pop_limit = 1e+06,
      sample_freq = "month",
      write_out = TRUE
      )
  - Example invocation that saves an Excel file:
    - biz_status_places(in_data_path = "C:/Users/<MyUserName>/Box Sync/Google Places API/data/", out_data_path = "<output_directory>")
  - Example excerpt of output (columns preserved):
    - status, city, placetype, period, statuso, statuswo
    - OPERATIONAL, Atlanta, Total, 2020-05 -30, 93.4, 90.6
    - OPERATIONAL, Atlanta, Total, 2020-07 -26, 96.1, 96.5
    - OPERATIONAL, Atlanta, Total, 2020-08 -26, 98.3, 98.1
    - OPERATIONAL, Atlanta, Total, 2020-09 -17, 98.5, 97.5
    - OPERATIONAL, Atlanta, Total, 2020-10 -17, 98.8, 98.6
    - OPERATIONAL, Atlanta, Total, 2020-11 -25, 98.6, 98.4

- Business Re-opening Indicator
  - Tracks path and pace at which temporarily closed businesses re-open.
  - Function:
    - biz_reopening_places(
      in_data_path = ".",
      out_data_path = ".",
      exclude_periods = c("2020-06-29"),
      select_cities = NULL,
      longitudinal = FALSE,
      groupby_var = "city",
      method = "reopening",
      interpolate = FALSE,
      min_sample_size = 50,
      write_out = TRUE
      )
  - Example usage returning a data.frame used to create Figure 4 in the paper:
    - reopening_isicSection <- biz_reopening_places(in_data_path = "C:/Users/<MyUserName>/Box Sync/Google Places API/data/")
  - Aggregation options:
    - groupby_var = "ISIC_section" to aggregate at ISIC Rev. 4 section: A, B, C, ...
    - groupby_var = "type", select_cities = "Manila" to aggregate by Google Places business type for a specific city
  - Parameters of note preserved exactly:
    - exclude_periods = c("2020-06-29")
    - min_sample_size = 50

- Business Activity Indicators
  - Rationale: Google Trends captures interest in a topic relative to all topics; assumed relationship between changes in interest and changes in business activity (proxied, especially short term). Google Places reviews provide another activity signal.

  - Google Reviews as an indicator of business activity
    - Adjusted number of reviews computed as: (average rate / 5) * (number of reviews)
    - Function:
      - biz_reviews_places(
        in_data_path = ".",
        out_data_path = ".",
        file_prefix = "sample_Google_places_",
        city_pop_limit = 1e+06,
        sample_freq = "month",
        write_out = TRUE
        )
    - Example invocation:
      - biz_reviews_places(in_data_path = "C:/Users/<MyUserName>/Box Sync/Google Places API/data/", out_data_path = "<output_directory>")
    - Example excerpt of output (columns preserved):
      - city, placetype, wr2020-04-24S1, wr2020-05-30S1, wr2020-05-30S2, wr2020-06-20S2
      - Baghdad, accounting, 206.76, 209.50, NA, NA
      - Baghdad, airport, 1946.30, 2018.96, NA, NA
      - Baghdad, amusement_park, 3946.60, 3996.86, NA, NA
      - Baghdad, aquarium, 10714.18, 10826.10, NA, NA

  - Google Trends as an indicator of activity
    - Calculates Google Trends SVIs at different ISIC Rev. 4 industry levels; enables reproduction of Tables 12, 13 and Figure 6 from the paper.
    - Function:
      - biz_activity_trends(
        out_data_path = ".",
        select_countries = NULL,
        select_categories = NULL,
        select_isic_sectors = NULL,
        select_keyword = NA,
        only_interest = FALSE,
        time_span = "today+5-y",
        write_out = TRUE
        )
    - Example: weekly SVIs and related topics/queries for ISIC Rev.4 sector "A" (Agriculture, forestry and fishing), past 5 years from Spain:
      - biz_activity_trends(out_data_path = "C:/Users/<MyUserName>/Box Sync/Google Places API/data/", select_isic_sectors = c("A"), select_countries = c("ES"))

  - Mapping Google Trends categories to ISIC Rev. 4 classes
    - Precomputed mapping dataset available: mapping_isic4d_trendsCategories
      - Load via: data("mapping_isic4d_trendsCategories")
      - This file selects the best matches according to criteria in the paper.
    - Distances dataset available: match_Trends_categories_ISIC_products
      - Load via: data("match_Trends_categories_ISIC_products")
      - Contains cosine similarities >= 0.8 between Trends categories and ISIC products.
    - Function to generate or refresh mappings:
      - match_categ_trends(
        refresh = FALSE,
        dist_threshold = 0.8,
        custom_dist_threshold = 0.85,
        removeDup = FALSE,
        keepTop_n = 5,
        weight_score = 4,
        count_score = 3
        )
      - Notes:
        - Default parameter values return the mapping dataset used as reference in the paper.
        - Setting refresh = TRUE and changing parameters yields alternative mapping files.
        - Technical annex in paper contains full explanation of the method.

### D. Key parameters and numeric values preserved exactly
- Example default and parameter values appearing in functions:
  - city_pop_limit = 1e+06
  - sample_freq = "month"
  - exclude_periods = c("2020-06-29")
  - longitudinal = FALSE
  - groupby_var = "city"
  - method = "reopening"
  - interpolate = FALSE
  - min_sample_size = 50
  - only_interest = FALSE
  - time_span = "today+5-y"
  - match_categ_trends defaults:
    - refresh = FALSE
    - dist_threshold = 0.8
    - custom_dist_threshold = 0.85
    - removeDup = FALSE
    - keepTop_n = 5
    - weight_score = 4
    - count_score = 3

*Annex II. Data and Methods with the imfgoogle R Package — source content from the provided PDF chapter.*

---


_Source: https://www.imf.org/-/media/files/publications/wp/2021/english/wpiea2021295-print-pdf.pdf_
