real time trend extraction and seasonal adjustment: a generalized direct filter approach isf 2011,...
TRANSCRIPT
![Page 1: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/1.jpg)
Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter
Approach
ISF 2011, PragueMarc Wildi
Zurich University of Applied [email protected]
![Page 2: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/2.jpg)
Signalextraction vs. Forecasting
![Page 3: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/3.jpg)
Signal
X Noisy Data
Filter: a set of weights such that
is `fr
Signa
ee of noise'
is the
Trend, Seasonally Adjusted Component, Cyc
l
l
e
t
k
t k t kk
t
Y X
Y
![Page 4: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/4.jpg)
Filters:
• Ad hoc designs: no explicit modelling of the data – HP-Filter, CF-Filter, BK-Filter, Henderson Filter, …
• Model-based designs– TRAMO/SEATS, X-12-ARIMA, Stamp
• Non-parametric filters (Loess)
• Very general setting!
k
![Page 5: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/5.jpg)
Real-Time SignalextractionTime Domain
1
0
1 2
1 1
0
1 1
0
Y `senses' the (X ,X ,...)
Real-Time Finite Sample
ˆ ˆ
Model-Ba
future
ˆ
ˆ
sed Approaches (MBA):
ˆ
One- a
T k T k T Tk
T k T k
T
k T k k T k kk T
T
k k
T
k T k k
k
k
T k
kT k
X
Y X
X X
X
X
X
nd ahead multi-s foretep casts
![Page 6: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/6.jpg)
Example1
1| |
( 1)
1 1| | | |
0 ( 1)
1 1| | | | | |
0 ( 1)
1 0| | |
1 ( 1)
AR(1) Process :
Filter: sym. exponential weighting
ˆ ˆ
( )
t t t
Tk
t t kk T
Tk k
T T k T kk k T
Tk k k
T k Tk k T
Tk
T kk k T
X aX
Y c X
Y c X c X
c X c a X
c X c a
|
1| |
1
Very cumbersome way to define a one-sided filt
1
er!
kT
Tk
T k Tk
X
cc X X
a
![Page 7: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/7.jpg)
Forecasting
1
Y
1,Forecasting:
0 for k -1
This is a very particular (asymmetric) `Signal' Definition
Model-Based One-step ahead Forecast!
T k T kk
k
X
![Page 8: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/8.jpg)
Frequency Domain
![Page 9: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/9.jpg)
Real-Time SignalextractionFrequency Domain
1
0
1
0
Target: Y
ˆ ˆReal-Time Estimate:
Transferfunctions
( ):= exp( ) ( if symmetric)
ˆ ˆ( ):= exp( )
T k T kk
T k T k
kk
k
T
k
T
k
X
Y X
ik
ik
![Page 10: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/10.jpg)
Example: European IPI
![Page 11: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/11.jpg)
TRAMO/SEATS (Airline-Model in red)
![Page 12: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/12.jpg)
Forecasting
1
( ):= exp( )
1,Forecasting:
0 for k -1
( ) 1*exp( )
( ) is a very particular (allpass) Filter/Transferfunction
Replicates Traditional Model-Based One-step ahead Forecast in F-D!
kk
k
ik
i
![Page 13: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/13.jpg)
Optimization Criterion: Mean-Square
2FILTERWEIGHTS
2FILTERWEIGHTS
2
ˆ
ˆFilter error:
Criterion: E[ ] min
ˆ| ( ) ( ) | ( ) min
Real-World:
ˆˆ( ) ( ) S( ) min
t t t
t
k k kk
r Y Y
r
dS
![Page 14: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/14.jpg)
Choice of Spectral Estimate • Model-based: – TRAMO (airline-model), X-12-ARIMA, state-space
• Ad-hoc: – implicit model (HP, CF, BK, Henderson,…)
• Non Parametric– Periodogram
• This choice is to some extent arbitrary: it depends on the preference/experience/expertise of the user.
• Very general setting!
ˆ( )S
![Page 15: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/15.jpg)
Generalized DFA: Very General Setting!
• Arbitrary signals – Including as a special case traditional one-step ahead
forecasting• Arbitrary finite sample Spectral Estimate– ad hoc, model-based, non-parametric
• Generalizes– Ad hoc filters– Model-based filters– DFA (based on the periodogram)– Traditional (one-step ahead) ARIMA-modelling, state-space
modelling– Extends to multivariate filtering!
![Page 16: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/16.jpg)
Frequency-Domain: Timeliness-Reliability Dilemma
![Page 17: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/17.jpg)
Control of Timeliness/Speed: Cosine Law applied to
ˆ ( )
ˆ( ) ( )
ˆ ( )
( )
2
2
ˆ( ) ( )
ˆ ˆ ˆ( ) ( ) 2 ( ) ( ) 1 cos( ( ))
2ˆ( ) ( )
![Page 18: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/18.jpg)
Timeliness-Criterion
/2 2
1
/2 2
1
/2
1
ˆˆ( ) ( ) ( )
ˆ ˆA( ) A( ) ( )
ˆ ˆˆ2A( )A( ) 1 cos( ( )) ( )
Mean-Square: 1
Faster Filter : >1
Slower Filter: <1
T
k k kk
T
k k kk
T
k k k kk
S
S
S
![Page 19: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/19.jpg)
Emphasize Noise Rejection in Stop Band (Reliability/Smoothness)
/2 2
1
/2
1
ˆ ˆA( ) A( ) ( ) ( )
ˆ ˆˆ2A( )A( ) 1 cos( ( )) ( )
( ) assigns m amplitude in stop band
time-shift in pas
ore weight to
assigns more weigh s t band to
T
k k k kk
T
k k k kk
k
W S
S
W
![Page 20: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/20.jpg)
Essence of Generalized DFA
• The new optimization criterion IS the timeliness-reliability-dilemma and conversely
• `Philosophy’ may be contrasted with – Maximum likelihood (particular parametric setting
lambda/expweight)– Maximum entropy
• Contrast:– Manipulate Real-Time filter characteristics explicitly on
the edge of the fundamental dilemma– User relevant priorities (risk-aversion)
![Page 21: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/21.jpg)
Effect of `Expweight’
![Page 22: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/22.jpg)
Effect of Lambda
![Page 23: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/23.jpg)
Example : European IPI
![Page 24: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/24.jpg)
Replicate TRAMO RT-Performance:TRAMO (red) vs. Gen. DFA (blue)
![Page 25: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/25.jpg)
New Target: Customized Design
• Instead of optimal mean-square estimate the user could specify a `faster’ and/or `smoother’ real-time estimate
• The new estimate is still purely model-based!– It IS TRAMO (it could be X-12, Stamp,…)– But it becomes faster/smoother (timeliness-
reliability dilemma)
![Page 26: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/26.jpg)
Mean-Square vs. Enhanced TRAMO
• Typically, TRAMO-filter (blue) is noisy (poor noise suppression in stop-band)
• The `customized’ filter (green) barely loses in terms of time-shift in the pass-band. It clearly wins in terms of noise suppression in the stop-band: better compromise
![Page 27: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/27.jpg)
TRAMO (red) vs. Enhanced (green)
![Page 28: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/28.jpg)
Conclusion
• As expected, the `customized’ real-time filter (green) is as `fast’ as the MS-filter by TRAMO (red) and it is much smoother (better noise suppression)
![Page 29: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/29.jpg)
SA vs. Customized RT-Trend
• Real-time customized trend filter is as fast as traditional SA-filter and much (much) smoother.
![Page 30: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/30.jpg)
Conclusion
![Page 31: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/31.jpg)
Philosophy Generalized DFA
The new criterion IS the timeliness-reliability dilemma
![Page 32: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/32.jpg)
Consequences• Generalizes classical filter approaches (ad hoc,
model-based)• Emphasizes user relevant priorities explicitly
![Page 33: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/33.jpg)
Practicality
• Numerically (very) fast– Closed-from approximation (I-DFA/open source)– Fast exact optimization (Eurostat/proprietary)
• Short piece of (R-) code– Could easily dock to any existent software/tool
![Page 34: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/34.jpg)
Web:
• SEFblog: http://blog.zhaw.ch/idp/sefblog• USRI: http://www.idp.zhaw.ch/usri • MDFA-XT: http://www.idp.zhaw.ch/MDFA-XT• SEF-page: http://www.idp.zhaw.ch/sef
![Page 35: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/35.jpg)
Selected SEFBlog-Entries
• Forecasting the EURO-BUND-Future (6 months, one Year)– http://blog.zhaw.ch/idp/sefblog/index.php?/archives/
186-Forecasting-the-EURO-Bund-Future-6-months-and-One-Year-Ahead-FirstPreliminary-Draft.html
• OECD-CLI: leading indicator for the US– http://blog.zhaw.ch/idp/sefblog/index.php?/archives/
173-Tutorial-I-MDFA-Part-II-The-OECD-CLI-for-the-US.html
– http://blog.zhaw.ch/idp/sefblog/index.php?/archives/175-Injecting-the-ZPC-Gene-into-I-MDFA-an-Application-to-the-OECD-CLI-for-the-US.html
![Page 36: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/36.jpg)
SEFBlog-Entries
• Algorithmic Trading:– http://blog.zhaw.ch/idp/sefblog/index.php?/archives/
157-A-Generalization-of-the-GARCH-in-Mean-Model-Vola-in-I-MDFA-filter.html
• Tutorials Univariate Filter:– http://blog.zhaw.ch/idp/sefblog/index.php?/archives/
159-I-DFA-Exercises-Part-I-Mean-Square-Criterion.html– http://blog.zhaw.ch/idp/sefblog/index.php?/archives/
160-I-DFA-Exercises-Part-II-Customization-SpeedReliability.html
![Page 37: Real Time Trend Extraction and Seasonal Adjustment: a Generalized Direct Filter Approach ISF 2011, Prague Marc Wildi Zurich University of Applied Sciences](https://reader035.vdocument.in/reader035/viewer/2022062308/56649da85503460f94a954f4/html5/thumbnails/37.jpg)
SEFBlog-Entries
• Tutorials Multivariate Filter:– http://blog.zhaw.ch/idp/sefblog/index.php?/
archives/172-Tutorial-I-MDFA-Part-I-Simulated-Time-Series.html
– http://blog.zhaw.ch/idp/sefblog/index.php?/archives/173-Tutorial-I-MDFA-Part-II-The-OECD-CLI-for-the-US.html