Sie sind auf Seite 1von 8

Time series and forecasting in R

Time series and forecasting in R

Outline Time series and forecasting in R


Rob J Hyndman
4 1

Time series objects Basic time series functionality The forecast package Exponential smoothing ARIMA modelling More from the forecast package Time series packages on CRAN

29 June 2008

Time series and forecasting in R

Time series objects

Time series and forecasting in R

Time series objects

Australian GDP
ausgdp <- ts(scan("gdp.dat"),frequency=4, start=1971+2/4) Class: ts Print and plotting methods available. > ausgdp Qtr1 Qtr2 Qtr3 Qtr4 1971 4612 4651 1972 4645 4615 4645 4722 1973 4780 4830 4887 4933 1974 4921 4875 4867 4905 1975 4938 4934 4942 4979 1976 5028 5079 5112 5127 1977 5130 5101 5072 5069 1978 5100 5166 5244 5312 1979 5349 5370 5388 5396 1980 5388 5403 5442 5482
Time series and forecasting in R Time series objects 6

Australian GDP
7500 ausgdp 4500 5000 5500 6000 6500 7000

> plot(ausgdp)

1975

1980

1985 Time

1990

1995

Time series and forecasting in R

Time series objects

Australian beer production

Australian beer production


180

> beer Jan 1991 164 1992 147 1993 139 1994 151 1995 138

Feb 148 133 143 134 136

Mar 152 163 150 164 152

Apr 144 150 154 126 127

May 155 129 137 131 151

Jun 125 131 129 125 130

Jul 153 145 128 127 119

Aug 146 137 140 143 153

120

140

Sep 138 138 143 143

Oct 190 168 151 160

Nov 192 176 177 190

Dec 192 188 184 182

beer

160

> plot(beer)
1991 1992 1993 Time 1994 1995

Time series and forecasting in R

Basic time series functionality

Time series and forecasting in R

Basic time series functionality

10

Lag plots
> lag.plot(beer,lags=12)
100 180 120 140
12 24 48 36 3523 22 39 1 15 34 9

Lag plots
180
47

160

200
11 10 12 47 11 24 36 48 35 23 10

100

120

140
11 47 35

160
12 36

180

200

10 24 48 23

160 beer

22 46 39 1 15 46 5 28 7 51 3 37 34 16 27 2 13 8 19 26 44 33 45 32 25 49 9 20 21 14 18 30 17 54 31 43 426

22 39 15 1 46 5 7 328 51 37 53 16 34 27 13 2 8 19 4 26 45 33 44 32 25 49 21 9 29 20 50 38 14 18 41 30 31 43 52 40 17 6 42

beer

120

54 41 30 17 4240

5 28 37 51 5337 16 27 2 1319 8 33 4 45 44 26 32 21 29 49 20 25 50 38 14 18 31 43 52 6 55

53 4

beer

41 40 52

29 50 38

lag 1
10 36 48 23 22 39 1 15 46 5 28 3 37 34 16 227 13 26 45 4 33 25 2129 9 49 38 50 14 17 41 30 40 52 35 12 47 24 11 12 47 24 36 35 1 37 15 39

lag 2
11 48 23 22 10 11 12 24 36 48 35 23 15 39 3

lag 3
10 47

beer

beer

46

beer

46 34 37 49

51

7 19 44 32 20 8

18 42

lag 4
11 10 47 24 48 36 3523 22 12 47

lag 5
10 12 11 24 36 48 35 23 22 22

lag 6
11 12 10 47 24 36 35 23

160 beer

180

beer

46 7 34 33 45 37 27 2 13 19 26 44 25 2021 949 38 14 18 30 31 43 42 6

28 16 8 32 29

5 3 4 41 17 40

34

120

46 5 7 37 13 8 19 26 45 4433 329 21 25 29 20 38 14 18 3041 17 31 43 642

beer

39 15

15 27

39 28 3 16 2 4

46 5 34 16 8 33 45 32 929 21 20 31 43 28 7 19 4 44 25 37 13 26 14 30 6

39 15 1 27 3 2

140

40

41 17 18 40 42

38

lag 7
11 10 35 23 22 39 15 7 28 8 19 45 33 444 32 21 20 30 31 42 40 1 46 5 13 26 9 18 41 17 43 6 29 25 38 14 37 2 22 39 15 12 24 36 10

