- can we measure inflation expectations using twitter? · exampleofselectedtweets...
TRANSCRIPT
Cristina Angelico, Juri Marcucci, Marcello Miccoli, and Filippo QuartaDG Economics and Statistics, Research & DG for Information Technology
Bank of Italy(Disclaimer: The views expressed are those of the authors and do not involve the responsibility of the Bank of Italy.)
Can We Measure Inflation Expectations UsingTwitter?
Harnessing Big Data & Machine Learning Technologies for Cen-tral BanksRome, March 6, 8
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
The paper in one wordcloud
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Motivation
Inflation Expectations are fundamental for Central Banks• Determine real interest rates - consumption and savingschoices
• Provide input on need to intervene and effectiveness ofcentral bank actions
Available sources of expectations:• Survey-based: “true” expectations, but low frequency• Market-based: high frequency, but variable and uncertainrisk premia
• A data source that combines “true” expectations with highfrequency sampling would be important for policy makers
Can social media be used to elicit inflation expectations?
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Motivation
Inflation Expectations are fundamental for Central Banks• Determine real interest rates - consumption and savingschoices
• Provide input on need to intervene and effectiveness ofcentral bank actions
Available sources of expectations:• Survey-based: “true” expectations, but low frequency• Market-based: high frequency, but variable and uncertainrisk premia
• A data source that combines “true” expectations with highfrequency sampling would be important for policy makers
Can social media be used to elicit inflation expectations?
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Motivation
Inflation Expectations are fundamental for Central Banks• Determine real interest rates - consumption and savingschoices
• Provide input on need to intervene and effectiveness ofcentral bank actions
Available sources of expectations:• Survey-based: “true” expectations, but low frequency• Market-based: high frequency, but variable and uncertainrisk premia
• A data source that combines “true” expectations with highfrequency sampling would be important for policy makers
Can social media be used to elicit inflation expectations?
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Motivation (Cont.)
• Social media allow a large number of users to both receiveand send information (perception/expectations)
• Scanning social media messages can thus be informativeto broadly capture people views.
This work:• Propose a way to filter social media messages (Twitter)on price expectations
• Combine information inmeaningful indexes of inflationexpectations
• Examine how they behave with respect to existing sourcesof expectations
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Motivation (Cont.)
• Social media allow a large number of users to both receiveand send information (perception/expectations)
• Scanning social media messages can thus be informativeto broadly capture people views.
This work:• Propose a way to filter social media messages (Twitter)on price expectations
• Combine information inmeaningful indexes of inflationexpectations
• Examine how they behave with respect to existing sourcesof expectations
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Results & Contributions
Preliminary Results• Indexes extracted from tweets counts give ameaningfulsignal on inflation expectations
• Significant correlations with other sources of expectations
Contribution• Explore Twitter as a new source of data to elicitexpectations.
• Wide variety and large volume of users• High frequency
• Analyze the usefulness of social media data in a newcontext
• Current literature uses Twitter to predict political elections,firms’ revenues, marketing, and asset returns
• Evaluation of different signal extraction techniques
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Results & Contributions
Preliminary Results• Indexes extracted from tweets counts give ameaningfulsignal on inflation expectations
• Significant correlations with other sources of expectations
Contribution• Explore Twitter as a new source of data to elicitexpectations.
• Wide variety and large volume of users• High frequency
• Analyze the usefulness of social media data in a newcontext
• Current literature uses Twitter to predict political elections,firms’ revenues, marketing, and asset returns
• Evaluation of different signal extraction techniques
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Roadmap – The paper in one slide
Data• Twitter data and Keywords
Twitter-based Inflation expectation indexes• “Dictionary rules” (keywords)• “Topic analysis”
Preliminary Results• Correlations
• Suvey-based measures (ISTAT)• Market-based measures (inflation swap rate)
• Forecasting
Conclusion and next steps
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 6 / 8
Data selection: Which tweets talk about inflation? – Relevant Keywords
Selection of tweets with following (italian) keywords:
• prezzo, prezzi, ‘costo della vita’• price + prices + “cost of living”
• ‘caro bollette’, inflazione, caro, ‘caro prezzi’, caroprezzi,‘benzina alle stelle’, ‘bolletta salata’, ‘caro affitti’, ‘carobenzina’, ‘caro carburante’, ‘caro gas’
• “expensive bills” + inflation + expensive + “high prices” +“high-prices” + “high gas prices” + “higher bill” + “higherrents” + “high petrol/gasoline price” + “high petrol/gasolineprices” + “high gas bills”
• deflazione, disinflazione, ribassi, ribasso, ‘meno caro’,‘bollette più leggere’
• deflation + disinflation + sales + sale + “less expensive” +“less expensive bills”
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Data selection: Which tweets talk about inflation? – Samples
• Two samples depending on Twitter private API:
• Long sample: January – October 6
• API: Full Search Archive (FSA).
• Just counts
• Short sample: April – May 6
• API: Historical Power Track (HPT).
• Full text and metadata (e.g. users’ biography,geo-localization, etc.). About . ml tweets for 8, 8individual users
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 8 / 8
Example of selected tweets
(a) #Eurozona: a marzo prosegue la deflazione con - , % di #inflazione annua #eurostat
(b) RT istat_it: Secondo la stima preliminare, a marzo la #deflazione é stabile a - , %
(c) RT SkyTG : #Ultimora BCE, #Draghi: senza nostra azione saremmo in deflazione
(d) Draghi: ”Abbiamo salvato l’Europa dalla deflazione” Non dire gatto se non ce l’hai nel sacco!
(e) Il timido aumento di maggio dell’inflazione é poca cosa. Adesso chi grida alla ripresa?
(f) Il prezzo del mio abbonamento sale del % ogni anno, ovviamente a qualcuno il caro prezzi inizia a pesare
(g) Da domani sará meno caro usare il cellulare in Europa. Ecco perché
(h) Solo da Baby Glamour acquistando tre capi il meno caro é in regalo. Promozione fino al Ottobre.
(i) Il piú grande spettacolo dopo il #big-bang é l’inflazione cosmica
Translation:(a) #Eurozone: in March #deflation continues with - . % YOY #Eurostat
(b) RT istat_it: According to the flash estimate, in March #deflation is stable at - . %
(c) RT SkyTG : #breakingnews BCE, #Draghi: without our action we would be in deflation
(d) #Draghi: “We saved Europe from deflation”. Do not count your chickens before they are hatched!
(e) The increase of inflation in May is abysmal. Now who’s saying that economic recovery is ongoing?
(f) The price of my subscription increases by % every year. Obviously this high prices are becoming unbearable.
(g) Starting tomorrow it will be less expensive to use the cellphone in Europe.
(h) Only at Baby Glamour if your buy three items the least expensive is free. Promotional sales until October .
(i) The greatest show after the #big-bang is the cosmic inflation
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Inflation indexes - Dictionary-based approach
• Problem: if tweets talk about ‘prices’⇒ increasing ordecreasing prices? And what about ‘inflation’?
• Dictionary-based approach: keywords’ connotationreflects the message
• Inflation_Neutral: (price + prices + “cost of living”)
• Inflation_Up: (“expensive bills” + inflation + expensive +“high prices” + “high-prices” + “high gas prices” + “higher bill”+ “higher rents” + “high petrol/gasoline price” + “highpetrol/gasoline prices” + “high gas bills”)
• Inflation_Down: (deflation + disinflation + sales + sale +“less expensive” + “less expensive bills”)
• Index computed as daily raw count of tweets
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Inflation indexes - Dictionary-based approach
02000400060008000
Inde
x N
EU
TRA
L
Jan 13 Jan 14 Jan 15 Jan 16 Jan 17
ISTAT(0.7% yoy)(1/14/2014) ISTAT(0.0% yoy)
(1/7/2015)
Draghi's Lecture(2/4/2016)
0500
1000150020002500
Inde
x U
P
Jan 13 Jan 14 Jan 15 Jan 16 Jan 17
ISTAT(-0.1% yoy)(8/29/2014)
ISTAT(-0.2% mom)(2/29/2016)
02000400060008000
Inde
x D
OW
N
Jan 13 Jan 14 Jan 15 Jan 16 Jan 17
Dictionary-based Inflation Indexes
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Inflation indexes - Dictionary-based approach
• Inflation_Neutral index has relevant noise (e.g.advertisement, e-commerce, etc...): Discarded for now
• Inflation_Up and Inflation_Down cleaner and moremeaningful signal
• Using both we define:Inflation_Exp = Inflation_Up - Inflation_Down
• Inflation Expectations # : Filtering on event dummies,standardization, winsorizing
• Inflation Expectations # : only standardization, winsorizing
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Inflation Expectations (IE) indexes and Inflation swaps at Y for Italy
-10
12
IT In
fl. S
wap
1Y
-40
-20
020
1/1/2013 1/1/2014 1/1/2015 1/1/2016 1/1/2017
Infl. Exp. 1 MA(30) Infl. Exp. 2 MA(30)
IT Infl. Swap 1Y (RHS)
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Indexes in the short sample: Topic analysis
• In the short sample exploit the full text of tweets to filterout noise (ads, e-commerce ...)
• Let the text speak! Topics extraction through LatentDirichlet Allocation (LDA)
• Intuitively, the methods identifies some topics from text
• Each topic defined by a collection of word
• From identified topics we selected those more related toprice evolution
• Index computed as daily raw counts of tweets belongingto selected topic
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Selection of Topics
Smartphone e-commerce Energy and Fuel Inflation/Deflation/Growth
Italian [English] Italian [English] Italian [English]
Iphon Petrol [oil] inflazion [inflat]apple croll [collaps] deflazion [deflat]uscit [exit] dollar cresc [growth]galaxy baril [barrel] istatsamsung russ [Russ] drag [Draghi]offert [discount] elettr stim [estim]caratterist [featur] gregg [crud] ripres [recover]tecnic [technic] york conferm [confirm]compres [incl] iran gzagtest arab eurozon
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Selection of Topics
Smartphone e-commerce Energy and Fuel Inflation/Deflation/Growth
Italian [English] Italian [English] Italian [English]
Iphon Petrol [oil] inflazion [inflat]apple croll [collaps] deflazion [deflat]uscit [exit] dollar cresc [growth]galaxy baril [barrel] istatsamsung russ [Russ] drag [Draghi]offert [discount] elettr stim [estim]caratterist [featur] gregg [crud] ripres [recover]tecnic [technic] york conferm [confirm]compres [incl] iran gzagtest arab eurozon
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Short sample: Topics on inflation and oil and market-based measures
-.50
.51
is_1
y_it
1015
2025
4/1/2015 7/1/2015 10/1/2015 1/1/2016 4/1/2016
Topic Infl. MA(30) Topic Infl. MA(60)
IT Infl. Swap 1Y (RHS)
-.50
.51
is_1
y_it
020
4060
80
4/1/2015 7/1/2015 10/1/2015 1/1/2016 4/1/2016
Topic Oil MA(30) Topic Oil MA(60)
IT Infl. Swap 1Y (RHS)
-.50
.51
is_1
y_it
1015
2025
4/1/2015 7/1/2015 10/1/2015 1/1/2016 4/1/2016
Topic Infl. (HP1) Topic Infl. (HP2)
IT Infl. Swap 1Y (RHS)
-.50
.51
is_1
y_it
1020
3040
5060
4/1/2015 7/1/2015 10/1/2015 1/1/2016 4/1/2016
Topic Oil (HP1) Topic Oil (HP2)
IT Infl. Swap 1Y (RHS)
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 6 / 8
Dictionary- vs. Topics-based indexes
• Topics-based seemingly less noisy than dictionary-based• But not directional
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Twitter-based indexes vs market-based (survey-based) inflation expectations
• Twitter-based indexes give a signal consistent withavailable inflation expectations?
• Compare Twitter signals with:
• Survey-based: consumers’ inflation expectations over nextm(ISTAT)• Caveat (monthly frequency)
• Market-based: inflation swap rates on IT inflation• Daily, but caveat of risk premia
• Significant correlations. Negative for topics-basedindicators
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 8 / 8
Correlations with survey-based measures of IE - Dictionary based (Long sample)
(a) (b) (c) (d) (e) (f) (g)
(a) IE MA( )
(b) IE MA( ) .86 ***
(c) IE MA(6 ) . *** . ***
(d) IE MA( ) . *** .8 *** . ***
(e) IE MA( ) .8 *** . *** . *** .8 ***
(f) IE MA(6 ) . 66*** . 6 *** . *** . *** . ***
(g) IE Consumers (ISTAT) . ** .6 *** .6 *** . 6 * .6 *** .6 ***
* p < 0.05, ** p < 0.01, *** p < 0.001
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Correlations with survey-based measures of IE - Topics-based (Short sample)
(b) (c) (d) (e) (f) (g) (l)
(b) Topic Infl. Avg. MA( )
(c) Topic Infl. Avg. MA( ) . ***
(d) Topic Infl. Avg. MA(6 ) .6 *** .86 ***
(e) Topic Oil Avg. MA( ) . . 8 .
(f) Topic Oil Avg. MA( ) . . . . 68***
(g) Topic Oil Avg. MA(6 ) . 6 . . 8*** . 6*** . 6 ***
(l) IE Consumers (ISTAT) - . 8 - . *** - .686*** . 6 . . 6
* p < 0.05, ** p < 0.01, *** p < 0.001
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Correlations with market-based measures of IE - Dictionary-based (long sample)
IT Infl. Swap Y IT Infl. Swap Y- Y IT Infl. Swap Y- Y
Infl. Exp. MA( ) . *** . *** . 6 ***
Infl. Exp. MA( ) .6 *** . 6*** . 8***
Infl. Exp. MA(6 ) .6 *** . 8*** . 8 ***
Infl. Exp. MA( ) . *** . *** . ***
Infl. Exp. MA( ) . *** . *** . ***
Infl. Exp. MA(6 ) .6 *** . *** . 8***
IT Infl. Swap Y .68 *** . 8 ***
IT Infl. Swap Y- Y . 6 ***
IT Infl. Swap Y- Y
* p < 0.05, ** p < 0.01, *** p < 0.001
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Correlations with market-based measures of IE - Topics-based (short sample)
IT Infl. Swap Y IT Infl. Swap Y- Y IT Infl. Swap Y- YTopic Infl. Avg. MA( ) - . *** - . *** - . ***Topic Infl. Avg. MA( ) - . *** - . *** - .6 6***Topic Infl. Avg. MA(6 ) - . 6 *** - . *** - .66 ***Topic Oil Avg. MA( ) - .6 *** - . *** - . ***Topic Oil Avg. MA( ) - .68 *** - . 8 *** - . ***Topic Oil Avg. MA(6 ) - . *** - . *** - . ***IT Infl. Swap Y . *** .6 ***IT Infl. Swap Y- Y . ***IT Infl. Swap Y- Y
* p < 0.05, ** p < 0.01, *** p < 0.001
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Summing up
• Dictionary-based Twitter indexes give ameaningful signal• co-move significantly with available data on inflationexpectation
• Topics-based Twitter indexes negatively correlated withexpectations
• Index does not take into account direction of expectations• Short sample (April - May 6): very low or negativerealized inflation
• Twitter-indexes signals if inflation expectations areincreasing or decreasing, but no info on level
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Predicting market-based inflation expectations
• Can Twitter indexes predict the evolution of market-basedinflation swap rates?
• Rolling scheme. We use direct forecasts• Benchmark model: AR(p) with p selected by BIC in-sample
yht+h = β0 + β1(L)yt + ηt+h, t = 1, 2, . . . , T ( )
• Competing models: AR−X(p)model w xt with lags p andq selected by BIC (pmax = qmax = 4)
yht+h = β0+β1(L)yt+β2(L)xt+ εt+h, t = 1, 2, . . . , T ( )
• Results for the long sample (Jan - Oct 6)Timing: T = R+ P obs. T = 1001, R = 250, P = 751
• R observations used to estimate the models (in-sample),last P for out-of-sample evaluation.
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Forecasting Exercise Results –Inflation Swap Y- Y
xt 6AR(p) . . . 8 . 6 . . . . . . . .IEneutral,t . † . . . † . . . . 8 . 8 . . . 88IEup,t . . ††† . . † . . . . . . 8 . . 8IEdown,t . . . . 8 . . 8 . . . . . .IEup−down,t . †† . . . 8 . . . 6 . . . . † .IE1,ma10,t . . . . . . . 8 . . . 8 . . 6IE1,ma30,t . . . 6 . . . . 6 . 6 . . . .IE2,ma10,t . . . . . . . . . . 8 . 6 . 6IE2,hp,t . . . . 8 . . . 86 . . 6 . 6 . . 6IE2,ma30,t . . . . . . . . 6 . . . .
• For benchmark AR(p): RMSFE• For all other models: ratio of RMSFE of row model to RMSFE of benchmark• *, **, ***, DM test significant at , , and %, respectively• †, ††, † † †, DM test significant at , , and %, respectively but benchmark
outperforms• Forecast horizons: from to 6 days, , , , , and days ahead.
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Cumulative Sum of Squared (Forecast) Error Differences (CSSED)
•
CSSEDm,τ =
T∑τ=R
(e2bm,τ − e2m,τ ) ( )
ek,τ = uτ − uk,τ |t ( )
• What happens if the benchmark model (bm) outperformsthe competing model (m)?
• e2bm,τ < e2m,τ ⇒ CSSEDm,τ < 0
• And if the competing modelm beats the benchmark bm?• e2bm,τ > e2m,τ ⇒ CSSEDm,τ > 0
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 6 / 8
Cumulative Sum of Squared (Forecast) Error Differences (CSSED) (Cont.)
0 100 200 300 400 500 600 700 800−0.2
−0.15
−0.1
−0.05
0
0.05
0.1
0.15
Forecast horizon: h =1
Up−Down
Res−Ma−30
Norm−Hp
Norm−Ma−30
0 100 200 300 400 500 600 700 800−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
Forecast horizon: h =6
Up−Down
Res−Ma−30
Norm−Hp
Norm−Ma−30
0 100 200 300 400 500 600 700 800−1
−0.5
0
0.5
1
1.5
2
Forecast horizon: h =15
Up−Down
Res−Ma−30
Norm−Hp
Norm−Ma−30
0 100 200 300 400 500 600 700 800−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
Forecast horizon: h =30
Up−Down
Res−Ma−30
Norm−Hp
Norm−Ma−30
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 / 8
Conclusions
Work in progress...• Tweets generate meaningful signals on inflationexpectations: high frequency and large users base
• Daily Twitter-based indexes of inflation expectations arehighly and significantly correlated with both dailymarket-based and monthly survey-based inflationexpectations
• Indexes can say whether expectations are for higher orlower inflation, but cannot shed light on level
Next steps:• Validation with a longer time series• New ways of extracting/cleaning signal?
C. Angelico, J. Marcucci, M. Miccoli & F. Quarta Twitter and E(Inflation) March 6, 8 8 / 8