Module 10 Intervention Models for Time Series Class notes for Statistics 451: Applied Time Series Iowa State University Copyright 2015 W. Q. Meeker. April 2, 2016 16h 21min 10 - 1 Module 10 Segment 1 Seasonal Model Identification for the Ozone Data 10 - 2 Los Angeles Ozone Data Monthly Averages 1955-1972 Monthly Average of Hourly Readings of Ozone in Downtown Los Angeles 8 pphm 6 4 2 1955 1960 1965 1970 Year 10 - 3 Ozone • Ozone in the in the upper atmosphere helps filter out the sun’s most harmful ultraviolet rays (especially UV-C). • Ozone in the air we breath is a harmful oxidant air pollutant. Breathing high levels of ozone can irritate eyes and cause serious damage to lungs. • Ozone is caused by automobile exhaust emissions and industrial smoke stacks. • Levels greater than 5 pphm (50 ppb) are considered unsafe for sensitive groups of individuals (e.g., young, old, suffering from lung disease, etc.). • Levels above 15 pphm (150 pbb) are unsafe for everyone. 10 - 4 Los Angeles Ozone Data Monthly Averages 1955-1972 Monthly Average of Hourly Readings of Ozone in Downtown Los Angeles 8 pphm 6 4 2 1955 1960 1965 1970 Year 10 - 5 Los Angeles Ozone Data Monthly Averages 1955-1972 Monthly Average of Hourly Readings of Ozone in Downtown Los Angeles 8 6 pphm 4 2 1955 1960 1965 1970 Year 10 - 6 Graphical Output from Function iden for the Ozone Data with No Differencing Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles 2 4 w 6 8 w= pphm 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 time ACF 0.0 -1.0 5 ACF 0.5 6 1.0 Range-Mean Plot 10 20 30 4 Lag 0.5 0.0 -1.0 Partial ACF 3 1.0 PACF 2 Range 0 2.5 3.0 3.5 4.0 Mean 4.5 5.0 5.5 0 10 20 30 Lag 10 - 7 Graphical Output from Function iden for the Log Ozone Data with No Differencing Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles 0.5 1.0 w 1.5 2.0 w= log( pphm ) 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 time ACF 0.0 -1.0 1.2 ACF 0.5 1.4 1.0 Range-Mean Plot 10 20 30 1.0 Lag 0.5 -1.0 0.0 Partial ACF 1.0 PACF 0.8 Range 0 1.0 1.2 1.4 Mean 1.6 0 10 20 30 Lag 10 - 8 Graphical Output from Function iden for the Ozone Data with 1 Regular Difference 0 -4 -2 w 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles w= (1-B)^ 1 pphm 1955 1957 1959 1961 1963 1965 1967 1969 1971 1973 time -1.0 0.0 Partial ACF 0.0 -1.0 ACF 1.0 PACF 1.0 ACF 0 10 20 Lag 30 0 10 20 30 Lag 10 - 9 Graphical Output from Function iden for the Ozone Data with 1 Seasonal Difference -3 -1 w 1 2 3 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles w= (1-B^ 12 )^ 1 pphm 1956 1958 1960 1962 1964 1966 1968 1970 1972 time -1.0 0.0 Partial ACF 0.0 -1.0 ACF 1.0 PACF 1.0 ACF 0 10 20 Lag 30 0 10 20 30 Lag 10 - 10 Graphical Output from Function iden for the Ozone Data with 1 Regular and 1 Seasonal Difference 0 -4 -2 w 2 4 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles w= (1-B)^ 1 (1-B^ 12 )^ 1 pphm 1956 1958 1960 1962 1964 1966 1968 1970 1972 time -1.0 0.0 Partial ACF 0.0 -1.0 ACF 1.0 PACF 1.0 ACF 0 10 20 Lag 30 0 10 20 30 Lag 10 - 11 Module 10 Segment 2 Seasonal Model Estimation and Forecasting for the Ozone Data Using No Transformation 10 - 12 Ozone Data esti SARIMA(0, 0, 1)(0, 1, 1)12 Model No Transformation (Model 1) Output Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm 0 -3 -2 -1 Residuals 1 2 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time • • • • • •• • • • •• • • • • • • • • • • •• • ••• • • •• •• • • 0.5 • • •• •• • • • • • • • • • • • • • •• • • • • •• • • • • • • • •• • •• • • •• • • • • • • • • • • • • • •• • • • • • • • • • • •• • • • • • • • • • • • •• • • •• • • • • • •• • • •• • • • • • • • • • • 2 4 6 Fitted Values 0.0 0 -2 -1 •• • • • •• • • • • ••• • •• • •• • • • • ACF • •• • • •• • • • • • • • • • •• • • •• • • • • -0.5 1 • • -3 Residuals • • • • 8 -1.0 2 • • Residual ACF 1.0 Residuals vs. Fitted Values 0 10 20 30 Lag 10 - 13 Ozone Data esti SARIMA(0, 0, 1)(0, 1, 1)12 Model No Transformation (Model 1) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • • • 4 • •• • • • • • • • • • • • • • • •• • • • • • • • • • • • •• • • • • • • • • • • • • • • • •• • •• • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • • • •• • • • • •• • • • • • • • • • • • •• • • • • •• •• • • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • • • • • • • •• •• • • • • • • • •• • • • • • • • • •• • • • • 0 2 • • • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • •• • • • •• ••• •••• ••• • • • •• •••• ••• ••••• ••• • • • •••• •••• •••• ••• ••••• ••• ••• ••• •••• • • • •••• •••• •• •• •••• • • • •• • • -3 1955 -3 -2 -1 0 1 2 Residuals 10 - 14 Summary of Models Fit to the Ozone Data 10 - 15 Ozone Data esti SARIMA(3, 0, 0)(0, 1, 1)12 Model No Transformation (Model 2) Output Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ar: 1 2 3 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm 0 -1 -3 -2 Residuals 1 2 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time 0 -1 -2 • • •• • •• • • • • • •• • • • • • • • •• •• • • •• • • • • • • • • • •• • • • • •• •• •• • •• • • • 0.5 • • •• • • •• • • •• •• • •• • •• •• •• • • •• • • • • • • • •• • •• •• • •• • • • • • • • • • • • • • • • • • • •• • • • ••• • • • •• •• • • • •• • • • • • • • • • • • • ••• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • -3 Residuals • • • • • • ACF 1 • -0.5 • • • • • • 2 4 6 Fitted Values 0.0 2 • • 8 -1.0 • Residual ACF 1.0 Residuals vs. Fitted Values 0 10 20 30 Lag 10 - 16 Ozone Data esti SARIMA(3, 0, 0)(0, 1, 1)12 Model No Transformation (Model 2) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ar: 1 2 3 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • • • 4 • •• • • • • • • • • • • • • • • •• • • • • • • • • • • • •• • • • • • • • • • • • • • • • • •• •• • • • •• • • • • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • • • • •• •• • • • • • • • • • •• •• • • • • • • • • •• • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • • • • • • • • •• •• • • • • • • • •• • • • • • •• •• • • • • 0 2 • • • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 •• • • • • -2 Normal Scores 1 2 • -3 1955 • •• • •• •• • • • •••• •• • ••• ••• •••• • • • •• ••• ••• •••• ••••• • • •• ••••• ••• ••••• ••••• •••• ••• ••• •• • • • • •• • •• • • • -3 -2 -1 0 1 2 Residuals 10 - 17 Ozone Data esti SARIMA(0, 0, 1)(0, 1, 1)12 Model No Transformation (Model 1) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • • • 4 • •• • • • • • • • • • • • • • • •• • • • • • • • • • • • •• • • • • • • • • • • • • • • • •• • •• • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • • • •• • • • • •• • • • • • • • • • • • •• • • • • •• •• • • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • • • • • • • •• •• • • • • • • • •• • • • • • • • • •• • • • • 0 2 • • • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • •• • • • •• ••• •••• ••• • • • •• •••• ••• ••••• ••• • • • •••• •••• •••• ••• ••••• ••• ••• ••• •••• • • • •••• •••• •• •• •••• • • • •• • • -3 1955 -3 -2 -1 0 1 2 Residuals 10 - 18 Ozone Data esti SARIMA(1, 0, 1)(0, 1, 1)12 Model No Transformation (Model 3) Output Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 ar: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm 0 -3 -2 -1 Residuals 1 2 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time Residual ACF 1.0 Residuals vs. Fitted Values • • 2 • • •• • • • • • • •• • • • • •• • • • • • • • • • 0.5 • •• •• • • • • •• • ••• • • • • •• • •• ••• • • •• • • •• • • • • •• • • • • • •• • • •• • • • • • • •• • • • • • • • • • • • • • • ••• • • • • •• • •• • • •• • • •• • • • • •• • • • • • • • • • • • • • • • 2 4 6 Fitted Values ACF • -0.5 • • • • • 0.0 • • •• • • • 8 -1.0 0 -2 -1 • ••• • • • • • • • • • • • • • • • • • •• • • • • •• •• • • • • • • •• • -3 Residuals 1 • 0 10 20 30 Lag 10 - 19 Ozone Data esti SARIMA(1, 0, 1)(0, 1, 1)12 Model No Transformation (Model 3) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 ar: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • • • 4 • •• • • • • • • • • • • • • • • •• • • • • • • • • • • • •• • • • • • • • • • • • • • • • •• •• • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • •• • • • • • • • • • • • •• • • • • •• •• • • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • • •• • • • • • • • • • • • • • • •• • • • • • • •• • • •• • • 0 2 • • • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • •• • •• ••• ••• •• •••• •• ••• •••• • ••• •••• ••• •• • • • • ••• ••• ••• •••• ••• • • •••• ••• •• • •• ••• ••• •• • • •• • •• • • • -3 -2 -1 0 1 2 Residuals 10 - 20 Ozone Data esti SARIMA(3, 0, 0)(0, 1, 1)12 Model No Transformation (Model 2) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ar: 1 2 3 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • • • 4 • •• • • • • • • • • • • • • • • •• • • • • • • • • • • • •• • • • • • • • • • • • • • • • • •• •• • • • •• • • • • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • • • • •• •• • • • • • • • • • •• •• • • • • • • • • •• • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • • • • • • • • •• •• • • • • • • • •• • • • • • •• •• • • • • 0 2 • • • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 •• • • • • -2 Normal Scores 1 2 • -3 1955 • •• • •• •• • • • •••• •• • ••• ••• •••• • • • •• ••• ••• •••• ••••• • • •• ••••• ••• ••••• ••••• •••• ••• ••• •• • • • • •• • •• • • • -3 -2 -1 0 1 2 Residuals 10 - 21 Ozone Data esti SARIMA(0, 1, 1)(0, 1, 1)12 Model No Transformation (Model 4) Output Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ndiff= 1 ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm 0 -1 -3 -2 Residuals 1 2 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time • 2 • 0.5 • • •• • • • • •• • •• • • • •• • • • • •• • • •• • • • •• • • • • • •• • • ••• • • • • • • • • ••• • • • • • • • • • • -2 • • -0.5 •• • • • • • • • • • 2 4 6 Fitted Values 0.0 0 -1 • • • •• • • •• •• • • • • •• • • •• •• • •• • •• • • • • • • • • • •• •• • • • •• • • • • •• • • • • • • •• • •• ••• • • • • • •• • ••• • •• •• • • • • • • • • • • • • • • • • • -3 Residuals • • • • ACF 1 • • • • • • 8 -1.0 •• • Residual ACF 1.0 Residuals vs. Fitted Values 0 10 20 30 Lag 10 - 22 Ozone Data esti SARIMA(0, 1, 1)(0, 1, 1)12 Model No Transformation (Model 4) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ndiff= 1 ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • • • 4 • •• • • • • • • • • • • • • • • •• • • • • • • • • • • • •• • • • • • • • • • • • • • • • • •• • • • •• • •• • • • •• • • • • • • • • • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • •• •• • • • • • • • • • •• •• • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • •• • • • • • • • •• •• • • • • • • • • • •• • • • • • •• • • 0 2 • • • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • • • •• •• • • • •• •• • •• • • •••• •• •••• ••• •••••• •• ••• •••• •••• • • •••• ••• •••• ••• ••••• • •• ••• ••• ••• •• • • ••• • • -3 -2 -1 0 1 2 Residuals 10 - 23 Ozone Data esti SARIMA(1, 0, 1)(0, 1, 1)12 Model No Transformation (Model 3) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 ar: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • • • 4 • •• • • • • • • • • • • • • • • •• • • • • • • • • • • • •• • • • • • • • • • • • • • • • •• •• • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • •• • • • • • • • • • • • •• • • • • •• •• • • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • • •• • • • • • • • • • • • • • • •• • • • • • • •• • • •• • • 0 2 • • • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • •• • •• ••• ••• •• •••• •• ••• •••• • ••• •••• ••• •• • • • • ••• ••• ••• •••• ••• • • •••• ••• •• • •• ••• ••• •• • • •• • •• • • • -3 -2 -1 0 1 2 Residuals 10 - 24 Summary of Models Fit to the Ozone Data 10 - 25 Module 10 Segment 3 Seasonal Model Estimation and Forecasting for the Ozone Data Using a Log Transformation and Filter Representation of the Models 10 - 26 Summary of Models Fit to the Ozone Data 10 - 27 Ozone Data esti SARIMA(0, 1, 1)(0, 1, 1)12 Model Log Transformation (Model 8) Output Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ndiff= 1 ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= log( pphm ) -0.2 -0.8 -0.6 -0.4 Residuals 0.0 0.2 0.4 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time • • • • • • • • • • • • • • •• ••• • • • • •• • • • • • • •• • • • • • • • •• • • • • ••• • • •• • •• • • • • • • • • • • • • •• • • •• • •• • • • • • • • •• • • • •• • • • • • • •• • •• • •• • • •• • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • •• • • • • • • •• • • • • • • • • •• • • • • -0.6 • • 0.5 • •• •• •• • • • • •• • • • • 0.0 • • • • • • -0.5 • • -0.4 -0.2 • • • • • • 0.5 1.0 1.5 Fitted Values 2.0 -1.0 • -0.8 Residuals 0.0 0.2 • ACF 0.4 • • Residual ACF 1.0 Residuals vs. Fitted Values 0 10 20 30 Lag 10 - 28 Ozone Data esti SARIMA(0, 1, 1)(0, 1, 1)12 Model No Transformation (Model 4) Output Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ndiff= 1 ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm 0 -1 -3 -2 Residuals 1 2 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time • 2 • 0.5 • • •• • • • • •• • •• • • • •• • • • • •• • • •• • • • •• • • • • • •• • • ••• • • • • • • • • ••• • • • • • • • • • • -2 • • -0.5 •• • • • • • • • • • 2 4 6 Fitted Values 0.0 0 -1 • • • •• • • •• •• • • • • •• • • •• •• • •• • •• • • • • • • • • • •• •• • • • •• • • • • •• • • • • • • •• • •• ••• • • • • • •• • ••• • •• •• • • • • • • • • • • • • • • • • • -3 Residuals • • • • ACF 1 • • • • • • 8 -1.0 •• • Residual ACF 1.0 Residuals vs. Fitted Values 0 10 20 30 Lag 10 - 29 Ozone Data esti SARIMA(0, 1, 1)(0, 1, 1)12 Model Log Transformation (Model 8) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ndiff= 1 ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= log( pphm ) Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • 4 • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • •• • • • • •• • • • • • • • • • • • •• • • • • • • •• • • •• • • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • •• • • • • • • • • • • •• • •• •• • • • • • •• • •• • • • • 0 2 • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • • ••• ••• ••• •• •• • ••• • ••• •••• •••• • • • •• ••• ••• ••• ••• • • • ••••• •••••• •••• ••••• • •••• •••• •••• ••• • • • • •• • • •• • • •• • -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 Residuals 10 - 30 Ozone Data esti SARIMA(0, 1, 1)(0, 1, 1)12 Model No Transformation (Model 4) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ndiff= 1 ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • 4 • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • •• •• • • • • • • • • •• •• • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • •• •• • •• • • • • • • • • •• •• • • • • • • • • •• • • • • • •• • • 0 2 • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • • • •• •• • • • • • •• •• • • • •• • ••• ••• •••• • • • •••• •• ••• ••• •••• • •••• ••• ••• •••• • • • ••• •••• ••••• ••• ••• • •• ••• • • -3 -2 -1 0 1 2 Residuals 10 - 31 Innovation to Realization Filter Innovations Realization Process or Model at ψ(B) Zt Model: (1 − B12)Zt = (1 − θ1B)(1 − Θ1B12)at (1 − θ1B)(1 − Θ1B12) Zt = at = ψ(B)at 12 (1 − B ) Zt = at + ψ1at−1 + ψ2at−2 + · · · The ψ weights provide a useful characterization of the time series model/filter. 10 - 32 Realization to Residual Filter Realization Zt Residuals Specified Model at π (B) Model: (1 − B12)Zt = (1 − θ1B)(1 − Θ1B12)at (1 − B12) Zt = π(B)Zt at = (1 − θ1B)(1 − Θ1B12) at = Zt − π1Zt−1 − π2Zt−2 − · · · Note: 1 π(B) = ψ(B) 10 - 33 Module 10 Segment 4 Introduction to Time Series Intervention Models 10 - 34 General Applications of Time Series Intervention Models Include regression (usually dummy variables) terms to account for permanent or temporary changes in a process. Some general applications: • Test to see if a process intervention had an important effect on the process • Modeling changes in a process • Accomodating outliers (accomodation) • Imputing missing observations (imputation) • Modeling other aberrations in time series data 10 - 35 Specific Applications of Time Series Intervention Models Some Applications include accounting for the effect of: • The “Energy Crisis” (1974) • 9/11 • The serious recession of 2008 • A labor strike • The political party in power • Promotional events (e.g., advertising) on sales 10 - 36 Colgate Toothpaste Market Share Colgate Market Share 0.5 Percent 0.4 0.3 0.2 0.1 1958 1959 1960 1961 1962 1963 Year 10 - 37 Crest Toothpaste Market Share Crest Market Share 0.5 Percent 0.4 0.3 0.2 0.1 1958 1959 1960 1961 1962 1963 year 10 - 38 US Monthly Airline Passenger-Miles 1996-2005 US Monthly Airline Passenger−Miles 1996−2005 55 50 Passenger−Miles 45 40 35 30 1996 1998 2000 2002 2004 Month 10 - 39 US Retail Sales 1992-2015 US Retail Sales 1992−2015 450 400 Billions of Dollars 350 300 250 200 150 1995 2000 2005 2010 2015 Year 10 - 40 Los Angeles Ozone Data Monthly Averages 1955-1972 Monthly Average of Hourly Readings of Ozone in Downtown Los Angeles 8 pphm 6 4 2 1955 1960 1965 1970 Year 10 - 41 Changes in the Ozone Process • Golden State Freeway opened January 1960 • Starting in 1966 all new cars had to have air pollution controls I1t = ( 0, t < January 1960, 1, t ≥ January 1960, I2t = ( 1, June-October (warm months) beginning 1966, 0, otherwise, I3t = ( 1, November-May (cool months) beginning 1966, 0, otherwise, 10 - 42 Los Angeles Ozone Data Monthly Averages 1955-1972 Monthly Average of Hourly Readings of Ozone in Downtown Los Angeles 8 pphm 6 4 2 1955 1960 1965 1970 Year 10 - 43 Los Angeles Ozone Data Monthly Averages 1955-1972 Monthly Average of Hourly Readings of Ozone in Downtown Los Angeles 8 pphm 6 4 2 1955 1960 1965 1970 Year 10 - 44 Possible Input Variables for Intervention Analysis • Step function beginning at time T (T ) St ( = 0, t < T, 1, t ≥ T, Example with T = 10 t 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (10) St 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 • Impulse (or pulse) function at time T (T ) Pt (T ) = (1 − B)St (T ) = St (T ) − St−1 = ( 1, t = T, 0, otherwise, Example with T = 10 t 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (10) Pt 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 10 - 45 Possible Input Variables for Intervention Analysis • Step function beginning at time T (T ) St = ( 0, t < T, 1, t ≥ T, Example with T = 10 t 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (10) St 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 • Ramp function beginning at time T (T ) Rt = (T ) St (1 − B) (T ) (T ) = Rt−1 + St = ( t − T + 1, t ≥ T, 0, otherwise, Example with T = 10 t 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (10) Rt 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 10 - 46 Response to Different Kinds of Inputs Model Term ω1Bk ω1 B k (1−B) ω1 B k (1−δ1B) (T ) Pulse ω1 Step ω1 100δ1 percent increase (decay) from ω1 to original level (T ) Step ω1 Ramp ω1 per unit time 100δ1 percent increase (decay) ω1 from ω1 to (1−δ ) Input Pt St 1 (T ) 0 < δ1 < 1 Ramp ω1 per unit time The numerator B k provides a k-period delay in the tion effect. With 0 ≤ δ1 ≤ 1, if ω1 is positive, exponential (percent) increase or linear ramp-up. negative, we have exponential (percent) decrease ramp-down. Rt intervenwe have If ω1 is or linear 10 - 47 Module 10 Segment 5 Intervention Modeling Strategy and Model for the Ozone Data with no Transformation 10 - 48 Strategy for Identifying Intervention Models • Look at plot of the time series realization and check times of the external events. • Fit a univariate ARIMA/SARIMA model to the data. Examine residuals, especially around the time of the external events; use as a preliminary noise model. • Consider the underlying mechanisms related to the event and their possible effect. • Identify appropriate terms to describe the effect of the intervention. 10 - 49 Seasonal (Preliminary Noise) Model for the Ozone Data (1 − B12)Zt = (1 − θ1B)(1 − Θ1B12) at (1 − θ1B)(1 − Θ1B12) Zt = at = ψN (B) at = Nt (1 − B12) Unscrambled model Zt = Zt−12 − θ1at−1 − Θ1at−12 + θ1Θ1at−13 + at 10 - 50 Dummy Variables and “Integrated” Dummy Variables t 1 2 .. 60 61 62 .. 137 138 139 140 141 142 143 144 I1t I2t I3t I2t ∗ = I2t (1−B12) I3t ∗ = I3t (1−B12) 0 0 .. 0 1 1 .. 1 1 1 1 1 1 1 1 0 0 .. 0 0 0 .. 0 1 1 1 1 1 0 0 0 0 .. 0 0 0 .. 0 0 0 0 0 0 1 1 0 0 .. 0 0 0 .. 0 1 1 1 1 1 0 0 0 0 .. 0 0 0 .. 0 0 0 0 0 0 1 1 freeway opens automobile emissions law in effect Continued 10 - 51 Dummy Variables and “Integrated” Dummy Variables t 145 146 147 148 149 150 151 152 .. 216 217 218 .. 236 237 238 239 240 I1t I2t I3t ∗ = I2t I2t 1−B12 ∗ = I3t I3t 1−B12 1 1 1 1 1 1 1 1 .. 1 1 1 .. 1 1 1 1 1 0 0 0 0 0 1 1 1 .. 0 0 0 .. 1 1 1 0 0 1 1 1 1 1 0 0 0 .. 1 1 1 .. 0 0 0 1 1 0 0 0 0 0 2 2 2 .. 0 0 0 .. 9 9 9 0 0 1 1 1 1 1 0 0 0 .. 7 7 7 .. 0 0 0 9 9 last observation dummy variables for forecasting 10 - 52 Seasonal Intervention Model for the Ozone Data Zt = ω2 ω3 (1 − θ1 B)(1 − Θ1B12 ) ω1 I1t + I2t + I3t + at (1 − B12 ) (1 − B12) (1 − B12 ) Zt = ω1 I1t + ω2 ω3 I + I3t + Nt 2t (1 − B12 ) (1 − B12) Unscrambled model (1 − B12 )Zt Zt = = ω1 (1 − B12 )I1t + ω2 I2t + ω3 I3t + (1 − θ1 B)(1 − Θ1 B12 ) at Zt−12 + ω1 (I1t − I1t−12 ) + ω2 I2t + ω3 I3t − θ1 at−1 − Θ1at−12 + θ1 Θ1at−13 + at 10 - 53 Ozone Intervention Model Zt = Ut + Nt Zt = ω1 I1t + ω3 ω2 I + I3t + Nt 2t (1 − B12 ) (1 − B12) Zt = ω1 I1t + ω2 ω3 (1 − θ1 B)(1 − Θ1B12 ) I + I + at 2t 3t (1 − B12 ) (1 − B12) (1 − B12 ) at 12 (1-θ B) (1- Θ B ) ________________ I 1t 12 (1-B ω1 ) Nt ω2 _______ I 2t I 3t 12 (1-B ) ut Zt ω3 _______ 12 (1-B ) 10 - 54 Ozone SARIMA(0, 1, 1)(0, 1, 1)12 Intervention Model No Transformation (Model 9) Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm regr variables= ozo.xreg 0 -2 -1 Residuals 1 2 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time • • • • • • • •••• • • • • • • • • •• • • • •• •• • •• • • • • • •• •• • • • • • • • • • • • • • • • •• • • • • • • • •• • • • • • • • 2 4 6 Fitted Values 0.0 • • • • • • • • • • •• • • • •••• • • •• • • • • •• • • • • • • • • • • •• • ••• •• • • • • • • • • • • • • • • • •• • • • • •• •• • •• • • •• • • ••• • • • •• • • • • • • •• • • • • • • -0.5 • •• • • • • •• 8 -1.0 • 0.5 • •• • • ACF 2 • • 1 0 Residuals • • • -1 • • -2 Residual ACF 1.0 Residuals vs. Fitted Values 0 10 20 30 Lag 10 - 55 Ozone SARIMA(0, 1, 1)(0, 1, 1)12 Intervention Model No Transformation (Model 9) Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm regr variables= ozo.xreg Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • 4 • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • •• • • • •• • • • • • • • • •• • • • • • •• •• • • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • • • • • • • • • • • •• •• • • • • • • • • • • • • • •• • • • • 0 2 • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • • •• •• ••• •• •• • • • • ••• ••• •••• ••• • • • •••• •••• •• ••• • • • •••• ••• ••••• •••• • • • •••• ••• ••• •••• •• • • •• •• • •• • • -2 -1 0 1 2 Residuals 10 - 56 Ozone Data esti SARIMA(0, 1, 1)(0, 1, 1)12 Model No Transformation (Model 4) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ndiff= 1 ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • 4 • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • •• •• • • • • • • • • •• •• • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • •• •• • •• • • • • • • • • •• •• • • • • • • • • •• • • • • • •• • • 0 2 • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • • • •• •• • • • • • •• •• • • • •• • ••• ••• •••• • • • •••• •• ••• ••• •••• • •••• ••• ••• •••• • • • ••• •••• ••••• ••• ••• • •• ••• • • -3 -2 -1 0 1 2 Residuals 10 - 57 Module 10 Segment 6 Intervention Model for the Ozone Data with a Log Transformation and the Unscrambled Models 10 - 58 Ozone SARIMA(0, 1, 1)(0, 1, 1)12 Intervention Model Log Transformation (Model 10) Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= log( pphm ) regr variables= ozo.xreg 0.2 0.0 -0.6 -0.2 Residuals 0.4 0.6 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time Residual ACF 1.0 Residuals vs. Fitted Values 0.6 • • • • • •• • •• • • • • • •• •• • • •• • •• • •• • • •• • • •• • • •• •• • • • • •• • • 0.5 • • • • 0.5 1.0 1.5 Fitted Values • 0.0 • • • -0.4 -0.2 • • • • •• • • • • • •• • • • • • • • •• • • • • • • • • • ••• • • • • • • • • • • • • •• • • •• • ••• • • • • •• •• • • • • • • • • •• • • •• • • • • • • •• • • • • • • • • • • • • •• • • • • • •• • •• • • • • • • • • • • •• • • • • • -0.5 • • • • • -1.0 0.0 •• • • • • -0.6 Residuals 0.2 • • ACF 0.4 • • 2.0 0 10 20 30 Lag 10 - 59 Ozone SARIMA(0, 1, 1)(0, 1, 1)12 Intervention Model No Transformation (Model 9) Part 1 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm regr variables= ozo.xreg 0 -2 -1 Residuals 1 2 Residuals vs. Time 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 Time • • • • • • • •••• • • • • • • • • •• • • • •• •• • •• • • • • • •• •• • • • • • • • • • • • • • • • •• • • • • • • • •• • • • • • • • 2 4 6 Fitted Values 0.0 • • • • • • • • • • •• • • • •••• • • •• • • • • •• • • • • • • • • • • •• • ••• •• • • • • • • • • • • • • • • • •• • • • • •• •• • •• • • •• • • ••• • • • •• • • • • • • •• • • • • • • -0.5 • •• • • • • •• 8 -1.0 • 0.5 • •• • • ACF 2 • • 1 0 Residuals • • • -1 • • -2 Residual ACF 1.0 Residuals vs. Fitted Values 0 10 20 30 Lag 10 - 60 Ozone SARIMA(0, 1, 1)(0, 1, 1)12 Intervention Model No Transformation (Model 9) Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= pphm regr variables= ozo.xreg Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • 4 • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • •• • • • •• • • • • • • • • •• • • • • • •• •• • • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • • • • • • • • • • • •• •• • • • • • • • • • • • • • •• • • • • 0 2 • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • • •• •• ••• •• •• • • • • ••• ••• •••• ••• • • • •••• •••• •• ••• • • • •••• ••• ••••• •••• • • • •••• ••• ••• •••• •• • • •• •• • •• • • -2 -1 0 1 2 Residuals 10 - 61 Ozone SARIMA(0, 1, 1)(0, 1, 1)12 Intervention Model Log Transformation (Model 10) Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= log( pphm ) regr variables= ozo.xreg Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • 4 • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • •• • • • • •• • • • • • • • • • • • •• • • • • • • •• • • • •• • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • •• •• • • • • • • • • • • • • • • •• •• • • • • • •• •• • • • • • • • 0 2 • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • •• •• •• •• ••• • • •• •• •••• ••• • • ••• •• ••• ••• •• •• • ••••• •••••• ••• ••••• • • • • ••• •••• ••• ••• • •• •• ••• •• • • • -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 Residuals 10 - 62 Ozone Data esti SARIMA(0, 1, 1)(0, 1, 1)12 Model Log Transformation (Model 8) Output Part 2 Monthly Average of Hourly Readings of Ozone on Downtown Los Angeles Model: Component 1 :: ndiff= 1 ma: 1 Component 2 :: period= 12 ndiff= 1 ma: 1 on w= log( pphm ) Actual Values * * * Fitted Values * * * Future Values * * 95 % Prediction Interval * * • 8 • • • • • 6 • pphm • • • • • 4 • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• • • • • • • • • • • • • • • •• • • • • •• • • • • • • • • • • • •• • • • • • • •• • • •• • • • • • • • • •• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• • • •• • • • • • • • • • • • • •• •• • •• • • • • • • • • • • •• • •• •• • • • • • •• • •• • • • • 0 2 • • • • • • • 1960 1965 1970 1975 Index 3 Normal Probability Plot 0 -1 -2 Normal Scores 1 2 • • -3 1955 • • ••• ••• ••• •• •• • ••• • ••• •••• •••• • • • •• ••• ••• ••• ••• • • • ••••• •••••• •••• ••••• • •••• •••• •••• ••• • • • • •• • • •• • • •• • -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 Residuals 10 - 63 Summary of Models Fit to the Ozone Data 10 - 64 Unscrambled Seasonal Intervention Models Overall: Zt = Zt−12 + ω1 (I1t − I1t−12 ) + ω2 I2t + ω3 I3t − θ1 at−1 − Θ1at−12 + θ1 Θ1at−13 + at Before 1960 and between 1961 and 1966 Zt = Zt−12 − θ1at−1 − Θ1at−12 + θ1Θ1at−13 + at In 1960 Zt = Zt−12 + ω1 − θ1at−1 − Θ1at−12 + θ1Θ1at−13 + at All warm months after 1966 Zt = Zt−12 + ω2 − θ1at−1 − Θ1at−12 + θ1Θ1at−13 + at All cool months after 1966 Zt = Zt−12 + ω3 − θ1at−1 − Θ1at−12 + θ1Θ1at−13 + at 10 - 65 Unscrambled Seasonal Intervention Models Overall: Zt = Zt−12 + ω1(I1t − I1t−12 ) + ω2I2t + ω3 I3t + Nt Before 1960 and between 1961 and 1966 Zt = Zt−12 + Nt In 1960 Zt = Zt−12 + ω1 + Nt All warm months after 1966 Zt = Zt−12 + ω2 + Nt All cool months after 1966 Zt = Zt−12 + ω3 + Nt 10 - 66