lag 8
11 12 24 36 23 35 1 28 4 37 13 25

lag 9
10 11

23 22 39 115 3 37 7 16 3427 2 13 19 268 33 444 32 25 21 29 9 20 38 14 18 41 31 17 43 30 40 6 42 285

35

beer

beer

34 16 3 27

lag 10

100

120

140

lag 11 160

180

200

lag 12

> lag.plot(beer,lags=12,do.lines=FALSE)
100 120 140 160 180 200 100 120 140 160 180 200

120

5 73 27 34 216 8 19 33 26 45 44 32 29 20 921 38 14 4130 18 17 31 43 40 6 42

beer

140

160

180

12 24 36

120

31

43 6

5 283 51 7 34 16 27 13 8 2 19 4 26 33 45 44 25 499 2021 32 29 50 38 14 41 17 18 30 43 31 40 6 42

5 7 28 16 272 8 19 13 4 45 33 4426 25 32 20 21 9 29 50 14 38 18 17 30 41 31 40 43 6 42

140

160

22 1

lag.plot(x, lags = 1, layout = NULL, set.lags = 1:lags, main = NULL, asp = 1, diag = TRUE, diag.col = "gray", type = "p", oma = NULL, ask = NULL, do.lines = (n <= 150), labels = do.lines, ...)

140

180

Time series and forecasting in R

Basic time series functionality

11

Time series and forecasting in R

Basic time series functionality

12

ACF
1.0

PACF
0.4

> acf(beer)

> pacf(beer)

0.6

0.8

Partial ACF 0.0 0.2 0.4 0.6 Lag 0.8 1.0 1.2 1.4

ACF

0.2

0.4

0.0

0.4

0.2

0.2

0.0

0.2

0.2

0.4

0.6

0.8 Lag

1.0

1.2

1.4

Time series and forecasting in R

Basic time series functionality

13

Time series and forecasting in R

Basic time series functionality

14

ACF/PACF
500.0 100.0

Spectrum
Raw periodogram

> spectrum(beer)

ARMAacf(ar = numeric(0), ma = numeric(0), lag.max = r, pacf = FALSE)

0.2 0

0.5

2.0

5.0

pacf(x, lag.max, plot, na.action, ...)

spectrum

20.0

acf(x, lag.max = NULL, type = c("correlation", "covariance", "partial"), plot = TRUE, na.action = na.fail, demean = TRUE, ...)

3 frequency

Time series and forecasting in R

Basic time series functionality

15

Time series and forecasting in R

Basic time series functionality

16

Spectrum
AR(12) spectrum
500 1000

Spectrum
> spectrum(beer,method="ar")

spectrum(x, ..., method = c("pgram", "ar")) spec.pgram(x, spans = NULL, kernel, taper = 0.1, pad = 0, fast = TRUE, demean = FALSE, detrend = TRUE, plot = TRUE, na.action = na.fail, ...) spec.ar(x, n.freq, order = NULL, plot = TRUE, na.action = na.fail, method = "yule-walker", ...)
0 1 2 3 frequency 4 5 6

spectrum

Time series and forecasting in R

10

20

50

100

200

Basic time series functionality

17

Time series and forecasting in R

Basic time series functionality

18

Classical decomposition
decompose(beer) Decomposition of additive time series
observed
190

STL decomposition
plot(stl(beer,s.window="periodic"))
data seasonal
160 120

130

160

40 146 150 154

trend

seasonal

trend

20

0 10 20

146

152

158

remainder

random

20

1991

1992

1993

1994

1995

1991

1992

1993

1994

1995

Time

time

15

15

20

20

Time series and forecasting in R

Basic time series functionality

19

Time series and forecasting in R

The forecast package

21

Decomposition
decompose(x, type = c("additive", "multiplicative"), filter = NULL) stl(x, s.window, s.degree = 0, t.window = NULL, t.degree = 1, l.window = nextodd(period), l.degree = t.degree, s.jump = ceiling(s.window/10), t.jump = ceiling(t.window/10), l.jump = ceiling(l.window/10), robust = FALSE, inner = if(robust) 1 else 2, outer = if(robust) 15 else 0, na.action = na.fail)

