20110706 d2 spectral density

Upload: dedy-dwi-prastyo

Post on 03-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 20110706 D2 Spectral Density

    1/22

    Spectral Density and Filtering

    Dedy Dwi Prastyo

    Ladislaus von Bortkiewicz Chair of StatisticsC.A.S.E. Center for Applied Statisticsand EconomicsHumboldtUniversitt zu Berlinhttp://lvb.wiwi.hu-berlin.de

    http://www.case.hu-berlin.de

    http://lvb.wiwi.hu-berlin.de/http://www.case.hu-berlin.de/http://www.case.hu-berlin.de/http://lvb.wiwi.hu-berlin.de/
  • 7/28/2019 20110706 D2 Spectral Density

    2/22

    Motivation 1-1

    Stochastic Process

    1950 1960 1970 19801.5

    1

    0.5

    0

    0.5

    1

    1.5

    Time, t

    SOI

    Figure 1: Monthly Southern Oscillation Index (SOI)

    Stochastic process {Xt}

    t=0 in the frequency domain (Shumway andStoffer (2006) and Hamilton (1994))

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.51

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    3/22

    Motivation 1-2

    Time Domain

    0 5 10 15 20 25

    0.4

    0.2

    0.6

    1.0

    Lag Time

    ACF

    0 5 10 15 20 25

    0.2

    0.2

    0.6

    Lag Time

    PACF

    Figure 2: ACF and PACF of SOI series

    Time dependence

    Order of dependence, stationarity, seasonality, long memory

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.51

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    4/22

    Motivation 1-3

    Frequency Domain

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    4

    8

    12

    Frequency

    spectrum

    Figure 3: Periodogram of SOI series

    Frequency of the (business) cycle

    Repeating pattern, dominant frequency

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.51

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    5/22

    Motivation 1-4

    Stochastic Process Representation

    Signal St and noise t

    Xt = St + t

    Xt = a {cos(2t + b)} + t (1)

    Parameters

    a = amplitude

    = frequencyb = shift

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.51

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    6/22

    Motivation 1-5

    Example

    0 100 200 300 400 500

    2

    0

    2

    St

    0 100 200 300 400 5005

    0

    5

    S

    t

    +

    t1

    0 100 200 300 400 500

    20

    0

    20

    Time t

    St

    +

    t2

    Figure 4: Simulated signal St = 2cos{2(t/50) + 0.6}, with

    t1 N(0, 1) and t2 N(0, 25)

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    7/22

    Outline

    1. Motivation

    2. Spectral Density

    3. Filtering

    4. Conclusion

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    8/22

    Spectral Density 2-1

    Spectral Density

    Stationary process Xt with autocovariance (h Z )

    (h) = E[(xt+h E[xt+h])(xt E[xt])],

    h=

    |(h)|

  • 7/28/2019 20110706 D2 Spectral Density

    9/22

    Spectral Density 2-2

    Periodogram

    Sample-based spectral density, j=j/n

    f(j) =(n1)

    h=(n1)

    (h)e2ijh, j = 0, 1, ..., n 1 (5)

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    10/22

    Spectral Density 2-3

    AR(1)

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    40

    80

    Frequency

    SpectralDensity

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    40

    80

    Frequency

    SpectralDensity

    Figure 5: Spectral density ofXt = 0.9Xt1 + t and Xt = 0.9Xt1 + twith t N(0, 1) i.i.d.

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    11/22

    Spectral Density 2-4

    AR(2)

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    20

    40

    60

    Frequency

    Spe

    ctralDensity

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    1

    2

    3

    4

    Frequency

    Spe

    ctralDensity

    Figure 6: Spectral density ofXt = 0.5Xt1 0.75Xt2 + t and

    Xt = 0.1Xt1 + 0.4Xt2 + t with t N(0, 1) i.i.d.

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    12/22

    Spectral Density 2-5

    MA(1)

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    1

    2

    3

    Frequency

    Sp

    ectralDensity

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    1

    2

    3

    Frequency

    Sp

    ectralDensity

    Figure 7: Spectral density of Xt = t + 0.9t1 and Xt = t 0.9t1with t N(0, 1) i.i.d.

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    13/22

    Spectral Density 2-6

    MA(2)

    0.0 0.1 0.2 0.3 0.4 0.5

    0.0

    1.0

    2.0

    3.0

    Frequency

    SpectralDensity

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    2

    4

    6

    Frequency

    SpectralDensity

    Figure 8: Spectral density ofXt = t + 0.9t1 0.65t2 andXt = t 0.9t1 + 0.65t2 with t N(0, 1) i.i.d.

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    14/22

    Spectral Density 2-7

    ARMA(1, 1)

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    4

    8

    12

    Frequency

    SpectralDensity

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    4

    8

    12

    Frequency

    SpectralDensity

    Figure 9: Spectral density ofXt = 0.5Xt1 + t + 0.8t1 andXt = 0.5Xt1 + t 0.8t1 with t N(0, 1) i.i.d.

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    15/22

    Spectral Density 2-8

    SAR(1) and SMA(1)

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    1

    00

    300

    Frequency

    Sp

    ectralDensity

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    2

    4

    6

    Frequency

    Sp

    ectralDensity

    Figure 10: Spectral density Xt = 0.5Xt1+0.9Xt12+(0.5)(0.9)Xt13+tand Xt = t + 0.4t1 + 0.9t12 + (0.4)(0.9)t13 with t N(0, 1) i.i.d.

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    16/22

    Spectral Density 2-9

    Periodogram of SOI

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    4

    8

    12

    Frequency

    spectrum

    Figure 11: Periodogram of SOI series, dominant frequency at 1/0.021=48

    and 1/0.083=12 months

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    17/22

    Filtering 3-1

    Linear Filtering

    Extract signal St from data Xt contaminated by noise t

    Linear filter, cr is impulse response

    St =

    r=

    crxtr,

    r=

    |cr|

  • 7/28/2019 20110706 D2 Spectral Density

    18/22

    Filtering 3-2

    Example

    Time

    St

    0 100 200 300 400

    1.0

    0.0

    0.5

    Time

    St

    0 100 200 300 400

    0.4

    0.0

    0.4

    Figure 12: First differencing St = xtxt1 and 12-month centered movingaverage St =

    1

    24(xt6 + xt+6) +

    1

    12

    5

    r=5 xtr of SOI series

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    19/22

    Filtering 3-3

    Example

    0.0 0.1 0.2 0.3 0.4 0.5

    0

    2

    4

    6

    8

    1

    2

    frequency

    spectrum

    0.0 0.1 0.2 0.3 0.4 0.5

    0.0

    0.2

    0.4

    frequency

    spectrum

    Figure 13: Periodogram ofSOI series and 12-month centered moving aver-

    age filter with dominant frequency 1/0.02 = 52 (El Nino) and 1/0.083 =12 months

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    20/22

    Conclusion 4-1

    Conclusion

    Spectral density

    Express the information in cycle term Identify the dominant frequency in the series

    Filtering: Extract the signal from data

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w

  • 7/28/2019 20110706 D2 Spectral Density

    21/22

    Spectral Density and Filtering

    Dedy Dwi Prastyo

    Ladislaus von Bortkiewicz Chair of StatisticsC.A.S.E. Center for Applied Statisticsand EconomicsHumboldtUniversitt zu Berlinhttp://lvb.wiwi.hu-berlin.de

    http://www.case.hu-berlin.de

    http://lvb.wiwi.hu-berlin.de/http://www.case.hu-berlin.de/http://www.case.hu-berlin.de/http://lvb.wiwi.hu-berlin.de/
  • 7/28/2019 20110706 D2 Spectral Density

    22/22

    References 5-1

    Bibliography

    Hamilton, J.D., 1994Time Series Analysis

    Princeton University Press

    Shumway, R. and Stoffer, D.S., 2006Time Series Analysis and Its Application, with R examples, 2nd

    Edition

    Springer Science and Business Media

    Spectral Analysis 0 0 . 05 0 . 1 0 . 15 0 . 2 0 . 2 5 0 . 3 0 . 3 5 0 . 4 0 . 4 5 0 . 500.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Frequency,

    f(w

    )

    w