1# xzq_whu
5 Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.2 Linear models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.2.2 Stationarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.2.3 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.3 Fitted models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.3.1 Model fitted to simulated data . . . . . . . . . . . . . . . . . . . . . . 94
5.3.2 Model fitted to the temperature series (1970–2005) . . . . 95
5.3.3 Autocorrelation and the estimation of sample statistics* 96
5.4 Generalised least squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.4.1 GLS fit to simulated series . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.4.2 Confidence interval for the trend in the temperature
series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.5 Linear models with seasonal variables . . . . . . . . . . . . . . . . . . . . . . 99
5.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.5.2 Additive seasonal indicator variables . . . . . . . . . . . . . . . . . 99
5.5.3 Example: Seasonal model for the temperature series . . . 100
5.6 Harmonic seasonal models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.6.1 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.6.2 Fit to simulated series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.6.3 Harmonic model fitted to temperature series (1970–2005)105
5.7 Logarithmic transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.7.2 Example using the air passenger series . . . . . . . . . . . . . . . 109
5.8 Non-linear models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
5.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
5.8.2 Example of a simulated and fitted non-linear series . . . . 113
xii Contents
5.9 Forecasting from regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.9.2 Prediction in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.10 Inverse transform and bias correction . . . . . . . . . . . . . . . . . . . . . . 115
5.10.1 Log-normal residual errors . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.10.2 Empirical correction factor for forecasting means . . . . . . 117
5.10.3 Example using the air passenger data . . . . . . . . . . . . . . . . 117
5.11 Summary of R commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
5.12 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
6 Stationary Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.2 Strictly stationary series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.3 Moving average models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
6.3.1 MA(q) process: Definition and properties . . . . . . . . . . . . . 122
6.3.2 R examples: Correlogram and simulation . . . . . . . . . . . . . 123
6.4 Fitted MA models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
6.4.1 Model fitted to simulated series . . . . . . . . . . . . . . . . . . . . . 124
6.4.2 Exchange rate series: Fitted MA model . . . . . . . . . . . . . . 126
6.5 Mixed models: The ARMA process . . . . . . . . . . . . . . . . . . . . . . . . 127
6.5.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.5.2 Derivation of second-order properties* . . . . . . . . . . . . . . . 128
6.6 ARMA models: Empirical analysis . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.6.1 Simulation and fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.6.2 Exchange rate series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.6.3 Electricity production series . . . . . . . . . . . . . . . . . . . . . . . . 130
6.6.4 Wave tank data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.7 Summary of R commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
7 Non-stationary Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
7.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
7.2 Non-seasonal ARIMA models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
7.2.1 Differencing and the electricity series . . . . . . . . . . . . . . . . 137
7.2.2 Integrated model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
7.2.3 Definition and examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
7.2.4 Simulation and fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
7.2.5 IMA(1, 1) model fitted to the beer production series . . . 141
7.3 Seasonal ARIMA models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
7.3.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
7.3.2 Fitting procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
7.4 ARCH models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
7.4.1 S&P500 series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
7.4.2 Modelling volatility: Definition of the ARCH model . . . . 147
7.4.3 Extensions and GARCH models . . . . . . . . . . . . . . . . . . . . . 148
Contents xiii
7.4.4 Simulation and fitted GARCH model . . . . . . . . . . . . . . . . 149
7.4.5 Fit to S&P500 series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
7.4.6 Volatility in climate series . . . . . . . . . . . . . . . . . . . . . . . . . . 152
7.4.7 GARCH in forecasts and simulations . . . . . . . . . . . . . . . . 155
7.5 Summary of R commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
7.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
8 Long-Memory Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
8.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
8.2 Fractional differencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
8.3 Fitting to simulated data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
8.4 Assessing evidence of long-term dependence . . . . . . . . . . . . . . . . . 164
8.4.1 Nile minima . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
8.4.2 Bellcore Ethernet data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
8.4.3 Bank loan rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
8.5 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
8.6 Summary of additional commands used . . . . . . . . . . . . . . . . . . . . 168
8.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168