forecast package
> forecast(beer) Point Forecast Sep 1995 138.5042 Oct 1995 169.1987 Nov 1995 181.6725 Dec 1995 178.5394 Jan 1996 144.0816 Feb 1996 135.7967 Mar 1996 151.4813 Apr 1996 138.9345 May 1996 138.5279 Jun 1996 127.0269 Jul 1996 134.9452 Aug 1996 145.3088 Sep 1996 139.7348 Oct 1996 170.6709 Nov 1996 183.2204 Dec 1996 180.0290 Jan 1997 145.2589 Feb 1997 136.8833 Mar 1997 152.6684 Apr 1997 140.0008 May 1997 139.5691 Time series and forecasting in R Jun 1997 127.9620 Jul 1997 135.9181 Aug 1997 146.3349 Lo 80 128.2452 156.6506 168.1640 165.2049 133.2492 125.4937 139.8517 128.1106 127.5448 116.7486 123.7716 132.9658 127.4679 155.2397 166.1298 162.6798 130.7803 122.7595 136.3514 124.4953 123.5476 112.7364 119.1567 127.6354 Hi 80 148.7632 181.7468 195.1810 191.8738 154.9140 146.0996 163.1110 149.7584 149.5110 137.3052 146.1187 157.6518 152.0018 186.1020 200.3110 197.3783 159.7374 151.0071 168.9854 155.5064 155.5906 143.1876 152.6795 165.0344 Lo 95 122.8145 150.0081 161.0131 158.1461 127.5148 120.0396 133.6953 122.3808 121.7307 111.3076 117.8567 126.4318 120.9741 147.0709 157.0826 153.4957 123.1159 115.2828 127.7137 116.2871 115.0663 104.6764 110.2837 117.7365 Hi 95 154.1940 188.3894 202.3320 198.9327 160.6483 151.5537 169.2673 155.4882 155.3250 142.7462 152.0337 164.1858 158.4955 194.2708 209.3582 206.5624 167.4019 158.4838 177.6231 163.7145 164.0719 The forecast package 151.2476 161.5525 174.9332

Time series and forecasting in R

The forecast package

22

23

forecast package
Forecasts from ETS(M,Ad,M)
200

forecast package
> summary(forecast(beer)) Forecast method: ETS(M,Ad,M) Smoothing alpha = beta = gamma = phi = parameters: 0.0267 0.0232 0.025 0.98

> plot(forecast(beer))

140

160

180

Initial states: l = 162.5752 b = -0.1598 s = 1.1979 1.2246 1.1452 0.9354 0.9754 0.9068 0.8523 0.9296 0.9342 1.0160 0.9131 0.9696
1991 1992 1993 1994 1995 1996 1997

100

120

sigma:

0.0578

AIC AICc BIC 499.0295 515.1347 533.4604 In-sample error measures: ME RMSE MAE MPE 0.07741197 8.41555052 7.03312900 -0.29149125

Time series and forecasting in R

The forecast package

24

Time series and forecasting in R

MAPE MASE Exponential smoothing 26 4.78826138 0.43512047

forecast package
Automatic exponential smoothing state space modelling. Automatic ARIMA modelling Forecasting intermittent demand data using Crostons method Forecasting using Theta method Forecasting methods for most time series modelling functions including arima(), ar(), StructTS(), ets(), and others. Part of the forecasting bundle along with fma, expsmooth and Mcomp.

Exponential smoothing
Classic Reference Makridakis, Wheelwright and Hyndman (1998) Forecasting: methods and applications, 3rd ed., Wiley: NY. Current Reference Hyndman, Koehler, Ord and Snyder (2008) Forecasting with Forecasting with Exponential exponential smoothing: the state Smoothing space approach, Springer-Verlag: Berlin.
Springer Series in Statistics
Hyndman Koehler Ord Snyder

Springer Series in Statistics

Rob J. Hyndman Anne B. Koehler J. Keith Ord Ralph D. Snyder

Forecasting with Exponential Smoothing

Rob J. Hyndman Anne B. Koehler J. Keith Ord Ralph D. Snyder

Exponential smoothing methods have been around since the 1950s, and are the most popular forecasting methods used in business and industry. Recently, exponential smoothing has been revolutionized with the introduction of a complete modeling framework incorporating inno-vations state space models, likelihood calculation, prediction intervals and procedures for model selection. In this book, all of the important results for this framework are brought together in a coherent manner with consistent notation. In addition, many new results and extensions are introduced and several application areas are examined in detail. Rob J. Hyndman is a Professor of Statistics and Director of the Business and Economic Forecasting Unit at Monash University, Australia. He is Editor-in-Chief of the International Journal of Forecasting, author of over 100 research papers in statistical science, and received the 2007 Moran medal from the Australian Academy of Science for his contributions to statistical research. Anne B. Koehler is a Professor of Decision Sciences and the Panuska Professor of Business Administration at Miami University, Ohio. She has numerous publications, many of which are on forecasting models for seasonal time series and exponential smoothing methods. J. Keith Ord is a Professor in the McDonough School of Business, Georgetown University, Washington DC. He has authored over 100 research papers in statistics and forecasting, and is a co-author of Kendall's Advanced Theory of Statistics. Ralph D. Snyder is an Associate Professor in the Department of Econometrics and Business Statistics at Monash University, Australia. He has extensive publications on business forecasting and inventory management. He has played a leading role in the establishment of the class of innovations state space models for exponential smoothing.

Forecasting with Exponential Smoothing

The State Space Approach

ISBN 9-783-540-71916-8

13

Time series and forecasting in R

Exponential smoothing

27

Time series and forecasting in R

Exponential smoothing

28

Exponential smoothing
Until recently, there has been no stochastic modelling framework incorporating likelihood calculation, prediction intervals, etc. Ord, Koehler & Snyder (JASA, 1997) and Hyndman, Koehler, Snyder and Grose (IJF, 2002) showed that all ES methods (including non-linear methods) are optimal forecasts from innovation state space models. Hyndman et al. (2008) provides a comprehensive and up-to-date survey of the area. The forecast package implements the framework of HKSO.

Exponential smoothing
Trend Component N A Ad M Md (None) (Additive) (Additive damped) (Multiplicative) (Multiplicative damped) N (None) N,N A,N Ad ,N M,N Md ,N Seasonal Component A M (Additive) (Multiplicative) N,A A,A Ad ,A M,A Md ,A N,M A,M Ad ,M M,M Md ,M

General notation ETS(Error,Trend,Seasonal) ExponenTial Smoothing ETS(A,N,N): ETS(A,A,N): ETS(A,A,A): Simple exponential smoothing with additive errors Holts linear method with additive errors Additive Holt-Winters method with

Time series and forecasting in R

Exponential smoothing

29

Time series and forecasting in R

Exponential smoothing

30

Innovations state space models


No trend or seasonality and multiplicative errors Example: ETS(M,N,N) yt = t 1 (1 + t ) t = yt + (1 ) = t 1 (1 + t )
t 1

Innovation state space models


Let xt = ( t , bt , st , st 1 , . . . , st m+1 ) and t N(0, 2 ). Example: Holt-Winters multiplicative seasonal method Example: ETS(M,A,M) Yt = ( t 1 + bt 1 )st m (1 + t ) t = (yt /st m ) + (1 )( t 1 + bt 1 ) bt = ( t t 1 ) + (1 )bt 1 st = (yt /( t 1 + bt 1 )) + (1 )st m where 0 1, 0 , 0 1 and m is the period of seasonality.
iid

01 t is white noise with mean zero. All exponential smoothing models can be written using analogous state space equations.

Time series and forecasting in R

Exponential smoothing

31

Time series and forecasting in R

Exponential smoothing

32

Exponential smoothing
From Hyndman et al. (2008): Apply each of 30 methods that are appropriate to the data. Optimize parameters and initial values using MLE (or some other criterion). Select best method using AIC: AIC = 2 log(Likelihood) + 2p where p = # parameters. Produce forecasts using best method. Obtain prediction intervals using underlying state space model. Method performed very well in M3 competition.

Exponential smoothing
fit <- ets(beer) fit2 <- ets(beer,model="MNM",damped=FALSE) fcast1 <- forecast(fit, h=24) fcast2 <- forecast(fit2, h=24)
ets(y, model="ZZZ", damped=NULL, alpha=NULL, beta=NULL, gamma=NULL, phi=NULL, additive.only=FALSE, lower=c(rep(0.01,3), 0.8), upper=c(rep(0.99,3),0.98), opt.crit=c("lik","amse","mse","sigma"), nmse=3, bounds=c("both","usual","admissible"), ic=c("aic","aicc","bic"), restrict=TRUE)

Time series and forecasting in R

Exponential smoothing

33

Time series and forecasting in R

Exponential smoothing

34

Exponential smoothing
> fit ETS(M,Ad,M) Smoothing alpha = beta = gamma = phi = parameters: 0.0267 0.0232 0.025 0.98

Exponential smoothing
> fit2 ETS(M,N,M) Smoothing parameters: alpha = 0.247 gamma = 0.01 Initial states: l = 168.1208 s = 1.2417 1.2148 1.1388 0.9217 0.9667 0.8934 0.8506 0.9182 0.9262 1.049 0.9047 0.9743 sigma: 0.0604

Initial states: l = 162.5752 b = -0.1598 s = 1.1979 1.2246 1.1452 0.9354 0.9754 0.9068 0.8523 0.9296 0.9342 1.016 0.9131 0.9696 sigma: 0.0578

AIC AICc BIC 500.0439 510.2878 528.3988

AIC AICc BIC 499.0295 515.1347 533.4604

Time series and forecasting in R

Exponential smoothing

35

Time series and forecasting in R

Exponential smoothing

36

Exponential smoothing
ets() function Automatically chooses a model by default using the AIC Can handle any combination of trend, seasonality and damping Produces prediction intervals for every model Ensures the parameters are admissible (equivalent to invertible) Produces an object of class ets.

Exponential smoothing
ets objects Methods: coef(), plot(), summary(), residuals(), fitted(), simulate() and forecast() plot() function shows time plots of the original time series along with the extracted components (level, growth and seasonal).

Time series and forecasting in R

Exponential smoothing

37

Time series and forecasting in R

Exponential smoothing

38

Exponential smoothing
plot(fit) Decomposition by ETS(M,Ad,M) method
observed

Goodness-of-t

160

level

155

> accuracy(fit) ME RMSE 0.0774 8.4156

120

MAE MPE 7.0331 -0.2915

MAPE 4.7883

MASE 0.4351

slope

> accuracy(fit2) ME RMSE MAE MPE -1.3884 9.0015 7.3303 -1.1945

0.5 145

MAPE 5.0237

MASE 0.4535

season

0.9 1991

1.1

1.0

0.0

1992

1993

1994

1995

Time

Time series and forecasting in R

Exponential smoothing

39

Time series and forecasting in R

Exponential smoothing

40

Forecast intervals
Forecasts from ETS(M,Ad,M)
200

Exponential smoothing
ets() function also allows retting model to new data set.
> usfit <- ets(usnetelec[1:45]) > test <- ets(usnetelec[46:55], model = usfit) > accuracy(test) ME RMSE MAE MPE -4.3057 58.1668 43.5241 -0.1023

140

160

180

120

MAPE 1.1758

MASE 0.5206

> plot(forecast(fit,level=c(50,80,95)))
1991 1992 1993 1994 1995 1996 1997

> accuracy(forecast(usfit,10), usnetelec[46:55]) ME RMSE MAE MPE MAPE MASE ACF1 Theils U 46.36580 65.55163 49.83883 1.25087 1.35781 0.72895 0.08899 0.73725

100

Forecasts from ETS(M,Ad,M)


200
Time series and forecasting in R

180

Exponential smoothing

41

Time series and forecasting in R

Exponential smoothing

42

160

forecast package
forecast() function Takes either a time series as its main argument, or a time series model. > Methods plot(forecast(fit,fan=TRUE)) for objects of class ts, ets, 1991 1992 1993 1994 1995 1996 1997 arima, HoltWinters, StructTS, ar and others. If argument is ts, it uses ets model. Calls predict() when appropriate. Output as class forecast.

forecast package
forecast class contains Original series Point forecasts Prediction intervals Forecasting method used Forecasting model information Residuals One-step forecasts for observed data Methods applying to the forecast class: print plot summary

Time series and forecasting in R

100

120

140

ARIMA modelling

44

Time series and forecasting in R

ARIMA modelling

45

ARIMA modelling
The arima() function in the stats package provides seasonal and non-seasonal ARIMA model estimation including covariates. However, it does not allow a constant unless the model is stationary It does not return everything required for forecast() It does not allow re-tting a model to new data. So I prefer the Arima() function in the forecast package which acts as a wrapper to arima(). Even better, the auto.arima() function in the forecast package.

ARIMA modelling
> fit <- auto.arima(beer) > fit Series: beer ARIMA(0,0,0)(1,0,0)[12] with non-zero mean Coefficients: sar1 intercept 0.8431 152.1132 s.e. 0.0590 5.1921 sigma^2 estimated as 122.1: log likelihood = -221.44 AIC = 448.88 AICc = 449.34 BIC = 454.95

Time series and forecasting in R

ARIMA modelling

46

Time series and forecasting in R

ARIMA modelling

47

How does auto.arima() work?


A seasonal ARIMA process (B m )(B )(1 B m )D (1 B )d yt = c + (B m )(B )t Need to select appropriate orders: p , q , P , Q , D , d Use Hyndman and Khandakar (JSS, 2008) algorithm: Select no. dierences d and D via unit root tests. Select p , q , P , Q by minimising AIC. Use stepwise search to traverse model space.

How does auto.arima() work?


AIC = 2 log(L) + 2(p + q + P + Q + k ) where L is the maximised likelihood tted to the dierenced data, k = 1 if c = 0 and k = 0 otherwise. Step 1: Select current model (with smallest AIC) from: ARIMA(2, d , 2)(1, D , 1)m ARIMA(0, d , 0)(0, D , 0)m ARIMA(1, d , 0)(1, D , 0)m if seasonal ARIMA(0, d , 1)(0, D , 1)m Step 2: Consider variations of current model: vary one of p , q , P , Q from current model by 1 p , q both vary from current model by 1. P , Q both vary from current model by 1. Include/exclude c from current model Model with lowest AIC becomes current model. Repeat Step 2 until no lower AIC can be found.

Time series and forecasting in R

ARIMA modelling

48

Time series and forecasting in R

ARIMA modelling

49

ARIMA modelling
Forecasts from ARIMA(0,0,0)(1,0,0)[12] with nonzero mean
200

ARIMA vs ETS
Myth that ARIMA models more general than exponential smoothing. Linear exponential smoothing models all special cases of ARIMA models. Non-linear exponential smoothing models have no equivalent ARIMA counterparts. Many ARIMA models which have no exponential smoothing counterparts. ETS models all non-stationary. Models with seasonality or non-damped trend (or both) have two unit roots; all other modelsthat is, non-seasonal models with either no trend or damped trendhave one unit root.

> plot(forecast(fit))

100 1991

120

140

160

180

1992

1993

1994

1995

1996

1997

Forecasts from ETS(M,Ad,M)


200 180

> plot(forecast(beer))
More from the forecast package 51 Time series and forecasting in R More from the forecast package 52

Time series and forecasting in R

120

140

160

Other forecasting functions


croston() implements Crostons (1972) method for intermittent demand forecasting. theta() provides forecasts from the Theta method. splinef() gives cubic-spline forecasts, based on 1991 1992 1995 1996 1997 tting1993 a cubic1994 spline to the historical data and extrapolating it linearly. meanf() returns forecasts based on the historical mean. rwf() gives na ve forecasts equal to the most recent observation assuming a random walk model.

Other plotting functions

tsdisplay() provides a time plot along with an ACF and PACF. seasonplot() produces a seasonal plot.

Time series and forecasting in R

100

More from the forecast package

53

Time series and forecasting in R

More from the forecast package

54

tsdisplay
> tsdisplay(beer)
q q q q q q q q q

seasonplot
> seasonplot(beer)
180
q q q q q q q q q

180

160

q q

q q q q q q q q q q q q q q q q q

q q q q q

140

q q q q q q q q q q

q q q

q q

160

q q q q q q q q q q q q q q q q q q q q q

q q

120

1991

1992

1993

1994

1995

q q q q q q q q q

q q

140

q q

0.4

0.4

q q

q q

PACF

ACF

120

0.0

0.0

Jan
0.4 0.4

Feb

Mar

Apr

May

Jun

Jul

Aug

Sep

Oct

Nov

Dec

Month
5 10 Lag 15

10 Lag

15

Time series and forecasting in R

Time series packages on CRAN

56

Time series and forecasting in R

Time series packages on CRAN

57

Basic facilities

Forecasting and univariate modelling


forecast Lots of univariate time series methods including automatic ARIMA modelling, exponential smoothing via state space models, and the forecast class for consistent handling of time series forecasts. Part of the forecasting bundle. tseries GARCH models and unit root tests. FitAR Subset AR model tting partsm Periodic autoregressive time series models pear Periodic autoregressive time series models

stats Contains substantial time series capabilities including the ts class for regularly spaced time series. Also ARIMA modelling, structural models, time series plots, acf and pacf graphs, classical decomposition and STL decomposition.

Time series and forecasting in R

Time series packages on CRAN

58

Time series and forecasting in R

Time series packages on CRAN

59

Forecasting and univariate modelling


Methods for linear time series analysis Bayesian analysis of Dynamic Linear Models. Time series analysis and control ARMA Modelling ARCH/GARCH modelling Bias-corrected forecasting and bootstrap prediction intervals for autoregressive time series gsarima Generalized SARIMA time series simulation bayesGARCH Bayesian Estimation of the GARCH(1,1) Model with t innovations ltsa dlm timsac fArma fGarch BootPR

Resampling and simulation

boot Bootstrapping, including the block bootstrap with several variants. meboot Maximum Entropy Bootstrap for Time Series

Time series and forecasting in R

Time series packages on CRAN

60

Time series and forecasting in R

Time series packages on CRAN

61

Decomposition and ltering


roblter Robust time series lters mFilter Miscellaneous time series lters useful for smoothing and extracting trend and cyclical components. ArDec Autoregressive decomposition wmtsa Wavelet methods for time series analysis based on Percival and Walden (2000) wavelets Computing wavelet lters, wavelet transforms and multiresolution analyses signalextraction Real-time signal extraction (direct lter approach) bspec Bayesian inference on the discrete power spectrum of time series

Unit roots and cointegration

tseries Unit root tests and methods for computational nance. urca Unit root and cointegration tests uroot Unit root tests including methods for seasonal time series

Time series and forecasting in R

Time series packages on CRAN

62

Time series and forecasting in R

Time series packages on CRAN

63

Nonlinear time series analysis


nlts R functions for (non)linear time series analysis tseriesChaos Nonlinear time series analysis RTisean Algorithms for time series analysis from nonlinear dynamical systems theory. tsDyn Time series analysis based on dynamical systems theory BAYSTAR Bayesian analysis of threshold autoregressive models fNonlinear Nonlinear and Chaotic Time Series Modelling bentcableAR Bent-Cable autoregression

Dynamic regression models

dynlm Dynamic linear models and time series regression dyn Time series regression tpr Regression models with time-varying coecients.

Time series and forecasting in R

Time series packages on CRAN

64

Time series and forecasting in R

Time series packages on CRAN

65

Multivariate time series models


mAr Multivariate AutoRegressive analysis vars VAR and VEC models MSBVAR Markov-Switching Bayesian Vector Autoregression Models tsfa Time series factor analysis dse Dynamic system equations including multivariate ARMA and state space models. brainwaver Wavelet analysis of multivariate time series

Functional data

far Modelling Functional AutoRegressive processes

Time series and forecasting in R

Time series packages on CRAN

66

Time series and forecasting in R

Time series packages on CRAN

67

Continuous time data

Irregular time series


zoo Infrastructure for both regularly and irregularly spaced time series. its Another implementation of irregular time series. fCalendar Chronological and Calendarical Objects fSeries Financial Time Series Objects xts Provides for uniform handling of Rs dierent time-based data classes

cts Continuous time autoregressive models sde Simulation and inference for stochastic dierential equations.

Time series and forecasting in R

Time series packages on CRAN

68

Time series and forecasting in R

Time series packages on CRAN

69

Time series data


fma Data from Makridakis, Wheelwright and Hyndman (1998) Forecasting: methods and applications. Part of the forecasting bundle. expsmooth Data from Hyndman, Koehler, Ord and Snyder (2008) Forecasting with exponential smoothing. Part of the forecasting bundle. Mcomp Data from the M-competition and M3-competition. Part of the forecasting bundle. FinTS R companion to Tsay (2005) Analysis of nancial time series containing data sets, functions and script les required to work some of the examples. TSA R functions and datasets from Cryer and Chan (2008) Time series analysis with applications in R TSdbi Common interface to time series databases fame Interface for FAME time series databases fEcon Econ - Economic and Financial Data Sets

Miscellaneous
hydrosanity Graphical user interface for exploring hydrological time series pastecs Regulation, decomposition and analysis of space-time series. RSEIS Seismic time series analysis tools paleoTS Modeling evolution in paleontological time-series GeneTS Microarray Time Series and Network Analysis fractal Fractal Time Series Modeling and Analysis

Das könnte Ihnen auch gefallen