From 026b6847f31991af78eb24725a665b5ecf2c9367 Mon Sep 17 00:00:00 2001 From: robjhyndman Date: Mon, 4 Mar 2024 07:03:12 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20robjhynd?= =?UTF-8?q?man/forecast@cfe717b2c2c0827b4233bfe7ebccd0d3f97edcc0=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apple-touch-icon-120x120.png | Bin 11394 -> 11394 bytes apple-touch-icon-60x60.png | Bin 4719 -> 4719 bytes apple-touch-icon-76x76.png | Bin 6472 -> 6472 bytes apple-touch-icon.png | Bin 11394 -> 11394 bytes favicon-16x16.png | Bin 1323 -> 1323 bytes favicon-32x32.png | Bin 2275 -> 2275 bytes news/index.html | 2 +- pkgdown.yml | 2 +- search.json | 2 +- 9 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apple-touch-icon-120x120.png b/apple-touch-icon-120x120.png index 0352c6a770109dc2eed8251314d1988022ba1eda..3537fd38e2ebfdf35c4c4aa19ed1673f003a59d5 100644 GIT binary patch delta 89 zcmZpQY>J#v&Cbqfa`++d&W%m}+D_(H28LFqM%o4jRt5%HQ+&TOFfgc=xJHzuB$lLF i<>sekrd2W+85o)98W`&un1mRhXplbn)qAqAPCfwWml~`9 delta 89 zcmZpQY>J#v&Ca645_$cL?#3p6Z6^~eV-qU_6Kw+nD+7b(rQ4Ml7#LJbTq844UBaSOhOD$G<^EOKX0^H9I?_kyg`+o{dd5f`aB&28LFq2HFM&Rt5%txnu54J};<%D%unFBx#aR FJ^*7v6EOe) delta 61 zcmaE_@?K>^H9LzE(}pd95*wRr1O-j3j7_WzjI<35tPBhulr~9BJ};<%DmqcaYRM#_ Fd;n6q5-0!w diff --git a/apple-touch-icon-76x76.png b/apple-touch-icon-76x76.png index 74abe5d49359db81f2684b4fa5e7014fd0e871e9..910dad2f684da3ac533790022fee787a68ad6846 100644 GIT binary patch delta 62 zcmX?Mbi!ytH9I?_act`hsf|sd5`yMd28LFqhS~-ORt5&qHQ`y4S4b$JifSpozc%@% GL_PpP5fYRD delta 62 zcmX?Mbi!ytH9LzE^YP7zeH)uZB?L{Zj7_WzjI|96tPBj?m^#-?ULm1?Drz2YC@}e^ GL_Pprgc1V) diff --git a/apple-touch-icon.png b/apple-touch-icon.png index fa53b46a857fe941b3341aa3d832fab2b6744b38..8a10088ff7f54400c09dcb506df05ae4d3c1680b 100644 GIT binary patch delta 89 zcmZpQY>J#v&Cbqfy5*Uz{>CPMZ6|Xp14AoQV{HQiD+7ZwkKLRZ7#LJbTq844UBaSOhOD$H0<5?@Bd_BoqPb(u^W{D delta 89 zcmZpQY>J#v&Ca64s(0bY?u||U+D;}`#wJz)!ag8WRNi0dV i%FR#7OsixtGB7gHH89pSFbOe0(Gb$lqBU7qCm#Ugq#2|D diff --git a/favicon-16x16.png b/favicon-16x16.png index 6e4190fe4190ecd3270f8f9b8801d1268359c743..89bf16509805973cf971a47a2da98080940773d1 100644 GIT binary patch delta 64 zcmZ3@wVG>#6*D_Kqs6Ik$4Q$VnJpOw&8-X!txV0d4GgRd4CdX=d@{M4MFCaxecQ!| I$$MDx0Z=&;h5!Hn delta 64 zcmZ3@wVG>#6*D`F5=TJd4z|sX%$AITCRWBKRt6T@1_o9J1}?03!zOpLD4>d(Mx?%) IyoV(p00q+!;{X5v diff --git a/favicon-32x32.png b/favicon-32x32.png index 1fbb07790679ee24de8ca32e4bc3dd31081191f2..c67bd6d2e43861d0cfedc3cec665635b5f0bb921 100644 GIT binary patch delta 89 zcmaDX_*ig4H9I?_<=%iomW@pt*qzL+3=FMI&9w~-tPBh+)+7ZmFfgc=xJHzuB$lLF i<>sekrd2W+85o)98W`&un1mRhXz=`a>&@g6j(h;Bm>RDD delta 89 zcmaDX_*ig4H9LzEr+Qk)gpExb*quzQj7_WzEVT^`tPBhu6z im7AZEnO4bQWME{XYhbKvU=m`0qG7UrUfkpoj(h<2iW
-

forecast 8.22.0

+

forecast 8.22.0

CRAN release: 2024-03-04

  • hfitted now much faster for ARIMA models (danigiro, #949)
  • hfitted now much faster for ETS models, and produces fitted values from initial states (#950)
diff --git a/pkgdown.yml b/pkgdown.yml index 2639a268..c3a2dc0a 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: JSS2008: JSS2008.html -last_built: 2024-03-04T04:34Z +last_built: 2024-03-04T07:02Z urls: reference: https://pkg.robjhyndman.com/forecast/reference article: https://pkg.robjhyndman.com/forecast/articles diff --git a/search.json b/search.json index 034a54ab..13134bf8 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Automatic forecasts large numbers univariate time series often needed business. common one thousand product lines need forecasting least monthly. Even smaller number forecasts required, may nobody suitably trained use time series models produce . circumstances, automatic forecasting algorithm essential tool. Automatic forecasting algorithms must determine appropriate time series model, estimate parameters compute forecasts. must robust unusual time series patterns, applicable large numbers series without user intervention. popular automatic forecasting algorithms based either exponential smoothing ARIMA models. article, discuss implementation two automatic univariate forecasting methods package . also briefly describe univariate forecasting methods part package. package system statistical computing ( Development Core Team 2008) available Comprehensive Archive Network . Version 8.22.0 package used paper. package contains functions univariate forecasting examples real time series data. extensive testing forecasting methods, package contains 90 data sets Spyros Makridakis, Wheelwright, Hyndman (1998), package contains 24 data sets Hyndman et al. (2008), package contains 1001 time series M-competition (S. Makridakis et al. 1982) 3003 time series M3-competition (Spyros Makridakis Hibon 2000). package implements automatic forecasting using exponential smoothing, ARIMA models, Theta method (Assimakopoulos Nikolopoulos 2000), cubic splines (Hyndman, King, et al. 2005), well common forecasting methods. article, primarily discuss exponential smoothing approach (Section \\(\\ref{sec:expsmooth}\\)) ARIMA modelling approach (Section \\(\\ref{sec:arima}\\)) automatic forecasting. Section \\(\\ref{sec:package}\\), describe implementation methods package, along features package.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:expsmooth","dir":"Articles","previous_headings":"","what":"Exponential smoothing","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Although exponential smoothing methods around since 1950s, modelling framework incorporating procedures model selection developed relatively recently. J. K. Ord, Koehler, Snyder (1997), Hyndman et al. (2002) Hyndman, Koehler, et al. (2005) shown exponential smoothing methods (including non-linear methods) optimal forecasts innovations state space models. Exponential smoothing methods originally classified Pegels’ (1969) taxonomy. later extended Gardner (1985), modified Hyndman et al. (2002), extended Taylor (2003), giving total fifteen methods seen following table. methods better known names. example, cell (N,N) describes simple exponential smoothing (SES) method, cell (,N) describes Holt’s linear method, cell (,N) describes damped trend method. additive Holt-Winters’ method given cell (,) multiplicative Holt-Winters’ method given cell (,M). cells correspond less commonly used analogous methods.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"point-forecasts-for-all-methods","dir":"Articles","previous_headings":"Exponential smoothing","what":"Point forecasts for all methods","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"denote observed time series \\(y_1,y_2,\\dots,y_n\\). forecast \\(y_{t+h}\\) based data time \\(t\\) denoted \\(\\hat{y}_{t+h|t}\\). illustrate method, give point forecasts updating equations method (,), Holt-Winters’ additive method: \\(m\\) length seasonality (e.g., number months quarters year), \\(\\ell_t\\) represents level series, \\(b_t\\) denotes growth, \\(s_t\\) seasonal component, \\(\\hat{y}_{t+h|t}\\) forecast \\(h\\) periods ahead, \\(h_m^+ = \\big[(h-1) \\mbox{ mod } m\\big] + 1\\). use method \\(\\eqref{eq:AMmethod}\\), need values initial states \\(\\ell_0\\), \\(b_0\\) \\(s_{1-m},\\dots,s_0\\), smoothing parameters \\(\\alpha\\), \\(\\beta^*\\) \\(\\gamma\\). estimated observed data. Equation \\(\\eqref{eq:3-46a}\\) slightly different usual Holt-Winters equations Spyros Makridakis, Wheelwright, Hyndman (1998) Bowerman, O’Connell, Koehler (2005). authors replace \\(\\eqref{eq:3-46a}\\) \\[ s_t = \\gamma^*(y_t - \\ell_{t}) + (1-\\gamma^*)s_{t-m}. \\] \\(\\ell_t\\) substituted using \\(\\eqref{eq:3-44a}\\), obtain \\[s_t = \\gamma^*(1-\\alpha)(y_t - \\ell_{t-1}-b_{t-1}) + \\{1-\\gamma^*(1-\\alpha)\\}s_{t-m}. \\] Thus, obtain identical forecasts using approach replacing \\(\\gamma\\) \\(\\eqref{eq:3-46a}\\) \\(\\gamma^*(1-\\alpha)\\). modification given \\(\\eqref{eq:3-46a}\\) proposed J. K. Ord, Koehler, Snyder (1997) make state space formulation simpler. equivalent Archibald’s (1990) variation Holt-Winters’ method. Table \\(\\ref{table:pegels}\\) gives recursive formulae computing point forecasts \\(h\\) periods ahead exponential smoothing methods. interesting special cases can obtained setting smoothing parameters extreme values. example, \\(\\alpha=0\\), level constant time; \\(\\beta^*=0\\), slope constant time; \\(\\gamma=0\\), seasonal pattern constant time. extreme, naïve forecasts (.e., \\(\\hat{y}_{t+h|t}=y_t\\) \\(h\\)) obtained using (N,N) method \\(\\alpha=1\\). Finally, additive multiplicative trend methods special cases damped counterparts obtained letting \\(\\phi=1\\).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:statespace","dir":"Articles","previous_headings":"Exponential smoothing","what":"Innovations state space models","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"exponential smoothing method Table \\(\\ref{table:pegels}\\), Hyndman et al. (2008) describe two possible innovations state space models, one corresponding model additive errors model multiplicative errors. parameter values used, two models give equivalent point forecasts, although different prediction intervals. Thus 30 potential models described classification. Historically, nature error component often ignored, distinction additive multiplicative errors makes difference point forecasts. careful distinguish exponential smoothing underlying state space . exponential smoothing method algorithm producing point forecasts . underlying stochastic state space model gives point forecasts, also provides framework computing prediction intervals properties. distinguish models additive multiplicative errors, add extra letter front method notation. triplet (E,T,S) refers three components: error, trend seasonality. model ETS(,,N) additive errors, additive trend seasonality—words, Holt’s linear method additive errors. Similarly, ETS(M,M,M) refers model multiplicative errors, damped multiplicative trend multiplicative seasonality. notation ETS(\\(\\cdot\\),\\(\\cdot\\),\\(\\cdot\\)) helps remembering order components specified. model specified, can study probability distribution future values series find, example, conditional mean future observation given knowledge past. denote \\(\\mu_{t+h|t} = \\E(y_{t+h} \\mid \\bm{x}_t)\\), \\(\\bm{x}_t\\) contains unobserved components \\(\\ell_t\\), \\(b_t\\) \\(s_t\\). \\(h=1\\) use \\(\\mu_t\\equiv\\mu_{t+1|t}\\) shorthand notation. many models, conditional means identical point forecasts given Table \\(\\ref{table:pegels}\\), \\(\\mu_{t+h|t}=\\hat{y}_{t+h|t}\\). However, models (multiplicative trend multiplicative seasonality), conditional mean point forecast differ slightly \\(h\\ge 2\\). illustrate ideas using damped trend method Gardner McKenzie (1985). Let \\(\\mu_t = \\hat{y}_t = \\ell_{t-1}+b_{t-1}\\) denote one-step forecast \\(y_{t}\\) assuming know values parameters. Also, let \\(\\varepsilon_t = y_t - \\mu_t\\) denote one-step forecast error time \\(t\\). equations Table \\(\\ref{table:pegels}\\), find \\[\\begin{align} \\label{ss1} y_t &= \\ell_{t-1} + \\phi b_{t-1} + \\varepsilon_t\\\\ \\ell_t &= \\ell_{t-1} + \\phi b_{t-1} + \\alpha \\varepsilon_t \\label{ss2}\\\\ b_t &= \\phi b_{t-1} + \\beta^*(\\ell_t - \\ell_{t-1}- \\phi b_{t-1}) = \\phi b_{t-1} + \\alpha\\beta^*\\varepsilon_t. \\label{ss3} \\end{align}\\] simplify last expression setting \\(\\beta=\\alpha\\beta^*\\). three equations constitute state space model underlying damped Holt’s method. Note state space model (Anderson Moore 1979; Aoki 1987) error term appears equation. write standard state space notation defining state vector \\(\\bm{x}_t = (\\ell_t,b_t)'\\) expressing \\(\\eqref{ss1}\\)–\\(\\eqref{ss3}\\) model fully specified state distribution error term \\(\\varepsilon_t\\). Usually assume independent identically distributed, following normal distribution mean 0 variance \\(\\sigma^2\\), write \\(\\varepsilon_t \\sim\\mbox{NID}(0, \\sigma^2)\\). model multiplicative error can derived similarly, first setting \\(\\varepsilon_t = (y_t-\\mu_t)/\\mu_t\\), \\(\\varepsilon_t\\) relative error. , following similar approach additive errors, find \\[\\begin{align*} y_t &= (\\ell_{t-1} + \\phi b_{t-1})(1 + \\varepsilon_t)\\\\ \\ell_t &= (\\ell_{t-1} + \\phi b_{t-1})(1 + \\alpha \\varepsilon_t)\\\\ b_t &= \\phi b_{t-1} + \\beta(\\ell_{t-1}+\\phi b_{t-1})\\varepsilon_t, \\end{align*}\\] \\[\\begin{align*} y_t &= \\left[ 1 \\phi \\right] \\bm{x}_{t-1}(1 + \\varepsilon_t)\\\\ \\bm{x}_t &= \\left[\\begin{array}{ll} 1 & \\phi \\\\ 0 & \\phi \\end{array}\\right]\\bm{x}_{t-1} + \\left[ 1 \\phi \\right] \\bm{x}_{t-1} \\left[\\begin{array}{l} \\alpha\\\\ \\beta \\end{array}\\right]\\varepsilon_t. \\end{align*}\\] assume \\(\\varepsilon_t \\sim \\mbox{NID}(0,\\sigma^2)\\). course, nonlinear state space model, usually considered difficult handle estimating forecasting. However, one many advantages innovations form state space models — can still compute forecasts, likelihood prediction intervals nonlinear model effort required additive error model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:ssmodels","dir":"Articles","previous_headings":"Exponential smoothing","what":"State space models for all exponential smoothing methods","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"similar state space models 30 exponential smoothing variations. general model involves state vector \\(\\bm{x}_t = (\\ell_t, b_t\\), \\(s_t, s_{t-1}, \\dots, s_{t-m+1})'\\) state space equations form \\(\\{\\varepsilon_t\\}\\) Gaussian white noise process mean zero variance \\(\\sigma^2\\), \\(\\mu_t = w(\\bm{x}_{t-1})\\). model additive errors \\(r(\\bm{x}_{t-1})=1\\), \\(y_t = \\mu_{t} + \\varepsilon_t\\). model multiplicative errors \\(r(\\bm{x}_{t-1})=\\mu_t\\), \\(y_t = \\mu_{t}(1 + \\varepsilon_t)\\). Thus, \\(\\varepsilon_t = (y_t - \\mu_t)/\\mu_t\\) relative error multiplicative model. models unique. Clearly, value \\(r(\\bm{x}_{t-1})\\) lead identical point forecasts \\(y_t\\). methods Table \\(\\ref{table:pegels}\\) can written form \\(\\eqref{eq:ss1}\\) \\(\\eqref{eq:ss2}\\). specific form model given Hyndman et al. (2008). combinations trend, seasonality error can occasionally lead numerical difficulties; specifically, model equation requires division state component involve division zero. problem models additive errors either multiplicative trend multiplicative seasonality, well model multiplicative errors, multiplicative trend additive seasonality. models therefore used caution. multiplicative error models useful data strictly positive, numerically stable data contain zeros negative values. time series strictly positive, six fully additive models may applied. point forecasts given Table \\(\\ref{table:pegels}\\) easily obtained models iterating equations \\(\\eqref{eq:ss1}\\) \\(\\eqref{eq:ss2}\\) \\(t=n+1, n+2,\\dots,n+h\\), setting \\(\\varepsilon_{n+j}=0\\) \\(j=1,\\dots,h\\). cases (notable exceptions models multiplicative seasonality multiplicative trend \\(h\\ge2\\)), point forecasts can shown equal \\(\\mu_{t+h|t} = \\E(y_{t+h} \\mid \\bm{x}_t)\\), conditional expectation corresponding state space model. models also provide means obtaining prediction intervals. case linear models, forecast distributions normal, can derive conditional variance \\(v_{t+h|t} = \\VAR (y_{t+h} \\mid \\bm{x}_t)\\) obtain prediction intervals accordingly. approach also works many nonlinear models. Detailed derivations results many models given Hyndman, Koehler, et al. (2005). direct approach works models simply simulate many future sample paths conditional last estimate state vector, \\(\\bm{x}_t\\). prediction intervals can obtained percentiles simulated sample paths. Point forecasts can also obtained way taking average simulated values future time period. advantage approach generate estimate complete predictive distribution, especially useful applications inventory planning, expected costs depend whole distribution.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:estimation","dir":"Articles","previous_headings":"Exponential smoothing","what":"Estimation","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"order use models forecasting, need know values \\(\\bm{x}_0\\) parameters \\(\\alpha\\), \\(\\beta\\), \\(\\gamma\\) \\(\\phi\\). easy compute likelihood innovations state space model \\(\\eqref{eq:ss}\\), obtain maximum likelihood estimates. J. K. Ord, Koehler, Snyder (1997) show \\[\\begin{equation}\\label{likelihood} L^*(\\bm\\theta,\\bm{x}_0) = n\\log\\Big(\\sum_{t=1}^n \\varepsilon^2_t\\Big) + 2\\sum_{t=1}^n \\log|r(\\bm{x}_{t-1})| \\end{equation}\\] equal twice negative logarithm likelihood function (constant terms eliminated), conditional parameters \\(\\bm\\theta = (\\alpha,\\beta,\\gamma,\\phi)'\\) initial states \\(\\bm{x}_0 = (\\ell_0,b_0,s_0,s_{-1},\\dots,s_{-m+1})'\\), \\(n\\) number observations. easily computed simply using recursive equations Table \\(\\ref{table:pegels}\\). Unlike state space models multiple sources error, need use Kalman filter compute likelihood. parameters \\(\\bm\\theta\\) initial states \\(\\bm{x}_0\\) can estimated minimizing \\(L^*\\). implementations exponential smoothing use ad hoc heuristic scheme estimate \\(\\bm{x}_0\\). However, modern computers, reason estimate \\(\\bm{x}_0\\) along \\(\\bm\\theta\\), resulting forecasts often substantially better . constrain initial states \\(\\bm{x}_0\\) seasonal indices add zero additive seasonality, add \\(m\\) multiplicative seasonality. several suggestions restricting parameter space \\(\\alpha\\), \\(\\beta\\) \\(\\gamma\\). traditional approach ensure various equations can interpreted weighted averages, thus requiring \\(\\alpha\\), \\(\\beta^*=\\beta/\\alpha\\), \\(\\gamma^*=\\gamma/(1-\\alpha)\\) \\(\\phi\\) lie within \\((0,1)\\). suggests \\[0<\\alpha<1,\\qquad 0<\\beta<\\alpha,\\qquad 0<\\gamma < 1-\\alpha,\\qquad\\mbox{}\\qquad 0<\\phi<1. \\] However, Hyndman, Akram, Archibald (2008) show restrictions usually stricter necessary (although cases restrictive enough).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"model-selection","dir":"Articles","previous_headings":"Exponential smoothing","what":"Model selection","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Forecast accuracy measures mean squared error (MSE) can used selecting model given set data, provided errors computed data hold-set data used model estimation. However, often --sample errors draw reliable conclusions. Consequently, penalized method based -sample fit usually better. One approach uses penalized likelihood Akaike’s Information Criterion: \\[\\mbox{AIC} = L^*(\\hat{\\bm\\theta},\\hat{\\bm{x}}_0) + 2q, \\] \\(q\\) number parameters \\(\\bm\\theta\\) plus number free states \\(\\bm{x}_0\\), \\(\\hat{\\bm\\theta}\\) \\(\\hat{\\bm{x}}_0\\) denote estimates \\(\\bm\\theta\\) \\(\\bm{x}_0\\). select model minimizes AIC amongst models appropriate data. AIC also provides method selecting additive multiplicative error models. point forecasts two models identical standard forecast accuracy measures MSE mean absolute percentage error (MAPE) unable select error types. AIC able select error types based likelihood rather one-step forecasts. Obviously, model selection criteria (BIC) also used similar manner.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:algorithm","dir":"Articles","previous_headings":"Exponential smoothing","what":"Automatic forecasting","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Hyndman et al. (2002) applied automatic forecasting strategy M-competition data (S. Makridakis et al. 1982) IJF-M3 competition data (Spyros Makridakis Hibon 2000) using restricted set exponential smoothing models, demonstrated methodology particularly good short term forecasts (6 periods ahead), especially seasonal short-term series (beating methods competitions series).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:arima","dir":"Articles","previous_headings":"","what":"ARIMA models","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"common obstacle many people using Autoregressive Integrated Moving Average (ARIMA) models forecasting order selection process usually considered subjective difficult apply. . several attempts automate ARIMA modelling last 25 years. Hannan Rissanen (1982) proposed method identify order ARMA model stationary series. method innovations can obtained fitting long autoregressive model data, likelihood potential models computed via series standard regressions. established asymptotic properties procedure general conditions. Gómez (1998) extended Hannan-Rissanen identification method include multiplicative seasonal ARIMA model identification. Gómez Maravall (1998) implemented automatic identification procedure software . given series, algorithm attempts find model minimum BIC. Liu (1989) proposed method identification seasonal ARIMA models using filtering method certain heuristic rules; algorithm used software. Another approach described Mélard Pasteels (2000) whose algorithm univariate ARIMA models also allows intervention analysis. implemented software package ``Time Series Expert’’ (). algorithms use commercial software, although documented public domain literature. particular, (Goodrich 2000) well-known excellent automatic ARIMA algorithm used M3-forecasting competition (Spyros Makridakis Hibon 2000). Another proprietary algorithm implemented (Reilly 2000). K. Ord Lowe (1996) provide early review commercial software implement automatic ARIMA forecasting.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"choosing-the-model-order-using-unit-root-tests-and-the-aic","dir":"Articles","previous_headings":"ARIMA models","what":"Choosing the model order using unit root tests and the AIC","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"non-seasonal ARIMA(\\(p,d,q\\)) process given \\[ \\phi(B)(1-B^d)y_{t} = c + \\theta(B)\\varepsilon_t \\] \\(\\{\\varepsilon_t\\}\\) white noise process mean zero variance \\(\\sigma^2\\), \\(B\\) backshift operator, \\(\\phi(z)\\) \\(\\theta(z)\\) polynomials order \\(p\\) \\(q\\) respectively. ensure causality invertibility, assumed \\(\\phi(z)\\) \\(\\theta(z)\\) roots \\(|z|<1\\) (Brockwell Davis 1991). \\(c\\ne0\\), implied polynomial order \\(d\\) forecast function. seasonal ARIMA\\((p,d,q)(P,D,Q)_m\\) process given \\[ \\Phi(B^m)\\phi(B)(1-B^{m})^D(1-B)^dy_{t} = c + \\Theta(B^m)\\theta(B)\\varepsilon_t \\] \\(\\Phi(z)\\) \\(\\Theta(z)\\) polynomials orders \\(P\\) \\(Q\\) respectively, containing roots inside unit circle. \\(c\\ne0\\), implied polynomial order \\(d+D\\) forecast function. main task automatic ARIMA forecasting selecting appropriate model order, values \\(p\\), \\(q\\), \\(P\\), \\(Q\\), \\(D\\), \\(d\\). \\(d\\) \\(D\\) known, can select orders \\(p\\), \\(q\\), \\(P\\) \\(Q\\) via information criterion AIC: \\[\\mbox{AIC} = -2\\log(L) + 2(p+q+P+Q+k)\\] \\(k=1\\) \\(c\\ne0\\) 0 otherwise, \\(L\\) maximized likelihood model fitted data \\((1-B^m)^D(1-B)^dy_t\\). likelihood full model \\(y_t\\) actually defined value AIC different levels differencing comparable. One solution difficulty ``diffuse prior’’ approach outlined Durbin Koopman (2001) implemented function (Ripley 2002) . approach, initial values time series (observed values) assumed mean zero large variance. However, choosing \\(d\\) \\(D\\) minimizing AIC using approach tends lead -differencing. forecasting purposes, believe better make differences possible -differencing harms forecasts (Smith Yadav 1994) widens prediction intervals. (Although, see Hendry 1997 contrary view.) Consequently, need approach choose \\(d\\) \\(D\\). prefer unit-root tests. However, unit-root tests based null hypothesis unit root exists biases results towards differences rather fewer differences. example, variations Dickey-Fuller test (Dickey Fuller 1981) assume unit root lag 1, HEGY test Hylleberg et al. (1990) based null hypothesis seasonal unit root. Instead, prefer unit-root tests based null hypothesis unit-root. non-seasonal data, consider ARIMA(\\(p,d,q\\)) models \\(d\\) selected based successive KPSS unit-root tests (Kwiatkowski et al. 1992). , test data unit root; test result significant, test differenced data unit root; . stop procedure obtain first insignificant result. seasonal data, consider ARIMA\\((p,d,q)(P,D,Q)_m\\) models \\(m\\) seasonal frequency \\(D=0\\) \\(D=1\\) depending extended Canova-Hansen test (Canova Hansen 1995). Canova Hansen provide critical values \\(21\\). Let \\(C_m\\) critical value seasonal period \\(m\\). plotted \\(C_m\\) \\(m\\) values \\(m\\) 365 noted fit line \\(C_m = 0.269 m^{0.928}\\) almost exactly. \\(m>12\\), use simple expression obtain critical value. note passing null hypothesis Canova-Hansen test ARIMA model includes seasonal dummy terms. test whether seasonal pattern changes sufficiently time warrant seasonal unit root, whether stable seasonal pattern modelled using fixed dummy variables appropriate. Nevertheless, found test still useful choosing \\(D\\) strictly ARIMA framework (.e., without seasonal dummy variables). stable seasonal pattern selected (.e., null hypothesis rejected), seasonality effectively handled stationary seasonal AR MA terms. \\(D\\) selected, choose \\(d\\) applying successive KPSS unit-root tests seasonally differenced data (\\(D=1\\)) original data (\\(D=0\\)). \\(d\\) (possibly \\(D\\)) selected, proceed select values \\(p\\), \\(q\\), \\(P\\) \\(Q\\) minimizing AIC. allow \\(c\\ne0\\) models \\(d+D < 2\\).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"a-step-wise-procedure-for-traversing-the-model-space","dir":"Articles","previous_headings":"ARIMA models","what":"A step-wise procedure for traversing the model space","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Suppose seasonal data consider ARIMA\\((p,d,q)(P,D,Q)_m\\) models \\(p\\) \\(q\\) can take values 0 3, \\(P\\) \\(Q\\) can take values 0 1. \\(c=0\\) total 288 possible models, \\(c\\ne 0\\) total 192 possible models, giving 480 models altogether. values \\(p\\), \\(d\\), \\(q\\), \\(P\\), \\(D\\) \\(Q\\) allowed range widely, number possible models increases rapidly. Consequently, often feasible simply fit every potential model choose one lowest AIC. Instead, need way traversing space models efficiently order arrive model lowest AIC value. algorithm guaranteed return valid model model space finite least one starting models accepted (model AR MA parameters). selected model used produce forecasts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"comparisons-with-exponential-smoothing","dir":"Articles","previous_headings":"ARIMA models","what":"Comparisons with exponential smoothing","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"widespread myth ARIMA models general exponential smoothing. true. two classes models overlap. linear exponential smoothing models special cases ARIMA models—equivalences discussed Hyndman, Akram, Archibald (2008). However, non-linear exponential smoothing models equivalent ARIMA counterpart. hand, many ARIMA models exponential smoothing counterpart. Thus, two model classes overlap complimentary; strengths weaknesses. exponential smoothing state space models non-stationary. Models seasonality non-damped trend () two unit roots; models—, non-seasonal models either trend damped trend—one unit root. possible define stationary model similar characteristics exponential smoothing, normally done. philosophy exponential smoothing world non-stationary. stationary model required, ARIMA models better. One advantage exponential smoothing models can non-linear. time series exhibit non-linear characteristics including heteroscedasticity may better modelled using exponential smoothing state space models. seasonal data, many ARIMA models 30 possible models exponential smoothing class Section \\(\\ref{sec:expsmooth}\\). may thought larger model class advantageous. However, results Hyndman et al. (2002) show exponential smoothing models performed better ARIMA models seasonal M3 competition data. (annual M3 data, ARIMA models performed better.) discussion results, Hyndman (2001) speculates larger model space ARIMA models actually harms forecasting performance introduces additional uncertainty. smaller exponential smoothing class sufficiently rich capture dynamics almost real business economic time series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:package","dir":"Articles","previous_headings":"","what":"The forecast package","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Four time series showing point forecasts 80% & 95% prediction intervals obtained using exponential smoothing state space models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"implementation-of-the-automatic-exponential-smoothing-algorithm","dir":"Articles","previous_headings":"The forecast package","what":"Implementation of the automatic exponential smoothing algorithm","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Although lot computation involved, can handled remarkably quickly modern computers. forecasts shown Figure \\(\\ref{fig:etsexamples}\\) took seconds standard PC. US electricity generation series took longest analytical prediction intervals available ETS(M,M,N) model. Consequently, prediction intervals series computed using simulation 5000 future sample paths. apply algorithm US net electricity generation time series , use following command. object class ``’’ contains necessary information fitted model including model parameters, value state vector \\(\\bm{x}_t\\) \\(t\\), residuals . Printing object shows main items interest. goodness--fit measures (defined Hyndman Koehler 2006) obtained using . also , , , , methods objects class ``’’. function shows time plots original time series along extracted components (level, growth seasonal). function computes required forecasts plotted Figure \\(\\ref{fig:etsexamples}\\)(b). Printing object gives table showing prediction intervals. function also provides useful feature applying fitted model new data set. example, withhold 10 observations data set fitting, compute one-step forecast errors --sample data. can also look measures forecast accuracy forecasts based fitting data.","code":"etsfit <- ets(usnetelec) etsfit ## ETS(M,A,N) ## ## Call: ## ets(y = usnetelec) ## ## Smoothing parameters: ## alpha = 0.9999 ## beta = 0.2191 ## ## Initial states: ## l = 254.9338 ## b = 38.3125 ## ## sigma: 0.0259 ## ## AIC AICc BIC ## 634.0437 635.2682 644.0803 accuracy(etsfit) ## ME RMSE MAE MPE MAPE MASE ## Training set 1.162583 52.00363 36.77721 0.2629582 1.942062 0.5211014 ## ACF1 ## Training set 0.006113498 fcast ## Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 ## 2004 3900.329 3770.801 4029.857 3702.233 4098.425 ## 2005 3952.650 3747.279 4158.022 3638.562 4266.738 ## 2006 4004.972 3725.589 4284.355 3577.692 4432.251 ## 2007 4057.293 3701.885 4412.701 3513.743 4600.842 ## 2008 4109.614 3674.968 4544.259 3444.881 4774.347 ## 2009 4161.935 3644.367 4679.503 3370.383 4953.487 ## 2010 4214.256 3609.881 4818.632 3289.944 5138.569 ## 2011 4266.577 3571.428 4961.726 3203.439 5329.716 ## 2012 4318.898 3528.985 5108.812 3110.830 5526.967 ## 2013 4371.220 3482.552 5259.888 3012.119 5730.320 fit <- ets(usnetelec[1:45]) test <- ets(usnetelec[46:55], model = fit) accuracy(test) accuracy(forecast(fit,10), usnetelec[46:55])"},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"the-holtwinters-function","dir":"Articles","previous_headings":"The forecast package","what":"The HoltWinters() function","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"another implementation exponential smoothing  via function (Meyer 2002) package. implements (N,N), (,N), (,) (,M) methods. initial states \\(\\bm{x}_0\\) fixed using heuristic algorithm. way initial states estimated, full three years seasonal data required implement seasonal forecasts using . (See Hyndman Kostenko (2007) minimal sample size required.) smoothing parameters optimized minimizing average squared prediction errors, equivalent minimizing \\(\\eqref{likelihood}\\) case additive errors. method resulting object can produce point forecasts prediction intervals. Although nowhere documented, appears prediction intervals produced object class based equivalent ARIMA model case (N,N), (,N) (,) methods, assuming additive errors. prediction intervals equivalent prediction intervals arise (,N,N), (,,N) (,,) state space models. (,M) method, prediction interval provided appears based Chatfield Yar (1991) approximation true prediction interval arising (,,M) model. Prediction intervals multiplicative errors possible using function.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"implementation-of-the-automatic-arima-algorithm","dir":"Articles","previous_headings":"The forecast package","what":"Implementation of the automatic ARIMA algorithm","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Four time series showing point forecasts 80% & 95% prediction intervals obtained using ARIMA models. algorithm Section \\(\\ref{sec:arima}\\) applied four time series. Unlike exponential smoothing algorithm, ARIMA class models assumes homoscedasticity, always appropriate. Consequently, transformations sometimes necessary. four time series, model raw data series ()–(c), logged data series (d). prediction intervals back-transformed point forecasts preserve probability coverage. apply algorithm US net electricity generation time series , use following commands. Note  parameterization \\(\\theta(B) = (1 + \\theta_1B + \\dots + \\theta_qB)\\) \\(\\phi(B) = (1 - \\phi_1B + \\dots - \\phi_qB)\\), similarly seasonal terms. summary forecasts available, part shown . training set error measures two models similar. Note information criteria comparable. package also contains function largely wrapper function package. function package makes easier include drift term \\(d+D=1\\). (Setting function package work \\(d+D=0\\).) also provides facility fitting existing ARIMA model new data set (demonstrated function earlier). One-step forecasts ARIMA models now available via function. also provide new function returns original time series adjusting regression variables. regression variables ARIMA model, errors identical original series. regression variables ARIMA model, errors equal original series minus effect regression variables, leaving serial correlation modelled AR MA terms. contrast, provides true residuals, removing AR MA terms well. generic functions , , apply models obtained either functions.","code":"arimafit <- auto.arima(usnetelec) fcast <- forecast(arimafit) plot(fcast) Forecast method: ARIMA(2,1,2) with drift Series: usnetelec Coefficients: ar1 ar2 ma1 ma2 drift -1.3032 -0.4332 1.5284 0.8340 66.1585 s.e. 0.2122 0.2084 0.1417 0.1185 7.5595 sigma^2 estimated as 2262: log likelihood=-283.34 AIC=578.67 AICc=580.46 BIC=590.61 Error measures: ME RMSE MAE MPE MAPE MASE ACF1 Training set 0.046402 44.894 32.333 -0.61771 2.1012 0.45813 0.022492 Forecasts: Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 2004 3968.957 3908.002 4029.912 3875.734 4062.180 2005 3970.350 3873.950 4066.751 3822.919 4117.782 2006 4097.171 3971.114 4223.228 3904.383 4289.959 2007 4112.332 3969.691 4254.973 3894.182 4330.482 2008 4218.671 4053.751 4383.591 3966.448 4470.894 2009 4254.559 4076.108 4433.010 3981.641 4527.476 2010 4342.760 4147.088 4538.431 4043.505 4642.014 2011 4393.306 4185.211 4601.401 4075.052 4711.560 2012 4470.261 4248.068 4692.455 4130.446 4810.077 2013 4529.113 4295.305 4762.920 4171.535 4886.690"},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"the-forecast-function","dir":"Articles","previous_headings":"The forecast package","what":"The forecast() function","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"function generic S3 methods wide range time series models. computes point forecasts prediction intervals time series model. Methods exist models fitted using , , , , , . also method object. time series object passed first argument , function produce forecasts based exponential smoothing algorithm Section \\(\\ref{sec:expsmooth}\\). cases, existing function intended much thing. Unfortunately, resulting objects function contain different information case possible build generic functions () results. , instead, acts wrapper , packages information obtained common format (class). also define default method used existing function exists, calls relevant function. Thus, methods parallel methods, latter provide consistent output usable. , methods ``’’ class. Figures \\(\\ref{fig:etsexamples}\\) \\(\\ref{fig:arimaexamples}\\) produced using method. prediction intervals , default, computed 80% 95% coverage, although values possible requested. Fan charts (Wallis 1999) possible using combination .","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:other","dir":"Articles","previous_headings":"The forecast package","what":"Other functions","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"now briefly describe features package. following functions produces object class ``’’. : implements method Croston (1972) intermittent demand forecasting. method, time series decomposed two separate sequences: non-zero values time intervals non-zero values. independently forecast using simple exponential smoothing forecasts original series obtained ratios two sets forecasts. prediction intervals provided underlying stochastic model (Shenstone Hyndman 2005). : provides forecasts Theta method (Assimakopoulos Nikolopoulos 2000). Hyndman Billah (2003) showed equivalent special case simple exponential smoothing drift. : gives cubic-spline forecasts, based fitting cubic spline historical data extrapolating linearly. details method, associated prediction intervals, discussed Hyndman, King, et al. (2005). : returns forecasts based historical mean. : gives ``naïve’’ forecasts equal recent observation assuming random walk model. function also allows forecasting using random walk drift. addition, new plotting functions time series. : provides time plot along ACF PACF. : produces seasonal plot described Spyros Makridakis, Wheelwright, Hyndman (1998).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Rob Hyndman. Author, maintainer, copyright holder. George Athanasopoulos. Author. Christoph Bergmeir. Author. Gabriel Caceres. Author. Leanne Chhay. Author. Kirill Kuroptev. Author. Mitchell O'Hara-Wild. Author. Fotios Petropoulos. Author. Slava Razbash. Author. Earo Wang. Author. Farah Yasmeen. Author. Federico Garza. Contributor. Daniele Girolimetto. Contributor. Ross Ihaka. Contributor, copyright holder. R Core Team. Contributor, copyright holder. Daniel Reid. Contributor. David Shaub. Contributor. Yuan Tang. Contributor. Xiaoqian Wang. Contributor. Zhenyu Zhou. Contributor.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Hyndman R, Athanasopoulos G, Bergmeir C, Caceres G, Chhay L, O'Hara-Wild M, Petropoulos F, Razbash S, Wang E, Yasmeen F (2024). forecast: Forecasting functions time series linear models. R package version 8.22.0, https://pkg.robjhyndman.com/forecast/. Hyndman RJ, Khandakar Y (2008). “Automatic time series forecasting: forecast package R.” Journal Statistical Software, 27(3), 1–22. doi:10.18637/jss.v027.i03.","code":"@Manual{, title = {{forecast}: Forecasting functions for time series and linear models}, author = {Rob Hyndman and George Athanasopoulos and Christoph Bergmeir and Gabriel Caceres and Leanne Chhay and Mitchell O'Hara-Wild and Fotios Petropoulos and Slava Razbash and Earo Wang and Farah Yasmeen}, year = {2024}, note = {R package version 8.22.0}, url = {https://pkg.robjhyndman.com/forecast/}, } @Article{, title = {Automatic time series forecasting: the forecast package for {R}}, author = {Rob J Hyndman and Yeasmin Khandakar}, journal = {Journal of Statistical Software}, volume = {27}, number = {3}, pages = {1--22}, year = {2008}, doi = {10.18637/jss.v027.i03}, }"},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"forecast-","dir":"","previous_headings":"","what":"Forecasting Functions for Time Series and Linear Models","title":"Forecasting Functions for Time Series and Linear Models","text":"R package forecast provides methods tools displaying analysing univariate time series forecasts including exponential smoothing via state space models automatic ARIMA modelling. complementary forecasting package fable package, implements many models tidyverse framework.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Forecasting Functions for Time Series and Linear Models","text":"can install stable version CRAN. can install development version Github","code":"install.packages('forecast', dependencies = TRUE) # install.packages(\"remotes\") remotes::install_github(\"robjhyndman/forecast\")"},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Forecasting Functions for Time Series and Linear Models","text":"","code":"library(forecast) library(ggplot2) # ETS forecasts USAccDeaths %>% ets() %>% forecast() %>% autoplot() # Automatic ARIMA forecasts WWWusage %>% auto.arima() %>% forecast(h=20) %>% autoplot() # ARFIMA forecasts library(fracdiff) x <- fracdiff.sim( 100, ma=-.4, d=.3)$series arfima(x) %>% forecast(h=30) %>% autoplot() # Forecasting with STL USAccDeaths %>% stlm(modelfunction=ar) %>% forecast(h=36) %>% autoplot() AirPassengers %>% stlf(lambda=0) %>% autoplot() USAccDeaths %>% stl(s.window='periodic') %>% forecast() %>% autoplot() # TBATS forecasts USAccDeaths %>% tbats() %>% forecast() %>% autoplot() taylor %>% tbats() %>% forecast() %>% autoplot()"},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"for-more-information","dir":"","previous_headings":"","what":"For more information","title":"Forecasting Functions for Time Series and Linear Models","text":"Get started forecasting online textbook http://OTexts.org/fpp2/ Read Hyndsight blog https://robjhyndman.com/hyndsight/ Ask forecasting questions http://stats.stackexchange.com/tags/forecasting Ask R questions http://stackoverflow.com/tags/forecasting+r Join International Institute Forecasters: http://forecasters.org/","code":""},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Forecasting Functions for Time Series and Linear Models","text":"package free open source software, licensed GPL-3.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":null,"dir":"Reference","previous_headings":"","what":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"function Acf computes (default plots) estimate autocorrelation function (possibly multivariate) time series. Function Pacf computes (default plots) estimate partial autocorrelation function (possibly multivariate) time series. Function Ccf computes cross-correlation cross-covariance two univariate series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"","code":"Acf( x, lag.max = NULL, type = c(\"correlation\", \"covariance\", \"partial\"), plot = TRUE, na.action = na.contiguous, demean = TRUE, ... ) Pacf( x, lag.max = NULL, plot = TRUE, na.action = na.contiguous, demean = TRUE, ... ) Ccf( x, y, lag.max = NULL, type = c(\"correlation\", \"covariance\"), plot = TRUE, na.action = na.contiguous, ... ) taperedacf( x, lag.max = NULL, type = c(\"correlation\", \"partial\"), plot = TRUE, calc.ci = TRUE, level = 95, nsim = 100, ... ) taperedpacf(x, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"x univariate multivariate (Ccf) numeric time series object numeric vector matrix. lag.max maximum lag calculate acf. Default $10*log10(N/m)$ $N$ number observations $m$ number series. automatically limited one less number observations series. type character string giving type acf computed. Allowed values “correlation” (default), “covariance” “partial”. plot logical. TRUE (default) resulting acf, pacf ccf plotted. na.action function handle missing values. Default na.contiguous. Useful alternatives na.pass na.interp. demean covariances sample means? ... Additional arguments passed plotting function. y univariate numeric time series object numeric vector. calc.ci TRUE, confidence intervals ACF/PACF estimates calculated. level Percentage level used confidence intervals. nsim number bootstrap samples used estimating confidence intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"Acf, Pacf Ccf functions return objects class \"acf\" described acf stats package. taperedacf taperedpacf functions return objects class \"mpacf\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"functions improve acf, pacf ccf functions. main differences Acf plot spike lag 0 type==\"correlation\" (redundant) horizontal axes show lags time units rather seasonal units. tapered versions implement ACF PACF estimates plots described Hyndman (2015), based banded tapered estimates autocovariance proposed McMurry Politis (2010).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"Hyndman, R.J. (2015). Discussion ``High-dimensional autocovariance matrices optimal linear prediction''. Electronic Journal Statistics, 9, 792-796. McMurry, T. L., & Politis, D. N. (2010). Banded tapered estimates autocovariance matrices linear process bootstrap. Journal Time Series Analysis, 31(6), 471-482.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"","code":"Acf(wineind) Pacf(wineind) if (FALSE) { taperedacf(wineind, nsim=50) taperedpacf(wineind, nsim=50) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit ARIMA model to univariate time series — Arima","title":"Fit ARIMA model to univariate time series — Arima","text":"Largely wrapper arima function stats package. main difference function allows drift term. also possible take ARIMA model previous call Arima re-apply data y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit ARIMA model to univariate time series — Arima","text":"","code":"Arima( y, order = c(0, 0, 0), seasonal = c(0, 0, 0), xreg = NULL, include.mean = TRUE, include.drift = FALSE, include.constant, lambda = model$lambda, biasadj = FALSE, method = c(\"CSS-ML\", \"ML\", \"CSS\"), model = NULL, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit ARIMA model to univariate time series — Arima","text":"y univariate time series class ts. order specification non-seasonal part ARIMA model: three components (p, d, q) AR order, degree differencing, MA order. seasonal specification seasonal part ARIMA model, plus period (defaults frequency(y)). list components order period, specification just numeric vector length 3 turned suitable list specification order. xreg Optionally, numerical vector matrix external regressors, must number rows y. data frame. include.mean ARIMA model include mean term? default TRUE undifferenced series, FALSE differenced ones (mean affect fit predictions). include.drift ARIMA model include linear drift term? (.e., linear regression ARIMA errors fitted.) default FALSE. include.constant TRUE, include.mean set TRUE undifferenced series include.drift set TRUE differenced series. Note one difference taken, constant included regardless value argument. deliberate otherwise quadratic higher order polynomial trends induced. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. method Fitting method: maximum likelihood minimize conditional sum--squares. default (unless missing values) use conditional-sum--squares find starting values, maximum likelihood. model Output previous call Arima. model passed, model fitted y without re-estimating parameters. x Deprecated. Included backwards compatibility. ... Additional arguments passed arima.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit ARIMA model to univariate time series — Arima","text":"See arima function stats package. additional objects returned x time series data xreg regressors used fitting (relevant). sigma2 bias adjusted MLE innovations variance.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit ARIMA model to univariate time series — Arima","text":"See arima function stats package.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit ARIMA model to univariate time series — Arima","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit ARIMA model to univariate time series — Arima","text":"","code":"library(ggplot2) WWWusage %>% Arima(order=c(3,1,0)) %>% forecast(h=20) %>% autoplot # Fit model to first few years of AirPassengers data air.model <- Arima(window(AirPassengers,end=1956+11/12),order=c(0,1,1), seasonal=list(order=c(0,1,1),period=12),lambda=0) plot(forecast(air.model,h=48)) lines(AirPassengers) # Apply fitted model to later data air.model2 <- Arima(window(AirPassengers,start=1957),model=air.model) # Forecast accuracy measures on the log scale. # in-sample one-step forecasts. accuracy(air.model) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 0.3576253 7.89734 5.788344 0.1458472 2.670181 0.1982148 0.05807465 # out-of-sample one-step forecasts. accuracy(air.model2) #> ME RMSE MAE MPE MAPE MASE #> Training set 0.5159268 12.13132 8.14054 0.07949083 1.900931 0.2266508 #> ACF1 #> Training set -0.2166661 # out-of-sample multi-step forecasts accuracy(forecast(air.model,h=48,lambda=NULL), log(window(AirPassengers,start=1957))) #> ME RMSE MAE MPE MAPE MASE #> Training set 0.35762533 7.8973404 5.78834425 0.1458472 2.670181 0.1982148 #> Test set -0.08403416 0.1031891 0.08801596 -1.3982000 1.463555 0.0030140 #> ACF1 Theil's U #> Training set 0.05807465 NA #> Test set 0.75730561 0.9290965"},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":null,"dir":"Reference","previous_headings":"","what":"Box Cox Transformation — BoxCox","title":"Box Cox Transformation — BoxCox","text":"BoxCox() returns transformation input variable using Box-Cox transformation. InvBoxCox() reverses transformation.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Box Cox Transformation — BoxCox","text":"","code":"BoxCox(x, lambda) InvBoxCox(x, lambda, biasadj = FALSE, fvar = NULL)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Box Cox Transformation — BoxCox","text":"x numeric vector time series class ts. lambda transformation parameter. lambda = \"auto\", transformation parameter lambda chosen using BoxCox.lambda (lower bound -0.9) biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. fvar Optional parameter required biasadj=TRUE. Can either forecast variance, list containing interval level, corresponding upper lower intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Box Cox Transformation — BoxCox","text":"numeric vector length x.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Box Cox Transformation — BoxCox","text":"Box-Cox transformation (given Bickel & Doksum 1981) given $$f_\\lambda(x) =(sign(x)|x|^\\lambda - 1)/\\lambda$$ \\(\\lambda\\ne0\\). \\(\\lambda=0\\), $$f_0(x)=\\log(x)$$.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Box Cox Transformation — BoxCox","text":"Box, G. E. P. Cox, D. R. (1964) analysis transformations. JRSS B 26 211--246. Bickel, P. J. Doksum K. . (1981) Analysis Transformations Revisited. JASA 76 296-311.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Box Cox Transformation — BoxCox","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box Cox Transformation — BoxCox","text":"","code":"lambda <- BoxCox.lambda(lynx) lynx.fit <- ar(BoxCox(lynx,lambda)) plot(forecast(lynx.fit,h=20,lambda=lambda)) #> Error in NextMethod(.Generic): cannot assign 'tsp' to zero-length vector"},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"method==\"guerrero\", Guerrero's (1993) method used, lambda minimizes coefficient variation subseries x.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"","code":"BoxCox.lambda(x, method = c(\"guerrero\", \"loglik\"), lower = -1, upper = 2)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"x numeric vector time series class ts method Choose method used calculating lambda. lower Lower limit possible lambda values. upper Upper limit possible lambda values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"number indicating Box-Cox transformation parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"method==\"loglik\", value lambda chosen maximize profile log likelihood linear model fitted x. non-seasonal data, linear time trend fitted seasonal data, linear time trend seasonal dummy variables used.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"Box, G. E. P. Cox, D. R. (1964) analysis transformations. JRSS B 26 211--246. Guerrero, V.M. (1993) Time-series analysis supported power transformations. Journal Forecasting, 12, 37--48.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"Leanne Chhay Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"","code":"lambda <- BoxCox.lambda(AirPassengers,lower=0) air.fit <- Arima(AirPassengers, order=c(0,1,1), seasonal=list(order=c(0,1,1),period=12), lambda=lambda) plot(forecast(air.fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":null,"dir":"Reference","previous_headings":"","what":"Cross-validation statistic — CV","title":"Cross-validation statistic — CV","text":"Computes leave-one-cross-validation statistic (mean PRESS -- prediction residual sum squares), AIC, corrected AIC, BIC adjusted R^2 values linear model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cross-validation statistic — CV","text":"","code":"CV(obj)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cross-validation statistic — CV","text":"obj output lm tslm","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cross-validation statistic — CV","text":"Numerical vector containing CV, AIC, AICc, BIC AdjR2 values.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cross-validation statistic — CV","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cross-validation statistic — CV","text":"","code":"y <- ts(rnorm(120,0,3) + 20*sin(2*pi*(1:120)/12), frequency=12) fit1 <- tslm(y ~ trend + season) fit2 <- tslm(y ~ season) CV(fit1) #> CV AIC AICc BIC AdjR2 #> 11.2586211 290.9296316 294.9296316 329.9545160 0.9504162 CV(fit2) #> CV AIC AICc BIC AdjR2 #> 11.1266227 289.8343573 293.2683196 326.0717500 0.9505035"},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":null,"dir":"Reference","previous_headings":"","what":"k-fold Cross-Validation applied to an autoregressive model — CVar","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"CVar computes errors obtained applying autoregressive modelling function subsets time series y using k-fold cross-validation described Bergmeir, Hyndman Koo (2015). also applies Ljung-Box test residuals. test significant (see returned pvalue), serial correlation residuals model can considered underfitting data. case, cross-validated errors can underestimate generalization error used.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"","code":"CVar( y, k = 10, FUN = nnetar, cvtrace = FALSE, blocked = FALSE, LBlags = 24, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"y Univariate time series k Number folds use cross-validation. FUN Function fit autoregressive model. Currently, works nnetar function. cvtrace Provide progress information. blocked choose folds randomly blocks? LBlags lags Ljung-Box test, defaults 24, yearly series can set 20 ... arguments passed FUN.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"list containing information model accuracy fold, plus summary information computed across folds.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"Bergmeir, C., Hyndman, R.J., Koo, B. (2018) note validity cross-validation evaluating time series prediction. Computational Statistics & Data Analysis, 120, 70-83. https://robjhyndman.com/publications/cv-time-series/.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"Gabriel Caceres Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"","code":"modelcv <- CVar(lynx, k=5, lambda=0.15) print(modelcv) #> Series: lynx #> Call: CVar(y = lynx, k = 5, lambda = 0.15) #> #> 5-fold cross-validation #> Mean SD #> ME -7.399045e+01 209.5564198 #> RMSE 1.008670e+03 255.8655599 #> MAE 6.679454e+02 172.1851058 #> MPE -2.689215e+01 51.6590777 #> MAPE 6.685048e+01 36.9979203 #> ACF1 -4.401883e-03 0.1321075 #> Theil's U 1.058446e+00 0.2532232 #> #> p-value of Ljung-Box test of residuals is 0.1454125 #> if this value is significant (<0.05), #> the result of the cross-validation should not be used #> as the model is underfitting the data. print(modelcv$fold1) #> $model #> Series: y #> Model: NNAR(11,6) #> Call: FUN(y = y, lambda = 0.15, subset = trainset) #> #> Average of 20 networks, each of which is #> a 11-6-1 network with 79 weights #> options were - linear output units #> #> sigma^2 estimated as 0.09578 #> #> $accuracy #> ME RMSE MAE MPE MAPE ACF1 Theil's U #> Test set 76.85482 1185.761 715.7763 2.319121 53.37024 0.03753834 1.303367 #> #> $testfit #> Time Series: #> Start = 1821 #> End = 1934 #> Frequency = 1 #> [1] NA NA NA NA NA NA #> [7] NA NA NA NA NA 287.19570 #> [13] 184.21320 282.91496 409.19593 2192.03796 2877.01566 3417.18384 #> [19] 2022.21189 1599.00233 149.74329 47.64919 67.24354 211.40517 #> [25] 532.11622 1052.86007 2092.77341 2549.59355 987.47308 376.91182 #> [31] 352.80268 246.88152 358.68024 741.97139 1650.64997 2654.73639 #> [37] 3219.93678 2165.79913 730.32194 301.26331 365.38976 236.18078 #> [43] 522.28826 1577.03121 3280.64184 5675.68453 4409.60188 3106.08734 #> [49] 250.89901 424.84849 370.97720 762.50398 1617.20849 1772.41723 #> [55] 2325.21047 2529.90193 767.97707 296.31146 171.03166 258.69082 #> [61] 443.41225 762.85045 1975.78213 2924.22641 4344.50209 2604.72846 #> [67] 1570.87272 149.85585 40.30856 50.70034 66.53577 139.63290 #> [73] 377.87725 585.66515 3965.98801 3512.01272 1134.45446 106.48592 #> [79] 155.49786 365.45650 770.68567 1319.06536 3391.92020 3441.94281 #> [85] 5951.02582 3771.51526 1781.75796 370.88750 382.15521 789.27459 #> [91] 1395.54100 2761.97997 3672.80097 3164.25896 2874.32795 3572.64579 #> [97] 672.93393 84.42843 53.25289 106.46359 222.59445 411.01094 #> [103] 1147.65876 1042.18121 3431.96897 2909.09436 1483.21392 498.12837 #> [109] 454.26605 707.99384 1175.52810 1648.48631 2659.55348 3352.11427 #> #> $testset #> [1] 1 6 8 9 10 12 20 30 41 48 56 59 67 68 72 74 77 84 99 #> [20] 104 110 111 112 #> library(ggplot2) autoplot(lynx, series=\"Data\") + autolayer(modelcv$testfit, series=\"Fits\") + autolayer(modelcv$residuals, series=\"Residuals\") #> Warning: Removed 11 rows containing missing values or values outside the scale range #> (`geom_line()`). #> Warning: Removed 11 rows containing missing values or values outside the scale range #> (`geom_line()`). ggAcf(modelcv$residuals)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":null,"dir":"Reference","previous_headings":"","what":"Accuracy measures for a forecast model — accuracy.default","title":"Accuracy measures for a forecast model — accuracy.default","text":"Returns range summary measures forecast accuracy. x provided, function measures test set forecast accuracy based x-f. x provided, function produces training set accuracy measures forecasts based f[\"x\"]-fitted(f). measures defined discussed Hyndman Koehler (2006).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Accuracy measures for a forecast model — accuracy.default","text":"","code":"# S3 method for default accuracy(object, x, test = NULL, d = NULL, D = NULL, f = NULL, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Accuracy measures for a forecast model — accuracy.default","text":"object object class “forecast”, numerical vector containing forecasts. also work Arima, ets lm objects x omitted -- case training set accuracy measures returned. x optional numerical vector containing actual values length object, time series overlapping times f. test Indicator elements x f test. test NULL, elements used. Otherwise test numeric vector containing indices elements use test. d integer indicating number lag-1 differences used denominator MASE calculation. Default value 1 non-seasonal series 0 seasonal series. D integer indicating number seasonal differences used denominator MASE calculation. Default value 0 non-seasonal series 1 seasonal series. f Deprecated. Please use `object` instead. ... Additional arguments depending specific method.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Accuracy measures for a forecast model — accuracy.default","text":"Matrix giving forecast accuracy measures.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Accuracy measures for a forecast model — accuracy.default","text":"measures calculated : : Mean Error RMSE: Root Mean Squared Error MAE: Mean Absolute Error MPE: Mean Percentage Error MAPE: Mean Absolute Percentage Error MASE: Mean Absolute Scaled Error ACF1: Autocorrelation errors lag 1. default, MASE calculation scaled using MAE training set naive forecasts non-seasonal time series, training set seasonal naive forecasts seasonal time series training set mean forecasts non-time series data. f numerical vector rather forecast object, MASE returned training data available. See Hyndman Koehler (2006) Hyndman Athanasopoulos (2014, Section 2.5) details.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Accuracy measures for a forecast model — accuracy.default","text":"Hyndman, R.J. Koehler, .B. (2006) \"Another look measures forecast accuracy\". International Journal Forecasting, 22(4), 679-688. Hyndman, R.J. Athanasopoulos, G. (2018) \"Forecasting: principles practice\", 2nd ed., OTexts, Melbourne, Australia. Section 3.4 \"Evaluating forecast accuracy\". https://otexts.com/fpp2/accuracy.html.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Accuracy measures for a forecast model — accuracy.default","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Accuracy measures for a forecast model — accuracy.default","text":"","code":"fit1 <- rwf(EuStockMarkets[1:200, 1], h = 100) fit2 <- meanf(EuStockMarkets[1:200, 1], h = 100) accuracy(fit1) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 0.4393467 15.8461 8.959648 0.02128535 0.5533582 1 -0.007760885 accuracy(fit2) #> ME RMSE MAE MPE MAPE MASE #> Training set 6.24991e-14 57.83723 46.98108 -0.1240662 2.865357 1 accuracy(fit1, EuStockMarkets[201:300, 1]) #> ME RMSE MAE MPE MAPE MASE #> Training set 0.4393467 15.8461 8.959648 0.02128535 0.5533582 1.00000 #> Test set 0.8900000 78.1811 63.311200 -0.16763307 3.7897316 7.06626 #> ACF1 #> Training set -0.007760885 #> Test set NA accuracy(fit2, EuStockMarkets[201:300, 1]) #> ME RMSE MAE MPE MAPE MASE #> Training set 6.249910e-14 57.83723 46.98108 -0.1240662 2.865357 1.000000 #> Test set 8.429485e+01 114.96571 105.65361 4.7004265 6.075968 2.248855 plot(fit1) lines(EuStockMarkets[1:300, 1])"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit a fractionally differenced ARFIMA model — arfima","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"ARFIMA(p,d,q) model selected estimated automatically using Hyndman-Khandakar (2008) algorithm select p q Haslett Raftery (1989) algorithm estimate parameters including d.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"","code":"arfima( y, drange = c(0, 0.5), estim = c(\"mle\", \"ls\"), model = NULL, lambda = NULL, biasadj = FALSE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"y univariate time series (numeric vector). drange Allowable values d considered. Default c(0,0.5) ensures stationary model returned. estim estim==\"ls\", ARMA parameters calculated using Haslett-Raftery algorithm. estim==\"mle\", ARMA parameters calculated using full MLE via arima function. model Output previous call arfima. model passed, model fitted y without re-estimating parameters. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. x Deprecated. Included backwards compatibility. ... arguments passed auto.arima selecting p q.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"list object S3 class \"fracdiff\", described fracdiff documentation. additional objects added list including x (original time series), residuals fitted values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"function combines fracdiff auto.arima automatically select estimate ARFIMA model. fractional differencing parameter chosen first assuming ARFIMA(2,d,0) model. data fractionally differenced using estimated d ARMA model selected resulting time series using auto.arima. Finally, full ARFIMA(p,d,q) model re-estimated using fracdiff. estim==\"mle\", ARMA coefficients refined using arima.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"J. Haslett . E. Raftery (1989) Space-time Modelling Long-memory Dependence: Assessing Ireland's Wind Power Resource (discussion); Applied Statistics 38, 1-50. Hyndman, R.J. Khandakar, Y. (2008) \"Automatic time series forecasting: forecast package R\", Journal Statistical Software, 26(3).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"Rob J Hyndman Farah Yasmeen","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"","code":"library(fracdiff) x <- fracdiff.sim( 100, ma=-.4, d=.3)$series fit <- arfima(x) tsdisplay(residuals(fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":null,"dir":"Reference","previous_headings":"","what":"Errors from a regression model with ARIMA errors — arima.errors","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"Returns time series regression residuals fitted ARIMA model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"","code":"arima.errors(object)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"object object containing time series model class Arima.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"ts object","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"deprecated function identical residuals.Arima(object, type=\"regression\") Regression residuals equal original data minus effect regression variables. regression variables, errors identical original series (possibly adjusted zero mean).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the order of an ARIMA or ARFIMA model — arimaorder","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"Returns order univariate ARIMA ARFIMA model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"","code":"arimaorder(object)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"object object class “Arima”, dQuotear “fracdiff”. Usually result call arima, Arima, auto.arima, ar, arfima fracdiff.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"numerical vector giving values \\(p\\), \\(d\\) \\(q\\) ARIMA ARFIMA model. seasonal ARIMA model, returned vector contains values \\(p\\), \\(d\\), \\(q\\), \\(P\\), \\(D\\), \\(Q\\) \\(m\\), \\(m\\) period seasonality.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"","code":"WWWusage %>% auto.arima %>% arimaorder #> p d q #> 1 1 1"},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit best ARIMA model to univariate time series — auto.arima","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"Returns best ARIMA model according either AIC, AICc BIC value. function conducts search possible model within order constraints provided.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"","code":"auto.arima( y, d = NA, D = NA, max.p = 5, max.q = 5, max.P = 2, max.Q = 2, max.order = 5, max.d = 2, max.D = 1, start.p = 2, start.q = 2, start.P = 1, start.Q = 1, stationary = FALSE, seasonal = TRUE, ic = c(\"aicc\", \"aic\", \"bic\"), stepwise = TRUE, nmodels = 94, trace = FALSE, approximation = (length(x) > 150 | frequency(x) > 12), method = NULL, truncate = NULL, xreg = NULL, test = c(\"kpss\", \"adf\", \"pp\"), test.args = list(), seasonal.test = c(\"seas\", \"ocsb\", \"hegy\", \"ch\"), seasonal.test.args = list(), allowdrift = TRUE, allowmean = TRUE, lambda = NULL, biasadj = FALSE, parallel = FALSE, num.cores = 2, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"y univariate time series d Order first-differencing. missing, choose value based test. D Order seasonal-differencing. missing, choose value based season.test. max.p Maximum value p max.q Maximum value q max.P Maximum value P max.Q Maximum value Q max.order Maximum value p+q+P+Q model selection stepwise. max.d Maximum number non-seasonal differences max.D Maximum number seasonal differences start.p Starting value p stepwise procedure. start.q Starting value q stepwise procedure. start.P Starting value P stepwise procedure. start.Q Starting value Q stepwise procedure. stationary TRUE, restricts search stationary models. seasonal FALSE, restricts search non-seasonal models. ic Information criterion used model selection. stepwise TRUE, stepwise selection (faster). Otherwise, searches models. Non-stepwise selection can slow, especially seasonal models. nmodels Maximum number models considered stepwise search. trace TRUE, list ARIMA models considered reported. approximation TRUE, estimation via conditional sums squares information criteria used model selection approximated. final model still computed using maximum likelihood estimation. Approximation used long time series high seasonal period avoid excessive computation times. method fitting method: maximum likelihood minimize conditional sum--squares. default (unless missing values) use conditional-sum--squares find starting values, maximum likelihood. Can abbreviated. truncate integer value indicating many observations use model selection. last truncate values series used select model truncate NULL approximation=TRUE. observations used either truncate=NULL approximation=FALSE. xreg Optionally, numerical vector matrix external regressors, must number rows y. (data frame.) test Type unit root test use. See ndiffs details. test.args Additional arguments passed unit root test. seasonal.test determines method used select number seasonal differences. default method use measure seasonal strength computed STL decomposition. possibilities involve seasonal unit root tests. seasonal.test.args Additional arguments passed seasonal unit root test. See nsdiffs details. allowdrift TRUE, models drift terms considered. allowmean TRUE, models non-zero mean considered. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. parallel TRUE stepwise = FALSE, specification search done parallel. can give significant speedup multicore machines. num.cores Allows user specify amount parallel processes used parallel = TRUE stepwise = FALSE. NULL, number logical cores automatically detected available cores used. x Deprecated. Included backwards compatibility. ... Additional arguments passed arima.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"Arima","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"default arguments designed rapid estimation models many time series. analysing just one time series, can afford take time, recommended set stepwise=FALSE approximation=FALSE. Non-stepwise selection can slow, especially seasonal data. stepwise algorithm outlined Hyndman & Khandakar (2008) used except default method selecting seasonal differences now based estimate seasonal strength (Wang, Smith & Hyndman, 2006) rather Canova-Hansen test. also minor variations algorithm described Hyndman Khandakar (2008).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"Hyndman, RJ Khandakar, Y (2008) \"Automatic time series forecasting: forecast package R\", Journal Statistical Software, 26(3). Wang, X, Smith, KA, Hyndman, RJ (2006) \"Characteristic-based clustering time series data\", Data Mining Knowledge Discovery, 13(3), 335-364.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"","code":"fit <- auto.arima(WWWusage) plot(forecast(fit,h=20))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autolayer.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a ggplot layer appropriate to a particular data type — autolayer","title":"Create a ggplot layer appropriate to a particular data type — autolayer","text":"autolayer() uses ggplot2 draw particular layer object particular class single command. defines S3 generic classes packages can extend.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autolayer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a ggplot layer appropriate to a particular data type — autolayer","text":"","code":"autolayer(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autolayer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a ggplot layer appropriate to a particular data type — autolayer","text":"object object, whose class determine behaviour autolayer ... arguments passed specific methods","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autolayer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a ggplot layer appropriate to a particular data type — autolayer","text":"ggplot layer","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":null,"dir":"Reference","previous_headings":"","what":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"Produces ggplot object equivalent Acf, Pacf, Ccf, taperedacf taperedpacf functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"","code":"# S3 method for acf autoplot(object, ci = 0.95, ...) ggAcf( x, lag.max = NULL, type = c(\"correlation\", \"covariance\", \"partial\"), plot = TRUE, na.action = na.contiguous, demean = TRUE, ... ) ggPacf( x, lag.max = NULL, plot = TRUE, na.action = na.contiguous, demean = TRUE, ... ) ggCcf( x, y, lag.max = NULL, type = c(\"correlation\", \"covariance\"), plot = TRUE, na.action = na.contiguous, ... ) # S3 method for mpacf autoplot(object, ...) ggtaperedacf( x, lag.max = NULL, type = c(\"correlation\", \"partial\"), plot = TRUE, calc.ci = TRUE, level = 95, nsim = 100, ... ) ggtaperedpacf(x, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"object Object class “acf”. ci coverage probability confidence interval. Plotting confidence interval suppressed ci zero negative. ... plotting parameters affect plot. x univariate multivariate (Ccf) numeric time series object numeric vector matrix. lag.max maximum lag calculate acf. type character string giving type acf computed. Allowed values \"correlation\" (default), “covariance” “partial”. plot logical. TRUE (default) resulting ACF, PACF CCF plotted. na.action function handle missing values. Default na.contiguous. Useful alternatives na.pass na.interp. demean covariances sample means? y univariate numeric time series object numeric vector. calc.ci TRUE, confidence intervals ACF/PACF estimates calculated. level Percentage level used confidence intervals. nsim number bootstrap samples used estimating confidence intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"ggplot object.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"autoplot given acf mpacf object, appropriate ggplot object created. ggtaperedpacf","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"","code":"library(ggplot2) ggAcf(wineind) wineind %>% Acf(plot=FALSE) %>% autoplot if (FALSE) { wineind %>% taperedacf(plot=FALSE) %>% autoplot ggtaperedacf(wineind) ggtaperedpacf(wineind)} ggCcf(mdeaths, fdeaths)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"Produces ggplot object seasonally decomposed time series objects class “stl” (created stl), class “seas” (created seas), class “decomposed.ts” (created decompose).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"","code":"# S3 method for decomposed.ts autoplot(object, labels = NULL, range.bars = NULL, ...) # S3 method for stl autoplot(object, labels = NULL, range.bars = TRUE, ...) # S3 method for StructTS autoplot(object, labels = NULL, range.bars = TRUE, ...) # S3 method for seas autoplot(object, labels = NULL, range.bars = NULL, ...) # S3 method for mstl autoplot(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"object Object class “seas”, “stl”, “decomposed.ts”. labels Labels replace “seasonal”, “trend”, “remainder”. range.bars Logical indicating plot bar right side representing relative size. NULL, automatic selection takes place. ... plotting parameters affect plot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"Returns object class ggplot.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"","code":"library(ggplot2) co2 %>% decompose() %>% autoplot() nottem %>% stl(s.window = \"periodic\") %>% autoplot() if (FALSE) { library(seasonal) seas(USAccDeaths) %>% autoplot() }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatically create a ggplot for time series objects — autolayer.mts","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"autoplot takes object type ts mts creates ggplot object suitable usage stat_forecast.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"","code":"# S3 method for mts autolayer(object, colour = TRUE, series = NULL, ...) # S3 method for msts autolayer(object, series = NULL, ...) # S3 method for ts autolayer(object, colour = TRUE, series = NULL, ...) # S3 method for ts autoplot( object, series = NULL, xlab = \"Time\", ylab = deparse(substitute(object)), main = NULL, ... ) # S3 method for mts autoplot( object, colour = TRUE, facets = FALSE, xlab = \"Time\", ylab = deparse(substitute(object)), main = NULL, ... ) # S3 method for msts autoplot(object, ...) # S3 method for ts fortify(model, data, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"object Object class “ts” “mts”. colour TRUE, time series assigned colour aesthetic series Identifies time series colour, integrates well functionality geom_forecast. ... plotting parameters affect plot. xlab X-axis label. ylab Y-axis label. main Main title. facets TRUE, multiple time series faceted (unless specified, colour set FALSE). FALSE, series assigned colour. model Object class “ts” converted “data.frame”. data used (required fortify method)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"None. Function produces ggplot graph.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"fortify.ts takes ts object converts data frame (usage ggplot2).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"","code":"library(ggplot2) autoplot(USAccDeaths) lungDeaths <- cbind(mdeaths, fdeaths) autoplot(lungDeaths) autoplot(lungDeaths, facets=TRUE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using a bagged model — baggedModel","title":"Forecasting using a bagged model — baggedModel","text":"bagged model forecasting method.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using a bagged model — baggedModel","text":"","code":"baggedModel(y, bootstrapped_series = bld.mbb.bootstrap(y, 100), fn = ets, ...) baggedETS(y, bootstrapped_series = bld.mbb.bootstrap(y, 100), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using a bagged model — baggedModel","text":"y numeric vector time series class ts. bootstrapped_series bootstrapped versions y. fn forecast function use. Default ets. ... arguments passed forecast function.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using a bagged model — baggedModel","text":"Returns object class \"baggedModel\". function print used obtain print summary results. models list containing fitted ensemble models. method function producing forecastable model. y original time series. bootstrapped_series bootstrapped series. modelargs arguments passed fn. fitted Fitted values (one-step forecasts). mean fitted values calculated ensemble. residuals Original values minus fitted values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using a bagged model — baggedModel","text":"function implements bagged model forecasting method described Bergmeir et al. default, ets function applied bootstrapped series. Base models ets can given parameter fn. Using default parameters, function bld.mbb.bootstrap used calculate bootstrapped series Box-Cox Loess-based decomposition (BLD) bootstrap. function forecast.baggedModel can used calculate forecasts. baggedETS wrapper baggedModel, setting fn \"ets\". function included backwards compatibility , may deprecated future.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasting using a bagged model — baggedModel","text":"Bergmeir, C., R. J. Hyndman, J. M. Benitez (2016). Bagging Exponential Smoothing Methods using STL Decomposition Box-Cox Transformation. International Journal Forecasting 32, 303-312.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using a bagged model — baggedModel","text":"Christoph Bergmeir, Fotios Petropoulos","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using a bagged model — baggedModel","text":"","code":"fit <- baggedModel(WWWusage) fcast <- forecast(fit) plot(fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":null,"dir":"Reference","previous_headings":"","what":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"Fits BATS model applied y, described De Livera, Hyndman & Snyder (2011). Parallel processing used default speed computations.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"","code":"bats( y, use.box.cox = NULL, use.trend = NULL, use.damped.trend = NULL, seasonal.periods = NULL, use.arma.errors = TRUE, use.parallel = length(y) > 1000, num.cores = 2, bc.lower = 0, bc.upper = 1, biasadj = FALSE, model = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"y time series forecast. Can numeric, msts ts. univariate time series supported. use.box.cox TRUE/FALSE indicates whether use Box-Cox transformation . NULL tried best fit selected AIC. use.trend TRUE/FALSE indicates whether include trend . NULL tried best fit selected AIC. use.damped.trend TRUE/FALSE indicates whether include damping parameter trend . NULL tried best fit selected AIC. seasonal.periods y numeric seasonal periods can specified parameter. use.arma.errors TRUE/FALSE indicates whether include ARMA errors . TRUE best fit selected AIC. FALSE selection algorithm consider ARMA errors. use.parallel TRUE/FALSE indicates whether use parallel processing. num.cores number parallel processes used using parallel processing. NULL number logical cores detected available cores used. bc.lower lower limit (inclusive) Box-Cox transformation. bc.upper upper limit (inclusive) Box-Cox transformation. biasadj Use adjusted back-transformed mean Box-Cox transformations. TRUE, point forecasts fitted values mean forecast. Otherwise, points can considered median forecast densities. model Output previous call bats. model passed, model fitted y without re-estimating parameters. ... Additional arguments passed auto.arima choose ARMA(p, q) model errors. (Note xreg ignored, arguments concerning seasonality differencing, arguments controlling values p q used.)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"object class \"bats\". generic accessor functions fitted.values residuals extract useful features value returned bats associated functions. fitted model designated BATS(omega, p,q, phi, m1,...mJ) omega Box-Cox parameter phi damping parameter; error modelled ARMA(p,q) process m1,...,mJ list seasonal periods used model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"De Livera, .M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series complex seasonal patterns using exponential smoothing, Journal American Statistical Association, 106(496), 1513-1527.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"","code":"if (FALSE) { fit <- bats(USAccDeaths) plot(forecast(fit)) taylor.fit <- bats(taylor) plot(forecast(taylor.fit)) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":null,"dir":"Reference","previous_headings":"","what":"Number of trading days in each season — bizdays","title":"Number of trading days in each season — bizdays","text":"Returns number trading days month quarter observed time period major financial center.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number of trading days in each season — bizdays","text":"","code":"bizdays(x, FinCenter = c(\"New York\", \"London\", \"NERC\", \"Toronto\", \"Zurich\"))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number of trading days in each season — bizdays","text":"x Monthly quarterly time series FinCenter Major financial center.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number of trading days in each season — bizdays","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Number of trading days in each season — bizdays","text":"Useful trading days length adjustments. define \"business days\", please refer isBizday.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Number of trading days in each season — bizdays","text":"Earo Wang","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number of trading days in each season — bizdays","text":"","code":"x <- ts(rnorm(30), start = c(2013, 2), frequency = 12) bizdays(x, FinCenter = \"New York\") #> Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec #> 2013 19 20 22 22 20 22 22 20 23 20 21 #> 2014 21 19 21 21 21 21 22 21 21 23 19 22 #> 2015 20 19 22 21 20 22 22"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"Generates bootstrapped versions time series using Box-Cox Loess-based decomposition bootstrap.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"","code":"bld.mbb.bootstrap(x, num, block_size = NULL)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"x Original time series. num Number bootstrapped versions generate. block_size Block size moving block bootstrap.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"list bootstrapped versions series. first series list original series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"procedure described Bergmeir et al. Box-Cox decomposition applied, together STL Loess (non-seasonal time series), remainder bootstrapped using moving block bootstrap.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"Bergmeir, C., R. J. Hyndman, J. M. Benitez (2016). Bagging Exponential Smoothing Methods using STL Decomposition Box-Cox Transformation. International Journal Forecasting 32, 303-312.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"Christoph Bergmeir, Fotios Petropoulos","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"","code":"bootstrapped_series <- bld.mbb.bootstrap(WWWusage, 100)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that residuals from a time series model look like white noise — checkresiduals","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"plot=TRUE, produces time plot residuals, corresponding ACF, histogram. test FALSE, output either Ljung-Box test Breusch-Godfrey test printed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"","code":"checkresiduals(object, lag, test, plot = TRUE, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"object Either time series model, forecast object, time series (assumed residuals). lag Number lags use Ljung-Box Breusch-Godfrey test. missing, set min(10,n/5) non-seasonal data, min(2m, n/5) seasonal data, n length series, m seasonal period data. constrained least df+3 df degrees freedom model. ensures least 3 degrees freedom used chi-squared test. test Test use serial correlation. default, object class lm, test=\"BG\". Otherwise, test=\"LB\". Setting test=FALSE prevent test results printed. plot Logical. TRUE, produce plot. ... arguments passed ggtsdisplay.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"None","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"","code":"fit <- ets(WWWusage) checkresiduals(fit) #> #> \tLjung-Box test #> #> data: Residuals from ETS(A,Ad,N) #> Q* = 28.995, df = 10, p-value = 0.001249 #> #> Model df: 0. Total lags used: 10 #>"},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasts for intermittent demand using Croston's method — croston","title":"Forecasts for intermittent demand using Croston's method — croston","text":"Returns forecasts information Croston's forecasts applied y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasts for intermittent demand using Croston's method — croston","text":"","code":"croston(y, h = 10, alpha = 0.1, x = y)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasts for intermittent demand using Croston's method — croston","text":"y numeric vector time series class ts h Number periods forecasting. alpha Value alpha. Default value 0.1. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasts for intermittent demand using Croston's method — croston","text":"object class \"forecast\" list containing least following elements: model list containing information fitted model. first element gives model used non-zero demands. second element gives model used times non-zero demands. elements class forecast. method name forecasting method character string mean Point forecasts time series x original time series (either object time series used create model stored object). residuals Residuals fitted model. y minus fitted values. fitted Fitted values (one-step forecasts) function summary used obtain print summary results, function plot produces plot forecasts. generic accessor functions fitted.values residuals extract useful features value returned croston associated functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasts for intermittent demand using Croston's method — croston","text":"Based Croston's (1972) method intermittent demand forecasting, also described Shenstone Hyndman (2005). Croston's method involves using simple exponential smoothing (SES) non-zero elements time series separate application SES times non-zero elements time series. smoothing parameters two applications SES assumed equal denoted alpha. Note prediction intervals computed Croston's method underlying stochastic model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasts for intermittent demand using Croston's method — croston","text":"Croston, J. (1972) \"Forecasting stock control intermittent demands\", Operational Research Quarterly, 23(3), 289-303. Shenstone, L., Hyndman, R.J. (2005) \"Stochastic models underlying Croston's method intermittent demand forecasting\". Journal Forecasting, 24, 389-402.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasts for intermittent demand using Croston's method — croston","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasts for intermittent demand using Croston's method — croston","text":"","code":"y <- rpois(20,lambda=.3) fcast <- croston(y) plot(fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Diebold-Mariano test for predictive accuracy — dm.test","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"Diebold-Mariano test compares forecast accuracy two forecast methods.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"","code":"dm.test( e1, e2, alternative = c(\"two.sided\", \"less\", \"greater\"), h = 1, power = 2, varestimator = c(\"acf\", \"bartlett\") )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"e1 Forecast errors method 1. e2 Forecast errors method 2. alternative character string specifying alternative hypothesis, must one \"two.sided\" (default), \"greater\" \"less\". can specify just initial letter. h forecast horizon used calculating e1 e2. power power used loss function. Usually 1 2. varestimator character string specifying long-run variance estimator. Options \"acf\" (default) \"bartlett\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"list class \"htest\" containing following components: statistic value DM-statistic. parameter forecast horizon loss function power used test. alternative character string describing alternative hypothesis. varestimator character string describing long-run variance estimator. p.value p-value test. method character string value \"Diebold-Mariano Test\". data.name character vector giving names two error series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"function implements modified test proposed Harvey, Leybourne Newbold (1997). null hypothesis two methods forecast accuracy. alternative=\"less\", alternative hypothesis method 2 less accurate method 1. alternative=\"greater\", alternative hypothesis method 2 accurate method 1. alternative=\"two.sided\", alternative hypothesis method 1 method 2 different levels accuracy. long-run variance estimator can either auto-correlation estimator varestimator = \"acf\", estimator based Bartlett weights varestimator = \"bartlett\" ensures positive estimate. long-run variance estimators proposed Diebold Mariano (1995).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"Diebold, F.X. Mariano, R.S. (1995) Comparing predictive accuracy. Journal Business Economic Statistics, 13, 253-263. Harvey, D., Leybourne, S., & Newbold, P. (1997). Testing equality prediction mean squared errors. International Journal forecasting, 13(2), 281-291.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"George Athanasopoulos Kirill Kuroptev","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"","code":"# Test on in-sample one-step forecasts f1 <- ets(WWWusage) f2 <- auto.arima(WWWusage) accuracy(f1) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 0.2243266 3.40781 2.761668 0.2629465 2.162415 0.6102792 0.2308014 accuracy(f2) #> ME RMSE MAE MPE MAPE MASE #> Training set 0.3035616 3.113754 2.405275 0.2805566 1.917463 0.5315228 #> ACF1 #> Training set -0.01715517 dm.test(residuals(f1), residuals(f2), h = 1) #> #> \tDiebold-Mariano Test #> #> data: residuals(f1)residuals(f2) #> DM = 1.9078, Forecast horizon = 1, Loss function power = 2, p-value = #> 0.05932 #> alternative hypothesis: two.sided #> # Test on out-of-sample one-step forecasts f1 <- ets(WWWusage[1:80]) f2 <- auto.arima(WWWusage[1:80]) f1.out <- ets(WWWusage[81:100], model = f1) #> Model is being refit with current smoothing parameters but initial states are being re-estimated. #> Set 'use.initial.values=TRUE' if you want to re-use existing initial values. f2.out <- Arima(WWWusage[81:100], model = f2) accuracy(f1.out) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 0.2100836 3.24835 2.570459 0.1203497 1.352355 0.4246845 0.2287215 accuracy(f2.out) #> ME RMSE MAE MPE MAPE MASE #> Training set 1.081679 3.329012 2.437119 0.6810673 1.375924 0.4026544 #> ACF1 #> Training set -0.004460367 dm.test(residuals(f1.out), residuals(f2.out), h = 1) #> #> \tDiebold-Mariano Test #> #> data: residuals(f1.out)residuals(f2.out) #> DM = -0.14392, Forecast horizon = 1, Loss function power = 2, p-value = #> 0.8871 #> alternative hypothesis: two.sided #>"},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":null,"dir":"Reference","previous_headings":"","what":"Double-Seasonal Holt-Winters Forecasting — dshw","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"Returns forecasts using Taylor's (2003) Double-Seasonal Holt-Winters method.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"","code":"dshw( y, period1 = NULL, period2 = NULL, h = 2 * max(period1, period2), alpha = NULL, beta = NULL, gamma = NULL, omega = NULL, phi = NULL, lambda = NULL, biasadj = FALSE, armethod = TRUE, model = NULL )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"y Either msts object two seasonal periods numeric vector. period1 Period shorter seasonal period. used y msts object. period2 Period longer seasonal period. used y msts object. h Number periods forecasting. alpha Smoothing parameter level. NULL, parameter estimated using least squares. beta Smoothing parameter slope. NULL, parameter estimated using least squares. gamma Smoothing parameter first seasonal period. NULL, parameter estimated using least squares. omega Smoothing parameter second seasonal period. NULL, parameter estimated using least squares. phi Autoregressive parameter. NULL, parameter estimated using least squares. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. armethod TRUE, forecasts adjusted using AR(1) model errors. model specified, existing model applied new data set.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"object class \"forecast\" list includes following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series x original time series. residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) function summary used obtain print summary results, function plot produces plot forecasts. generic accessor functions fitted.values residuals extract useful features value returned dshw.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"Taylor's (2003) double-seasonal Holt-Winters method uses additive trend multiplicative seasonality, two seasonal components multiplied together. example, series half-hourly data, one set period1=48 daily period period2=336 weekly period. smoothing parameter notation used different Taylor (2003); instead matches used Hyndman et al (2008) used ets function.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"Taylor, J.W. (2003) Short-term electricity demand forecasting using double seasonal exponential smoothing. Journal Operational Research Society, 54, 799-805. Hyndman, R.J., Koehler, .B., Ord, J.K., Snyder, R.D. (2008) Forecasting exponential smoothing: state space approach, Springer-Verlag. http://www.exponentialsmoothing.net.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"","code":"if (FALSE) { fcast <- dshw(taylor) plot(fcast) t <- seq(0,5,by=1/20) x <- exp(sin(2*pi*t) + cos(2*pi*t*4) + rnorm(length(t),0,.1)) fit <- dshw(x,20,5) plot(fit) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":null,"dir":"Reference","previous_headings":"","what":"Easter holidays in each season — easter","title":"Easter holidays in each season — easter","text":"Returns vector 0's 1's fractional results Easter spans March April observed time period. Easter defined days Good Friday Easter Sunday inclusively, plus optionally Easter Monday easter.mon=TRUE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Easter holidays in each season — easter","text":"","code":"easter(x, easter.mon = FALSE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Easter holidays in each season — easter","text":"x Monthly quarterly time series easter.mon TRUE, length Easter holidays includes Easter Monday.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Easter holidays in each season — easter","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Easter holidays in each season — easter","text":"Useful adjusting calendar effects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Easter holidays in each season — easter","text":"Earo Wang","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Easter holidays in each season — easter","text":"","code":"easter(wineind, easter.mon = TRUE) #> Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec #> 1980 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1981 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1982 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1983 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1984 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1985 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1986 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1987 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1988 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1989 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1990 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1991 0.00 0.00 0.75 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1992 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1993 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1994 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential smoothing state space model — ets","title":"Exponential smoothing state space model — ets","text":"Returns ets model applied y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential smoothing state space model — ets","text":"","code":"ets( y, model = \"ZZZ\", damped = NULL, alpha = NULL, beta = NULL, gamma = NULL, phi = NULL, additive.only = FALSE, lambda = NULL, biasadj = FALSE, lower = c(rep(1e-04, 3), 0.8), upper = c(rep(0.9999, 3), 0.98), opt.crit = c(\"lik\", \"amse\", \"mse\", \"sigma\", \"mae\"), nmse = 3, bounds = c(\"both\", \"usual\", \"admissible\"), ic = c(\"aicc\", \"aic\", \"bic\"), restrict = TRUE, allow.multiplicative.trend = FALSE, use.initial.values = FALSE, na.action = c(\"na.contiguous\", \"na.interp\", \"na.fail\"), ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential smoothing state space model — ets","text":"y numeric vector time series class ts model Usually three-character string identifying method using framework terminology Hyndman et al. (2002) Hyndman et al. (2008). first letter denotes error type (\"\", \"M\" \"Z\"); second letter denotes trend type (\"N\",\"\",\"M\" \"Z\"); third letter denotes season type (\"N\",\"\",\"M\" \"Z\"). cases, \"N\"=none, \"\"=additive, \"M\"=multiplicative \"Z\"=automatically selected. , example, \"ANN\" simple exponential smoothing additive errors, \"MAM\" multiplicative Holt-Winters' method multiplicative errors, . also possible model class \"ets\", equal output previous call ets. case, model fitted y without re-estimating smoothing parameters. See also use.initial.values argument. damped TRUE, use damped trend (either additive multiplicative). NULL, damped non-damped trends tried best model (according information criterion ic) returned. alpha Value alpha. NULL, estimated. beta Value beta. NULL, estimated. gamma Value gamma. NULL, estimated. phi Value phi. NULL, estimated. additive.TRUE, consider additive models. Default FALSE. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. lambda specified, additive.set TRUE. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. lower Lower bounds parameters (alpha, beta, gamma, phi). Ignored bounds==\"admissible\". upper Upper bounds parameters (alpha, beta, gamma, phi). Ignored bounds==\"admissible\". opt.crit Optimization criterion. One \"mse\" (Mean Square Error), \"amse\" (Average MSE first nmse forecast horizons), \"sigma\" (Standard deviation residuals), \"mae\" (Mean absolute residuals), \"lik\" (Log-likelihood, default). nmse Number steps average multistep MSE (1<=nmse<=30). bounds Type parameter space impose: \"usual\" indicates parameters must lie specified lower upper bounds; \"admissible\" indicates parameters must lie admissible space; \"\" (default) takes intersection regions. ic Information criterion used model selection. restrict TRUE (default), models infinite variance allowed. allow.multiplicative.trend TRUE, models multiplicative trend allowed searching model. Otherwise, model space excludes . argument ignored multiplicative trend model explicitly requested (e.g., using model=\"MMN\"). use.initial.values TRUE model class \"ets\", initial values model also re-estimated. na.action function indicates happen data contains NA values. default, largest contiguous portion time-series used. ... undocumented arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential smoothing state space model — ets","text":"object class \"ets\". generic accessor functions fitted.values residuals extract useful features value returned ets associated functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential smoothing state space model — ets","text":"Based classification methods described Hyndman et al (2008). methodology fully automatic. required argument ets time series. model chosen automatically specified. methodology performed extremely well M3-competition data. (See Hyndman, et al, 2002, .)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Exponential smoothing state space model — ets","text":"Hyndman, R.J., Koehler, .B., Snyder, R.D., Grose, S. (2002) \"state space framework automatic forecasting using exponential smoothing methods\", International J. Forecasting, 18(3), 439--454. Hyndman, R.J., Akram, Md., Archibald, B. (2008) \"admissible parameter space exponential smoothing models\". Annals Statistical Mathematics, 60(2), 407--426. Hyndman, R.J., Koehler, .B., Ord, J.K., Snyder, R.D. (2008) Forecasting exponential smoothing: state space approach, Springer-Verlag. http://www.exponentialsmoothing.net.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Exponential smoothing state space model — ets","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential smoothing state space model — ets","text":"","code":"fit <- ets(USAccDeaths) plot(forecast(fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":null,"dir":"Reference","previous_headings":"","what":"Find dominant frequency of a time series — findfrequency","title":"Find dominant frequency of a time series — findfrequency","text":"findfrequency returns period dominant frequency time series. seasonal data, return seasonal period. cyclic data, return average cycle length.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find dominant frequency of a time series — findfrequency","text":"","code":"findfrequency(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find dominant frequency of a time series — findfrequency","text":"x numeric vector time series class ts","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find dominant frequency of a time series — findfrequency","text":"integer value","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find dominant frequency of a time series — findfrequency","text":"dominant frequency determined spectral analysis time series. First, linear trend removed, spectral density function estimated best fitting autoregressive model (based AIC). large (possibly local) maximum spectral density function frequency \\(f\\), function return period \\(1/f\\) (rounded nearest integer). dominant frequency can found, function return 1.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find dominant frequency of a time series — findfrequency","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find dominant frequency of a time series — findfrequency","text":"","code":"findfrequency(USAccDeaths) # Monthly data #> [1] 12 findfrequency(taylor) # Half-hourly data #> [1] 48 findfrequency(lynx) # Annual data #> [1] 10"},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":null,"dir":"Reference","previous_headings":"","what":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"Returns h-step forecasts data used fitting model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"","code":"# S3 method for ARFIMA fitted(object, h = 1, ...) # S3 method for Arima fitted(object, h = 1, ...) # S3 method for ar fitted(object, ...) # S3 method for bats fitted(object, h = 1, ...) # S3 method for ets fitted(object, h = 1, ...) # S3 method for modelAR fitted(object, h = 1, ...) # S3 method for nnetar fitted(object, h = 1, ...) # S3 method for tbats fitted(object, h = 1, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"object object class \"Arima\", \"bats\", \"tbats\", \"ets\" \"nnetar\". h number steps forecast ahead. ... arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"time series h-step forecasts.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"","code":"fit <- ets(WWWusage) plot(WWWusage) lines(fitted(fit), col='red') lines(fitted(fit, h=2), col='green') lines(fitted(fit, h=3), col='blue') legend(\"topleft\", legend=paste(\"h =\",1:3), col=2:4, lty=1)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast-package.html","id":null,"dir":"Reference","previous_headings":"","what":"forecast: Forecasting Functions for Time Series and Linear Models — forecast-package","title":"forecast: Forecasting Functions for Time Series and Linear Models — forecast-package","text":"Methods tools displaying analysing univariate time series forecasts including exponential smoothing via state space models automatic ARIMA modelling.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"forecast: Forecasting Functions for Time Series and Linear Models — forecast-package","text":"Maintainer: Rob Hyndman Rob.Hyndman@monash.edu (ORCID) [copyright holder] Authors: George Athanasopoulos (ORCID) Christoph Bergmeir (ORCID) Gabriel Caceres (ORCID) Leanne Chhay Kirill Kuroptev Mitchell O'Hara-Wild (ORCID) Fotios Petropoulos (ORCID) Slava Razbash Earo Wang (ORCID) Farah Yasmeen (ORCID) contributors: Federico Garza [contributor] Daniele Girolimetto [contributor] Ross Ihaka [contributor, copyright holder] R Core Team [contributor, copyright holder] Daniel Reid [contributor] David Shaub [contributor] Yuan Tang (ORCID) [contributor] Xiaoqian Wang [contributor] Zhenyu Zhou [contributor]","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"Returns forecasts information univariate ARIMA models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"","code":"# S3 method for fracdiff forecast( object, h = 10, level = c(80, 95), fan = FALSE, lambda = object$lambda, biasadj = NULL, ... ) # S3 method for Arima forecast( object, h = ifelse(object$arma[5] > 1, 2 * object$arma[5], 10), level = c(80, 95), fan = FALSE, xreg = NULL, lambda = object$lambda, bootstrap = FALSE, npaths = 5000, biasadj = NULL, ... ) # S3 method for ar forecast( object, h = 10, level = c(80, 95), fan = FALSE, lambda = NULL, bootstrap = FALSE, npaths = 5000, biasadj = FALSE, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"object object class \"Arima\", \"ar\" \"fracdiff\". Usually result call arima, auto.arima, ar, arfima fracdiff. h Number periods forecasting. xreg used, h ignored number forecast periods set number rows xreg. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments. xreg Future values regression variables (class Arima objects ). numerical vector matrix external regressors; data frame. bootstrap TRUE, prediction intervals computed using simulation resampled errors. npaths Number sample paths used computing simulated prediction intervals bootstrap=TRUE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.Arima. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"Arima ar objects, function calls predict.Arima predict.ar constructs object class \"forecast\" results. fracdiff objects, calculations done within forecast.fracdiff using equations given Peiris Perera (1988).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"Peiris, M. & Perera, B. (1988), prediction fractionally differenced ARIMA models, Journal Time Series Analysis, 9(3), 215-220.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"","code":"fit <- Arima(WWWusage,c(3,1,0)) plot(forecast(fit)) library(fracdiff) x <- fracdiff.sim( 100, ma=-.4, d=.3)$series fit <- arfima(x) plot(forecast(fit,h=30))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using Holt-Winters objects — forecast.HoltWinters","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"Returns forecasts information univariate Holt-Winters time series models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"","code":"# S3 method for HoltWinters forecast( object, h = ifelse(frequency(object$x) > 1, 2 * frequency(object$x), 10), level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"object object class \"HoltWinters\". Usually result call HoltWinters. h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.HoltWinters. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"function calls predict.HoltWinters constructs object class \"forecast\" results. included completeness, ets recommended use instead HoltWinters.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"","code":"fit <- HoltWinters(WWWusage,gamma=FALSE) plot(forecast(fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using Structural Time Series models — forecast.StructTS","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"Returns forecasts information univariate structural time series models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"","code":"# S3 method for StructTS forecast( object, h = ifelse(object$coef[\"epsilon\"] > 1e-10, 2 * object$xtsp[3], 10), level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"object object class \"StructTS\". Usually result call StructTS. h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.StructTS. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"function calls predict.StructTS constructs object class \"forecast\" results.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"","code":"fit <- StructTS(WWWusage,\"level\") plot(forecast(fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using a bagged model — forecast.baggedModel","title":"Forecasting using a bagged model — forecast.baggedModel","text":"Returns forecasts information bagged models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using a bagged model — forecast.baggedModel","text":"","code":"# S3 method for baggedModel forecast( object, h = ifelse(frequency(object$y) > 1, 2 * frequency(object$y), 10), ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using a bagged model — forecast.baggedModel","text":"object object class \"baggedModel\" resulting call baggedModel. h Number periods forecasting. ... arguments, passed forecast function original method","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using a bagged model — forecast.baggedModel","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using a bagged model — forecast.baggedModel","text":"Intervals calculated min max values point forecasts models ensemble. .e., intervals prediction intervals, give indication different forecasts within ensemble .","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasting using a bagged model — forecast.baggedModel","text":"Bergmeir, C., R. J. Hyndman, J. M. Benitez (2016). Bagging Exponential Smoothing Methods using STL Decomposition Box-Cox Transformation. International Journal Forecasting 32, 303-312.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using a bagged model — forecast.baggedModel","text":"Christoph Bergmeir, Fotios Petropoulos","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using a bagged model — forecast.baggedModel","text":"","code":"fit <- baggedModel(WWWusage) fcast <- forecast(fit) plot(fcast) if (FALSE) { fit2 <- baggedModel(WWWusage, fn=\"auto.arima\") fcast2 <- forecast(fit2) plot(fcast2) accuracy(fcast2)}"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using BATS and TBATS models — forecast.bats","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"Forecasts h steps ahead BATS model. Prediction intervals also produced.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"","code":"# S3 method for bats forecast(object, h, level = c(80, 95), fan = FALSE, biasadj = NULL, ...) # S3 method for tbats forecast(object, h, level = c(80, 95), fan = FALSE, biasadj = NULL, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"object object class \"bats\". Usually result call bats. h Number periods forecasting. Default value twice largest seasonal period (seasonal data) ten (non-seasonal data). level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. biasadj Use adjusted back-transformed mean Box-Cox transformations. TRUE, point forecasts fitted values mean forecast. Otherwise, points can considered median forecast densities. ... arguments, currently ignored.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.bats. object class \"forecast\" list containing least following elements: model copy bats object method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"De Livera, .M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series complex seasonal patterns using exponential smoothing, Journal American Statistical Association, 106(496), 1513-1527.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"","code":"if (FALSE) { fit <- bats(USAccDeaths) plot(forecast(fit)) taylor.fit <- bats(taylor) plot(forecast(taylor.fit)) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using ETS models — forecast.ets","title":"Forecasting using ETS models — forecast.ets","text":"Returns forecasts information univariate ETS models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using ETS models — forecast.ets","text":"","code":"# S3 method for ets forecast( object, h = ifelse(object$m > 1, 2 * object$m, 10), level = c(80, 95), fan = FALSE, simulate = FALSE, bootstrap = FALSE, npaths = 5000, PI = TRUE, lambda = object$lambda, biasadj = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using ETS models — forecast.ets","text":"object object class \"ets\". Usually result call ets. h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. simulate TRUE, prediction intervals produced simulation rather using analytic formulae. Errors assumed normally distributed. bootstrap TRUE, prediction intervals produced simulation using resampled errors (rather normally distributed errors). npaths Number sample paths used computing simulated prediction intervals. PI TRUE, prediction intervals produced, otherwise point forecasts calculated. PI FALSE, level, fan, simulate, bootstrap npaths ignored. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using ETS models — forecast.ets","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.ets. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. models additive errors, residuals x - fitted values. models multiplicative errors, residuals equal x /(fitted values) - 1. fitted Fitted values (one-step forecasts)","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using ETS models — forecast.ets","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using ETS models — forecast.ets","text":"","code":"fit <- ets(USAccDeaths) plot(forecast(fit,h=48))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast a linear model with possible time series components — forecast.lm","title":"Forecast a linear model with possible time series components — forecast.lm","text":"forecast.lm used predict linear models, especially involving trend seasonality components.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast a linear model with possible time series components — forecast.lm","text":"","code":"# S3 method for lm forecast( object, newdata, h = 10, level = c(80, 95), fan = FALSE, lambda = object$lambda, biasadj = NULL, ts = TRUE, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast a linear model with possible time series components — forecast.lm","text":"object Object class \"lm\", usually result call lm tslm. newdata optional data frame look variables predict. omitted, assumed variables trend season, h forecasts produced. h Number periods forecasting. Ignored newdata present. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ts TRUE, forecasts treated time series provided original data time series; newdata interpreted related subsequent time periods. FALSE, time series attributes original data ignored. ... arguments passed predict.lm().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast a linear model with possible time series components — forecast.lm","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.lm. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x historical data response variable. residuals Residuals fitted model. x minus fitted values. fitted Fitted values","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast a linear model with possible time series components — forecast.lm","text":"forecast.lm largely wrapper predict.lm() except allows variables \"trend\" \"season\" created fly time series characteristics data. Also, output reformatted forecast object.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast a linear model with possible time series components — forecast.lm","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast a linear model with possible time series components — forecast.lm","text":"","code":"y <- ts(rnorm(120,0,3) + 1:120 + 20*sin(2*pi*(1:120)/12), frequency=12) fit <- tslm(y ~ trend + season) plot(forecast(fit, h=20))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast a multiple linear model with possible time series components — forecast.mlm","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"forecast.mlm used predict multiple linear models, especially involving trend seasonality components.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"","code":"# S3 method for mlm forecast( object, newdata, h = 10, level = c(80, 95), fan = FALSE, lambda = object$lambda, biasadj = NULL, ts = TRUE, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"object Object class \"mlm\", usually result call lm tslm. newdata optional data frame look variables predict. omitted, assumed variables trend season, h forecasts produced. h Number periods forecasting. Ignored newdata present. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ts TRUE, forecasts treated time series provided original data time series; newdata interpreted related subsequent time periods. FALSE, time series attributes original data ignored. ... arguments passed forecast.lm().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"object class \"mforecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.lm. object class \"mforecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts multivariate time series lower Lower limits prediction intervals series upper Upper limits prediction intervals series level confidence values associated prediction intervals x historical data response variable. residuals Residuals fitted model. x minus fitted values. fitted Fitted values","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"forecast.mlm largely wrapper forecast.lm() except allows forecasts generated multiple series. Also, output reformatted mforecast object.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"","code":"lungDeaths <- cbind(mdeaths, fdeaths) fit <- tslm(lungDeaths ~ trend + season) fcast <- forecast(fit, h=10) carPower <- as.matrix(mtcars[,c(\"qsec\",\"hp\")]) carmpg <- mtcars[,\"mpg\"] fit <- lm(carPower ~ carmpg) fcast <- forecast(fit, newdata=data.frame(carmpg=30))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using user-defined model — forecast.modelAR","title":"Forecasting using user-defined model — forecast.modelAR","text":"Returns forecasts information user-defined models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using user-defined model — forecast.modelAR","text":"","code":"# S3 method for modelAR forecast( object, h = ifelse(object$m > 1, 2 * object$m, 10), PI = FALSE, level = c(80, 95), fan = FALSE, xreg = NULL, lambda = object$lambda, bootstrap = FALSE, npaths = 1000, innov = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using user-defined model — forecast.modelAR","text":"object object class \"modelAR\" resulting call modelAR. h Number periods forecasting. xreg used, h ignored number forecast periods set number rows xreg. PI TRUE, prediction intervals produced, otherwise point forecasts calculated. PI FALSE, level, fan, bootstrap npaths ignored. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. xreg Future values external regressor variables. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. bootstrap TRUE, prediction intervals computed using simulations resampled residuals rather normally distributed errors. Ignored innov NULL. npaths Number sample paths used computing simulated prediction intervals. innov Values use innovations prediction intervals. Must matrix h rows npaths columns (vectors coerced matrix). present, bootstrap ignored. ... Additional arguments passed simulate.nnetar","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using user-defined model — forecast.modelAR","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.nnetar. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) ... arguments","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using user-defined model — forecast.modelAR","text":"Prediction intervals calculated simulations can slow. Note model complex overfits data, residuals can arbitrarily small; used prediction interval calculations, lead misleadingly small values.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using user-defined model — forecast.modelAR","text":"Rob J Hyndman Gabriel Caceres","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting time series — forecast.mts","title":"Forecasting time series — forecast.mts","text":"mforecast class objects forecasting multivariate time series multivariate time series models. function invokes particular methods depend class first argument.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting time series — forecast.mts","text":"","code":"# S3 method for mts forecast( object, h = ifelse(frequency(object) > 1, 2 * frequency(object), 10), level = c(80, 95), fan = FALSE, robust = FALSE, lambda = NULL, biasadj = FALSE, find.frequency = FALSE, allow.multiplicative.trend = FALSE, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting time series — forecast.mts","text":"object multivariate time series multivariate time series model forecasts required h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. robust TRUE, function robust missing values outliers object. argument valid object class mts. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. find.frequency TRUE, function determines appropriate period, data unknown period. allow.multiplicative.trend TRUE, ETS models multiplicative trends allowed. Otherwise, additive trend ETS models permitted. ... Additional arguments affecting forecasts produced.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting time series — forecast.mts","text":"object class \"mforecast\". function summary used obtain print summary results, function plot produces plot multivariate forecasts prediction intervals. generic accessors functions fitted.values residuals extract various useful features value returned forecast$model. object class \"mforecast\" list usually containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. models additive errors, residuals x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting time series — forecast.mts","text":"example, function forecast.mlm makes multivariate forecasts based results produced tslm.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting time series — forecast.mts","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using neural network models — forecast.nnetar","title":"Forecasting using neural network models — forecast.nnetar","text":"Returns forecasts information univariate neural network models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using neural network models — forecast.nnetar","text":"","code":"# S3 method for nnetar forecast( object, h = ifelse(object$m > 1, 2 * object$m, 10), PI = FALSE, level = c(80, 95), fan = FALSE, xreg = NULL, lambda = object$lambda, bootstrap = FALSE, npaths = 1000, innov = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using neural network models — forecast.nnetar","text":"object object class \"nnetar\" resulting call nnetar. h Number periods forecasting. xreg used, h ignored number forecast periods set number rows xreg. PI TRUE, prediction intervals produced, otherwise point forecasts calculated. PI FALSE, level, fan, bootstrap npaths ignored. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. xreg Future values external regressor variables. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. bootstrap TRUE, prediction intervals computed using simulations resampled residuals rather normally distributed errors. Ignored innov NULL. npaths Number sample paths used computing simulated prediction intervals. innov Values use innovations prediction intervals. Must matrix h rows npaths columns (vectors coerced matrix). present, bootstrap ignored. ... Additional arguments passed simulate.nnetar","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using neural network models — forecast.nnetar","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.nnetar. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) ... arguments","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using neural network models — forecast.nnetar","text":"Prediction intervals calculated simulations can slow. Note network complex overfits data, residuals can arbitrarily small; used prediction interval calculations, lead misleadingly small values. possible use --sample residuals ameliorate , see examples.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using neural network models — forecast.nnetar","text":"Rob J Hyndman Gabriel Caceres","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using neural network models — forecast.nnetar","text":"","code":"## Fit & forecast model fit <- nnetar(USAccDeaths, size=2) fcast <- forecast(fit, h=20) plot(fcast) if (FALSE) { ## Include prediction intervals in forecast fcast2 <- forecast(fit, h=20, PI=TRUE, npaths=100) plot(fcast2) ## Set up out-of-sample innovations using cross-validation fit_cv <- CVar(USAccDeaths, size=2) res_sd <- sd(fit_cv$residuals, na.rm=TRUE) myinnovs <- rnorm(20*100, mean=0, sd=res_sd) ## Forecast using new innovations fcast3 <- forecast(fit, h=20, PI=TRUE, npaths=100, innov=myinnovs) plot(fcast3) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using stl objects — forecast.stl","title":"Forecasting using stl objects — forecast.stl","text":"Forecasts STL objects obtained applying non-seasonal forecasting method seasonally adjusted data re-seasonalizing using last year seasonal component.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using stl objects — forecast.stl","text":"","code":"# S3 method for stl forecast( object, method = c(\"ets\", \"arima\", \"naive\", \"rwdrift\"), etsmodel = \"ZZN\", forecastfunction = NULL, h = frequency(object$time.series) * 2, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = NULL, xreg = NULL, newxreg = NULL, allow.multiplicative.trend = FALSE, ... ) stlm( y, s.window = 7 + 4 * seq(6), robust = FALSE, method = c(\"ets\", \"arima\"), modelfunction = NULL, model = NULL, etsmodel = \"ZZN\", lambda = NULL, biasadj = FALSE, xreg = NULL, allow.multiplicative.trend = FALSE, x = y, ... ) # S3 method for stlm forecast( object, h = 2 * object$m, level = c(80, 95), fan = FALSE, lambda = object$lambda, biasadj = NULL, newxreg = NULL, allow.multiplicative.trend = FALSE, ... ) stlf( y, h = frequency(x) * 2, s.window = 7 + 4 * seq(6), t.window = NULL, robust = FALSE, lambda = NULL, biasadj = FALSE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using stl objects — forecast.stl","text":"object object class stl stlm. Usually result call stl stlm. method Method use forecasting seasonally adjusted series. etsmodel ets model specification passed ets. default allows non-seasonal model. method!=\"ets\", argument ignored. forecastfunction alternative way specifying function forecasting seasonally adjusted series. forecastfunction NULL, method ignored. Otherwise method used specify forecasting method used. h Number periods forecasting. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. xreg Historical regressors used auto.arima() method==\"arima\". newxreg Future regressors used forecast.Arima(). allow.multiplicative.trend TRUE, ETS models multiplicative trends allowed. Otherwise, additive trend ETS models permitted. ... arguments passed forecast.stl, modelfunction forecastfunction. y univariate numeric time series class ts s.window Either character string ``periodic'' span (lags) loess window seasonal extraction. robust TRUE, robust fitting used loess procedure within stl. modelfunction alternative way specifying function modelling seasonally adjusted series. modelfunction NULL, method ignored. Otherwise method used specify time series model used. model Output previous call stlm. stlm model passed, model fitted y without re-estimating parameters. x Deprecated. Included backwards compatibility. t.window number control smoothness trend. See stl details.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using stl objects — forecast.stl","text":"stlm returns object class stlm. functions return objects class forecast. many methods working forecast objects including summary obtain print summary results, plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using stl objects — forecast.stl","text":"stlm takes time series y, applies STL decomposition, models seasonally adjusted data using model passed modelfunction specified using method. returns object includes original STL decomposition time series model fitted seasonally adjusted data. object can passed forecast.stlm forecasting. forecast.stlm forecasts seasonally adjusted data, re-seasonalizes results adding back last year estimated seasonal component. stlf combines stlm forecast.stlm. takes ts argument, applies STL decomposition, models seasonally adjusted data, reseasonalizes, returns forecasts. However, allows general forecasting methods specified via forecastfunction. forecast.stl similar stlf except takes STL decomposition first argument, instead time series. Note prediction intervals ignore uncertainty associated seasonal component. computed using prediction intervals seasonally adjusted series, reseasonalized using last year seasonal component. uncertainty seasonal component ignored. time series model seasonally adjusted data can specified stlm using either method modelfunction. method argument provides shorthand way specifying modelfunction special cases. generally, modelfunction can function first argument ts object, returns object can passed forecast. example, forecastfunction=ar uses ar function modelling seasonally adjusted series. forecasting method seasonally adjusted data can specified stlf forecast.stl using either method forecastfunction. method argument provides shorthand way specifying forecastfunction special cases. generally, forecastfunction can function first argument ts object, h level, returns object class forecast. example, forecastfunction=thetaf uses thetaf function forecasting seasonally adjusted series.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using stl objects — forecast.stl","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using stl objects — forecast.stl","text":"","code":"tsmod <- stlm(USAccDeaths, modelfunction = ar) plot(forecast(tsmod, h = 36)) decomp <- stl(USAccDeaths, s.window = \"periodic\") plot(forecast(decomp)) plot(stlf(AirPassengers, lambda = 0))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting time series — forecast.ts","title":"Forecasting time series — forecast.ts","text":"forecast generic function forecasting time series time series models. function invokes particular methods depend class first argument.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting time series — forecast.ts","text":"","code":"# S3 method for ts forecast( object, h = ifelse(frequency(object) > 1, 2 * frequency(object), 10), level = c(80, 95), fan = FALSE, robust = FALSE, lambda = NULL, biasadj = FALSE, find.frequency = FALSE, allow.multiplicative.trend = FALSE, model = NULL, ... ) # S3 method for default forecast(object, ...) # S3 method for forecast print(x, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting time series — forecast.ts","text":"object time series time series model forecasts required h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. robust TRUE, function robust missing values outliers object. argument valid object class ts. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. find.frequency TRUE, function determines appropriate period, data unknown period. allow.multiplicative.trend TRUE, ETS models multiplicative trends allowed. Otherwise, additive trend ETS models permitted. model object describing time series model; e.g., one class ets, Arima, bats, tbats, nnetar. ... Additional arguments affecting forecasts produced. model=NULL, forecast.ts passes ets stlf depending frequency time series. model NULL, arguments passed relevant modelling function. x numeric vector time series class ts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting time series — forecast.ts","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessors functions fitted.values residuals extract various useful features value returned forecast$model. object class \"forecast\" list usually containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. models additive errors, residuals x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting time series — forecast.ts","text":"example, function forecast.Arima makes forecasts based results produced arima. model=NULL,function forecast.ts makes forecasts using ets models (data non-seasonal seasonal period 12 less) stlf (seasonal period 13 ). model NULL, forecast.ts apply model object time series, generate forecasts accordingly.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting time series — forecast.ts","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting time series — forecast.ts","text":"","code":"WWWusage %>% forecast %>% plot fit <- ets(window(WWWusage, end=60)) fc <- forecast(WWWusage, model=fit) #> Model is being refit with current smoothing parameters but initial states are being re-estimated. #> Set 'use.initial.values=TRUE' if you want to re-use existing initial values."},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":null,"dir":"Reference","previous_headings":"","what":"Fourier terms for modelling seasonality — fourier","title":"Fourier terms for modelling seasonality — fourier","text":"fourier returns matrix containing terms Fourier series, order K, suitable use Arima, auto.arima, tslm.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fourier terms for modelling seasonality — fourier","text":"","code":"fourier(x, K, h = NULL) fourierf(x, K, h)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fourier terms for modelling seasonality — fourier","text":"x Seasonal time series: ts msts object K Maximum order(s) Fourier terms h Number periods ahead forecast (optional)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fourier terms for modelling seasonality — fourier","text":"Numerical matrix.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fourier terms for modelling seasonality — fourier","text":"fourierf deprecated, instead use h argument fourier. period Fourier terms determined time series characteristics x. h missing, length x also determines number rows matrix returned fourier. Otherwise, value h determines number rows matrix returned fourier, typically used forecasting. values within x used. Typical use omit h generating Fourier terms training model include h generating Fourier terms forecasting. x ts object, value K integer specifies number sine cosine terms return. Thus, matrix returned 2*K columns. x msts object, K vector integers specifying number sine cosine terms seasonal periods. matrix returned 2*sum(K) columns.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fourier terms for modelling seasonality — fourier","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fourier terms for modelling seasonality — fourier","text":"","code":"library(ggplot2) # Using Fourier series for a \"ts\" object # K is chosen to minimize the AICc deaths.model <- auto.arima(USAccDeaths, xreg=fourier(USAccDeaths,K=5), seasonal=FALSE) deaths.fcast <- forecast(deaths.model, xreg=fourier(USAccDeaths, K=5, h=36)) autoplot(deaths.fcast) + xlab(\"Year\") # Using Fourier series for a \"msts\" object taylor.lm <- tslm(taylor ~ fourier(taylor, K = c(3, 3))) taylor.fcast <- forecast(taylor.lm, data.frame(fourier(taylor, K = c(3, 3), h = 270))) autoplot(taylor.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":null,"dir":"Reference","previous_headings":"","what":"Australian monthly gas production — gas","title":"Australian monthly gas production — gas","text":"Australian monthly gas production: 1956--1995.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Australian monthly gas production — gas","text":"","code":"gas"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Australian monthly gas production — gas","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Australian monthly gas production — gas","text":"Australian Bureau Statistics.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Australian monthly gas production — gas","text":"","code":"plot(gas) seasonplot(gas) tsdisplay(gas)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast plot — StatForecast","title":"Forecast plot — StatForecast","text":"Generates forecasts forecast.ts adds plot. Forecasts can modified via sending forecast specific arguments .","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast plot — StatForecast","text":"","code":"StatForecast GeomForecast geom_forecast( mapping = NULL, data = NULL, stat = \"forecast\", position = \"identity\", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, PI = TRUE, showgap = TRUE, series = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Forecast plot — StatForecast","text":"object class StatForecast (inherits Stat, ggproto, gg) length 3. object class GeomForecast (inherits Geom, ggproto, gg) length 7.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast plot — StatForecast","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot. data.frame, object, override plot data. objects fortified produce data frame. See fortify variables created. function called single argument, plot data. return value must data.frame, used layer data. stat stat object use calculate data. position Position adjustment, either string, result call position adjustment function. na.rm FALSE (default), removes missing values warning. TRUE silently removes missing values. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders. PI FALSE, confidence intervals plotted, giving forecast line. showgap showgap=FALSE, gap historical observations forecasts removed. series Matches unidentified forecast layer coloured object plot. ... Additional arguments forecast.ts, arguments passed layer. often aesthetics, used set aesthetic fixed value, like color = \"red\" alpha = .5. may also parameters paired geom/stat.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast plot — StatForecast","text":"layer ggplot graph.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast plot — StatForecast","text":"Multivariate forecasting supported time series different group. can also pass geom_forecast forecast object add plot. aesthetics required forecasting work includes forecast observations y axis, time observations x axis. Refer examples . automatically set aesthetics, use autoplot.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast plot — StatForecast","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast plot — StatForecast","text":"","code":"if (FALSE) { library(ggplot2) autoplot(USAccDeaths) + geom_forecast() lungDeaths <- cbind(mdeaths, fdeaths) autoplot(lungDeaths) + geom_forecast() # Using fortify.ts p <- ggplot(aes(x=x, y=y), data=USAccDeaths) p <- p + geom_line() p + geom_forecast() # Without fortify.ts data <- data.frame(USAccDeaths=as.numeric(USAccDeaths), time=as.numeric(time(USAccDeaths))) p <- ggplot(aes(x=time, y=USAccDeaths), data=data) p <- p + geom_line() p + geom_forecast() p + geom_forecast(h=60) p <- ggplot(aes(x=time, y=USAccDeaths), data=data) p + geom_forecast(level=c(70,98)) p + geom_forecast(level=c(70,98),colour=\"lightblue\") #Add forecasts to multivariate series with colour groups lungDeaths <- cbind(mdeaths, fdeaths) autoplot(lungDeaths) + geom_forecast(forecast(mdeaths), series=\"mdeaths\") }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":null,"dir":"Reference","previous_headings":"","what":"Get response variable from time series model. — getResponse","title":"Get response variable from time series model. — getResponse","text":"getResponse generic function extracting historical data time series model (including Arima, ets, ar, fracdiff), linear model class lm, forecast object. function invokes particular methods depend class first argument.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get response variable from time series model. — getResponse","text":"","code":"getResponse(object, ...) # S3 method for default getResponse(object, ...) # S3 method for lm getResponse(object, ...) # S3 method for Arima getResponse(object, ...) # S3 method for fracdiff getResponse(object, ...) # S3 method for ar getResponse(object, ...) # S3 method for tbats getResponse(object, ...) # S3 method for bats getResponse(object, ...) # S3 method for mforecast getResponse(object, ...) # S3 method for baggedModel getResponse(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get response variable from time series model. — getResponse","text":"object time series model forecast object. ... Additional arguments ignored.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get response variable from time series model. — getResponse","text":"numerical vector time series object class ts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get response variable from time series model. — getResponse","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Histogram with optional normal and kernel density functions — gghistogram","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"Plots histogram density estimates using ggplot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"","code":"gghistogram( x, add.normal = FALSE, add.kde = FALSE, add.rug = TRUE, bins, boundary = 0 )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"x numerical vector. add.normal Add normal density function comparison add.kde Add kernel density estimate comparison add.rug Add rug plot horizontal axis bins number bins use histogram. Selected default using Friedman-Diaconis rule given nclass.FD boundary boundary two bins.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"None.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"","code":"gghistogram(lynx, add.kde=TRUE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Time series lag ggplots — gglagplot","title":"Time series lag ggplots — gglagplot","text":"Plots lag plot using ggplot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time series lag ggplots — gglagplot","text":"","code":"gglagplot( x, lags = ifelse(frequency(x) > 9, 16, 9), set.lags = 1:lags, diag = TRUE, diag.col = \"gray\", do.lines = TRUE, colour = TRUE, continuous = frequency(x) > 12, labels = FALSE, seasonal = TRUE, ... ) gglagchull( x, lags = ifelse(frequency(x) > 1, min(12, frequency(x)), 4), set.lags = 1:lags, diag = TRUE, diag.col = \"gray\", ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time series lag ggplots — gglagplot","text":"x time series object (type ts). lags number lag plots desired, see arg set.lags. set.lags vector positive integers specifying lags use. diag logical indicating x=y diagonal drawn. diag.col color used diagonal (diag). .lines TRUE, lines drawn, otherwise points drawn. colour logical indicating lines coloured. continuous colour scheme years continuous discrete? labels logical indicating labels used. seasonal line colour based seasonal characteristics (TRUE), sequential (FALSE). ... used (consistency lag.plot)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time series lag ggplots — gglagplot","text":"None.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time series lag ggplots — gglagplot","text":"“gglagplot” plot time series lagged versions . Helps visualising 'auto-dependence' even auto-correlations vanish. “gglagchull” layer convex hulls lags, layered single plot. helps visualise change 'auto-dependence' lags increase.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time series lag ggplots — gglagplot","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time series lag ggplots — gglagplot","text":"","code":"gglagplot(woolyrnq) gglagplot(woolyrnq,seasonal=FALSE) lungDeaths <- cbind(mdeaths, fdeaths) gglagplot(lungDeaths, lags=2) gglagchull(lungDeaths, lags=6) gglagchull(woolyrnq)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a seasonal subseries ggplot — ggmonthplot","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"Plots subseries plot using ggplot. season plotted separate mini time series. blue lines represent mean observations within season.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"","code":"ggmonthplot(x, labels = NULL, times = time(x), phase = cycle(x), ...) ggsubseriesplot(x, labels = NULL, times = time(x), phase = cycle(x), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"x time series object (type ts). labels vector labels use 'season' times vector times observation phase vector seasonal components ... used (consistency monthplot)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"Returns object class ggplot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"ggmonthplot function simply wrapper ggsubseriesplot convenience users familiar monthplot.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"","code":"ggsubseriesplot(AirPassengers) ggsubseriesplot(woolyrnq)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gold.html","id":null,"dir":"Reference","previous_headings":"","what":"Daily morning gold prices — gold","title":"Daily morning gold prices — gold","text":"Daily morning gold prices US dollars. 1 January 1985 -- 31 March 1989.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gold.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Daily morning gold prices — gold","text":"","code":"gold"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gold.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Daily morning gold prices — gold","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gold.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Daily morning gold prices — gold","text":"","code":"tsdisplay(gold)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.constant.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object constant? — is.constant","title":"Is an object constant? — is.constant","text":"Returns true object's numerical values vary.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.constant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object constant? — is.constant","text":"","code":"is.constant(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.constant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object constant? — is.constant","text":"x object tested","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a particular model type? — is.acf","title":"Is an object a particular model type? — is.acf","text":"Returns true model object particular type","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a particular model type? — is.acf","text":"","code":"is.acf(x) is.Arima(x) is.baggedModel(x) is.bats(x) is.ets(x) is.modelAR(x) is.stlm(x) is.nnetar(x) is.nnetarmodels(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a particular model type? — is.acf","text":"x object tested","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a particular forecast type? — is.forecast","title":"Is an object a particular forecast type? — is.forecast","text":"Returns true forecast object particular type","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a particular forecast type? — is.forecast","text":"","code":"is.forecast(x) is.mforecast(x) is.splineforecast(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a particular forecast type? — is.forecast","text":"x object tested","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":null,"dir":"Reference","previous_headings":"","what":"Moving-average smoothing — ma","title":"Moving-average smoothing — ma","text":"ma computes simple moving average smoother given time series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Moving-average smoothing — ma","text":"","code":"ma(x, order, centre = TRUE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Moving-average smoothing — ma","text":"x Univariate time series order Order moving average smoother centre TRUE, moving average centred even orders.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Moving-average smoothing — ma","text":"Numerical time series object containing simple moving average smoothed values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Moving-average smoothing — ma","text":"moving average smoother averages nearest order periods observation. neighbouring observations time series likely similar value, averaging eliminates randomness data, leaving smooth trend-cycle component. $$\\hat{T}_{t} = \\frac{1}{m} \\sum_{j=-k}^k y_{t+j}$$ \\(k=\\frac{m-1}{2}\\) even order specified, observations averaged include one observation future past (k rounded ). centre TRUE, value two moving averages (k rounded respectively) averaged, centering moving average.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Moving-average smoothing — ma","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Moving-average smoothing — ma","text":"","code":"plot(wineind) sm <- ma(wineind,order=12) lines(sm,col=\"red\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":null,"dir":"Reference","previous_headings":"","what":"Mean Forecast — meanf","title":"Mean Forecast — meanf","text":"Returns forecasts prediction intervals iid model applied y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mean Forecast — meanf","text":"","code":"meanf( y, h = 10, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, bootstrap = FALSE, npaths = 5000, x = y )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mean Forecast — meanf","text":"y numeric vector time series class ts h Number periods forecasting level Confidence levels prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. bootstrap TRUE, use bootstrap method compute prediction intervals. Otherwise, assume normal distribution. npaths Number bootstrapped sample paths use bootstrap==TRUE. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mean Forecast — meanf","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned meanf. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Mean Forecast — meanf","text":"iid model $$Y_t=\\mu + Z_t$$ \\(Z_t\\) normal iid error. Forecasts given $$Y_n(h)=\\mu$$ \\(\\mu\\) estimated sample mean.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Mean Forecast — meanf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mean Forecast — meanf","text":"","code":"nile.fcast <- meanf(Nile, h=10) plot(nile.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":null,"dir":"Reference","previous_headings":"","what":"Time Series Forecasts with a user-defined model — modelAR","title":"Time Series Forecasts with a user-defined model — modelAR","text":"Experimental function forecast univariate time series user-defined model","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time Series Forecasts with a user-defined model — modelAR","text":"","code":"modelAR( y, p, P = 1, FUN, predict.FUN, xreg = NULL, lambda = NULL, model = NULL, subset = NULL, scale.inputs = FALSE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time Series Forecasts with a user-defined model — modelAR","text":"y numeric vector time series class ts. p Embedding dimension non-seasonal time series. Number non-seasonal lags used inputs. non-seasonal time series, default optimal number lags (according AIC) linear AR(p) model. seasonal time series, method used applied seasonally adjusted data (stl decomposition). P Number seasonal lags used inputs. FUN Function used model fitting. Must accept argument x y predictors response, respectively (formula object currently supported). predict.FUN Prediction function used apply FUN new data. Must accept object class FUN first argument, data frame matrix new data second argument. Additionally, return fitted values new data omitted. xreg Optionally, vector matrix external regressors, must number rows y. Must numeric. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. model Output previous call nnetar. model passed, model fitted y without re-estimating parameters. subset Optional vector specifying subset observations used fit. Can integer index vector logical vector length y. observations used default. scale.inputs TRUE, inputs scaled subtracting column means dividing respective standard deviations. lambda NULL, scaling applied Box-Cox transformation. x Deprecated. Included backwards compatibility. ... arguments passed FUN modelAR.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time Series Forecasts with a user-defined model — modelAR","text":"Returns object class \"modelAR\". function summary used obtain print summary results. generic accessor functions fitted.values residuals extract useful features value returned nnetar. model list containing information fitted model method name forecasting method character string x original time series. xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) ... arguments","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time Series Forecasts with a user-defined model — modelAR","text":"experimental function recommended advanced users. selected model fitted lagged values y inputs. inputs lags 1 p, lags m mP m=frequency(y). xreg provided, columns also used inputs. missing values y xreg, corresponding rows (others depend lags) omitted fit. model trained one-step forecasting. Multi-step forecasts computed recursively.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time Series Forecasts with a user-defined model — modelAR","text":"Rob J Hyndman Gabriel Caceres","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modeldf.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute model degrees of freedom — modeldf","title":"Compute model degrees of freedom — modeldf","text":"Compute model degrees freedom","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modeldf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute model degrees of freedom — modeldf","text":"","code":"modeldf(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/modeldf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute model degrees of freedom — modeldf","text":"object time series model ... arguments currently ignored","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":null,"dir":"Reference","previous_headings":"","what":"Number of days in each season — monthdays","title":"Number of days in each season — monthdays","text":"Returns number days month quarter observed time period.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number of days in each season — monthdays","text":"","code":"monthdays(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number of days in each season — monthdays","text":"x time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number of days in each season — monthdays","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Number of days in each season — monthdays","text":"Useful month length adjustments","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Number of days in each season — monthdays","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number of days in each season — monthdays","text":"","code":"par(mfrow=c(2,1)) plot(ldeaths,xlab=\"Year\",ylab=\"pounds\", main=\"Monthly deaths from lung disease (UK)\") ldeaths.adj <- ldeaths/monthdays(ldeaths)*365.25/12 plot(ldeaths.adj,xlab=\"Year\",ylab=\"pounds\", main=\"Adjusted monthly deaths from lung disease (UK)\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/mstl.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiple seasonal decomposition — mstl","title":"Multiple seasonal decomposition — mstl","text":"Decompose time series seasonal, trend remainder components. Seasonal components estimated iteratively using STL. Multiple seasonal periods allowed. trend component computed last iteration STL. Non-seasonal time series decomposed trend remainder . case, supsmu used estimate trend. Optionally, time series may Box-Cox transformed decomposition. Unlike stl, mstl completely automated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/mstl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiple seasonal decomposition — mstl","text":"","code":"mstl(x, lambda = NULL, iterate = 2, s.window = 7 + 4 * seq(6), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/mstl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiple seasonal decomposition — mstl","text":"x Univariate time series class msts ts. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. iterate Number iterations use refine seasonal component. s.window Seasonal windows used decompositions. scalar, value used seasonal components. Otherwise, vector length number seasonal components (longer). ... arguments passed stl.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/mstl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multiple seasonal decomposition — mstl","text":"","code":"library(ggplot2) mstl(taylor) %>% autoplot() mstl(AirPassengers, lambda = \"auto\") %>% autoplot()"},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":null,"dir":"Reference","previous_headings":"","what":"Multi-Seasonal Time Series — msts","title":"Multi-Seasonal Time Series — msts","text":"msts S3 class multi seasonal time series objects, intended used models support multiple seasonal periods. msts class inherits ts class additional \"msts\" attribute contains vector seasonal periods. methods work ts class, also work msts class.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multi-Seasonal Time Series — msts","text":"","code":"msts(data, seasonal.periods, ts.frequency = floor(max(seasonal.periods)), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multi-Seasonal Time Series — msts","text":"data numeric vector, ts object, matrix data frame. intended time series data univariate, otherwise treated ts(). seasonal.periods vector seasonal periods msts. ts.frequency seasonal period used frequency underlying ts object. default value max(seasonal.periods). ... Arguments passed underlying call ts(). example start=c(1987,5).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multi-Seasonal Time Series — msts","text":"object class c(\"msts\", \"ts\"). one seasonal period (.e., length(seasonal.periods)==1), object class \"ts\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multi-Seasonal Time Series — msts","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multi-Seasonal Time Series — msts","text":"","code":"x <- msts(taylor, seasonal.periods=c(2*24,2*24*7,2*24*365), start=2000+22/52) y <- msts(USAccDeaths, seasonal.periods=12, start=1949)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":null,"dir":"Reference","previous_headings":"","what":"Interpolate missing values in a time series — na.interp","title":"Interpolate missing values in a time series — na.interp","text":"default, uses linear interpolation non-seasonal series. seasonal series, robust STL decomposition first computed. linear interpolation applied seasonally adjusted data, seasonal component added back.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Interpolate missing values in a time series — na.interp","text":"","code":"na.interp( x, lambda = NULL, linear = (frequency(x) <= 1 | sum(!is.na(x)) <= 2 * frequency(x)) )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Interpolate missing values in a time series — na.interp","text":"x time series lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. linear linear interpolation used.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Interpolate missing values in a time series — na.interp","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Interpolate missing values in a time series — na.interp","text":"general flexible approach available using na.approx zoo package.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Interpolate missing values in a time series — na.interp","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Interpolate missing values in a time series — na.interp","text":"","code":"data(gold) plot(na.interp(gold))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":null,"dir":"Reference","previous_headings":"","what":"Naive and Random Walk Forecasts — rwf","title":"Naive and Random Walk Forecasts — rwf","text":"rwf() returns forecasts prediction intervals random walk drift model applied y. equivalent ARIMA(0,1,0) model optional drift coefficient. naive() simply wrapper rwf() simplicity. snaive() returns forecasts prediction intervals ARIMA(0,0,0)(0,1,0)m model m seasonal period.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Naive and Random Walk Forecasts — rwf","text":"","code":"rwf( y, h = 10, drift = FALSE, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, ..., x = y ) naive( y, h = 10, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, ..., x = y ) snaive( y, h = 2 * frequency(x), level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, ..., x = y )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Naive and Random Walk Forecasts — rwf","text":"y numeric vector time series class ts h Number periods forecasting drift Logical flag. TRUE, fits random walk drift model. level Confidence levels prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... Additional arguments affecting forecasts produced. model=NULL, forecast.ts passes ets stlf depending frequency time series. model NULL, arguments passed relevant modelling function. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Naive and Random Walk Forecasts — rwf","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned naive snaive. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Naive and Random Walk Forecasts — rwf","text":"random walk drift model $$Y_t=c + Y_{t-1} + Z_t$$ \\(Z_t\\) normal iid error. Forecasts given $$Y_n(h)=ch+Y_n$$. drift (naive), drift parameter c=0. Forecast standard errors allow uncertainty estimating drift parameter (unlike corresponding forecasts obtained fitting ARIMA model directly). seasonal naive model $$Y_t= Y_{t-m} + Z_t$$ \\(Z_t\\) normal iid error.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Naive and Random Walk Forecasts — rwf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Naive and Random Walk Forecasts — rwf","text":"","code":"gold.fcast <- rwf(gold[1:60], h=50) plot(gold.fcast) plot(naive(gold,h=50),include=200) plot(snaive(wineind))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":null,"dir":"Reference","previous_headings":"","what":"Number of differences required for a stationary series — ndiffs","title":"Number of differences required for a stationary series — ndiffs","text":"Functions estimate number differences required make given time series stationary. ndiffs estimates number first differences necessary.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number of differences required for a stationary series — ndiffs","text":"","code":"ndiffs( x, alpha = 0.05, test = c(\"kpss\", \"adf\", \"pp\"), type = c(\"level\", \"trend\"), max.d = 2, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number of differences required for a stationary series — ndiffs","text":"x univariate time series alpha Level test, possible values range 0.01 0.1. test Type unit root test use type Specification deterministic component regression max.d Maximum number non-seasonal differences allowed ... Additional arguments passed unit root test","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number of differences required for a stationary series — ndiffs","text":"integer indicating number differences required stationarity.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Number of differences required for a stationary series — ndiffs","text":"ndiffs uses unit root test determine number differences required time series x made stationary. test=\"kpss\", KPSS test used null hypothesis x stationary root unit-root alternative. test returns least number differences required pass test level alpha. test=\"adf\", Augmented Dickey-Fuller test used test=\"pp\" Phillips-Perron test used. cases, null hypothesis x unit root stationary root alternative. test returns least number differences required fail test level alpha.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Number of differences required for a stationary series — ndiffs","text":"Dickey DA Fuller WA (1979), \"Distribution Estimators Autoregressive Time Series Unit Root\", Journal American Statistical Association 74:427-431. Kwiatkowski D, Phillips PCB, Schmidt P Shin Y (1992) \"Testing Null Hypothesis Stationarity Alternative Unit Root\", Journal Econometrics 54:159-178. Osborn, D.R. (1990) \"survey seasonality UK macroeconomic variables\", International Journal Forecasting, 6:327-336. Phillips, P.C.B. Perron, P. (1988) \"Testing unit root time series regression\", Biometrika, 72(2), 335-346. Said E Dickey DA (1984), \"Testing Unit Roots Autoregressive Moving Average Models Unknown Order\", Biometrika 71:599-607.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Number of differences required for a stationary series — ndiffs","text":"Rob J Hyndman, Slava Razbash & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number of differences required for a stationary series — ndiffs","text":"","code":"ndiffs(WWWusage) #> [1] 1 ndiffs(diff(log(AirPassengers), 12)) #> [1] 1"},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":null,"dir":"Reference","previous_headings":"","what":"Neural Network Time Series Forecasts — nnetar","title":"Neural Network Time Series Forecasts — nnetar","text":"Feed-forward neural networks single hidden layer lagged inputs forecasting univariate time series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Neural Network Time Series Forecasts — nnetar","text":"","code":"nnetar( y, p, P = 1, size, repeats = 20, xreg = NULL, lambda = NULL, model = NULL, subset = NULL, scale.inputs = TRUE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Neural Network Time Series Forecasts — nnetar","text":"y numeric vector time series class ts. p Embedding dimension non-seasonal time series. Number non-seasonal lags used inputs. non-seasonal time series, default optimal number lags (according AIC) linear AR(p) model. seasonal time series, method used applied seasonally adjusted data (stl decomposition). set zero indicate non-seasonal lags included, P must least 1 model seasonal lags fit. P Number seasonal lags used inputs. size Number nodes hidden layer. Default half number input nodes (including external regressors, given) plus 1. repeats Number networks fit different random starting weights. averaged producing forecasts. xreg Optionally, vector matrix external regressors, must number rows y. Must numeric. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. model Output previous call nnetar. model passed, model fitted y without re-estimating parameters. subset Optional vector specifying subset observations used fit. Can integer index vector logical vector length y. observations used default. scale.inputs TRUE, inputs scaled subtracting column means dividing respective standard deviations. lambda NULL, scaling applied Box-Cox transformation. x Deprecated. Included backwards compatibility. ... arguments passed nnet nnetar.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Neural Network Time Series Forecasts — nnetar","text":"Returns object class \"nnetar\". function summary used obtain print summary results. generic accessor functions fitted.values residuals extract useful features value returned nnetar. model list containing information fitted model method name forecasting method character string x original time series. xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) ... arguments","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Neural Network Time Series Forecasts — nnetar","text":"feed-forward neural network fitted lagged values y inputs single hidden layer size nodes. inputs lags 1 p, lags m mP m=frequency(y). xreg provided, columns also used inputs. missing values y xreg, corresponding rows (others depend lags) omitted fit. total repeats networks fitted, random starting weights. averaged computing forecasts. network trained one-step forecasting. Multi-step forecasts computed recursively. non-seasonal data, fitted model denoted NNAR(p,k) model, k number hidden nodes. analogous AR(p) model nonlinear functions. seasonal data, fitted model called NNAR(p,P,k)[m] model, analogous ARIMA(p,0,0)(P,0,0)[m] model nonlinear functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Neural Network Time Series Forecasts — nnetar","text":"Rob J Hyndman Gabriel Caceres","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Neural Network Time Series Forecasts — nnetar","text":"","code":"fit <- nnetar(lynx) fcast <- forecast(fit) plot(fcast) ## Arguments can be passed to nnet() fit <- nnetar(lynx, decay=0.5, maxit=150) plot(forecast(fit)) lines(lynx) ## Fit model to first 100 years of lynx data fit <- nnetar(window(lynx,end=1920), decay=0.5, maxit=150) plot(forecast(fit,h=14)) lines(lynx) ## Apply fitted model to later data, including all optional arguments fit2 <- nnetar(window(lynx,start=1921), model=fit)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":null,"dir":"Reference","previous_headings":"","what":"Number of differences required for a seasonally stationary series — nsdiffs","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"Functions estimate number differences required make given time series stationary. nsdiffs estimates number seasonal differences necessary.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"","code":"nsdiffs( x, alpha = 0.05, m = frequency(x), test = c(\"seas\", \"ocsb\", \"hegy\", \"ch\"), max.D = 1, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"x univariate time series alpha Level test, possible values range 0.01 0.1. m Deprecated. Length seasonal period test Type unit root test use max.D Maximum number seasonal differences allowed ... Additional arguments passed unit root test","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"integer indicating number differences required stationarity.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"nsdiffs uses seasonal unit root tests determine number seasonal differences required time series x made stationary (possibly lag-one differencing well). Several different tests available: test=\"seas\" (default), measure seasonal strength used, differencing selected seasonal strength (Wang, Smith & Hyndman, 2006) exceeds 0.64 (based minimizing MASE forecasting using auto.arima M3 M4 data). test=\"ch\", Canova-Hansen (1995) test used (null hypothesis deterministic seasonality) test=\"hegy\", Hylleberg, Engle, Granger & Yoo (1990) test used. test=\"ocsb\", Osborn-Chui-Smith-Birchenhall (1988) test used (null hypothesis seasonal unit root exists).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"Wang, X, Smith, KA, Hyndman, RJ (2006) \"Characteristic-based clustering time series data\", Data Mining Knowledge Discovery, 13(3), 335-364. Osborn DR, Chui APL, Smith J, Birchenhall CR (1988) \"Seasonality order integration consumption\", Oxford Bulletin Economics Statistics 50(4):361-377. Canova F Hansen (1995) \"Seasonal Patterns Constant Time? Test Seasonal Stability\", Journal Business Economic Statistics 13(3):237-252. Hylleberg S, Engle R, Granger C Yoo B (1990) \"Seasonal integration cointegration.\", Journal Econometrics 44(1), pp. 215-238.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"Rob J Hyndman, Slava Razbash Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"","code":"nsdiffs(AirPassengers) #> [1] 1"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"implementation Osborn, Chui, Smith, Birchenhall (OCSB) test.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"","code":"ocsb.test(x, lag.method = c(\"fixed\", \"AIC\", \"BIC\", \"AICc\"), maxlag = 0)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"x univariate seasonal time series. lag.method character specifying lag order selection method. maxlag maximum lag order considered lag.method.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"ocsb.test returns list class \"OCSBtest\" following components: * statistics value test statistics. * pvalues p-values test statistics. * method character string describing type test. * data.name character string giving name data. * fitted.model\tfitted regression model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"regression equation may include lags dependent variable. lag.method = \"fixed\", lag order fixed maxlag; otherwise, maxlag maximum number lags considered lag selection procedure minimises lag.method criterion, can AIC BIC corrected AIC, AICc, obtained AIC + (2k(k+1))/(n-k-1), k number parameters n number available observations model. Critical values test based simulations, smoothed produce critical values seasonal periods.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"Osborn DR, Chui APL, Smith J, Birchenhall CR (1988) \"Seasonality order integration consumption\", Oxford Bulletin Economics Statistics 50(4):361-377.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"","code":"ocsb.test(AirPassengers) #> #> \tOCSB test #> #> data: AirPassengers #> #> Test statistic: 1.5188, 5% critical value: -1.803 #> alternative hypothesis: stationary #> #> Lag order 0 was selected using fixed"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot characteristic roots from ARIMA model — plot.Arima","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"Produces plot inverse AR MA roots ARIMA model. Inverse roots outside unit circle shown red.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"","code":"# S3 method for Arima plot( x, type = c(\"both\", \"ar\", \"ma\"), main, xlab = \"Real\", ylab = \"Imaginary\", ... ) # S3 method for ar plot(x, main, xlab = \"Real\", ylab = \"Imaginary\", ...) # S3 method for Arima autoplot(object, type = c(\"both\", \"ar\", \"ma\"), ...) # S3 method for ar autoplot(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"x Object class “Arima” “ar”. type Determines AR MA roots plotted, just one set plotted. main Main title. Default \"Inverse AR roots\" \"Inverse MA roots\". xlab X-axis label. ylab Y-axis label. ... plotting parameters passed par. object Object class “Arima” “ar”. Used ggplot graphics (S3 method consistency).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"None. Function produces plot","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"autoplot produce equivalent plot ggplot object.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"","code":"library(ggplot2) fit <- Arima(WWWusage, order = c(3, 1, 0)) plot(fit) autoplot(fit) fit <- Arima(woolyrnq, order = c(2, 0, 0), seasonal = c(2, 1, 1)) plot(fit) autoplot(fit) plot(ar.ols(gold[1:61])) autoplot(ar.ols(gold[1:61]))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot components from BATS model — plot.bats","title":"Plot components from BATS model — plot.bats","text":"Produces plot level, slope seasonal components BATS TBATS model. plotted components Box-Cox transformed using estimated transformation parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot components from BATS model — plot.bats","text":"","code":"# S3 method for bats plot(x, main = \"Decomposition by BATS model\", ...) # S3 method for tbats autoplot(object, range.bars = FALSE, ...) # S3 method for bats autoplot(object, range.bars = FALSE, ...) # S3 method for tbats plot(x, main = \"Decomposition by TBATS model\", ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot components from BATS model — plot.bats","text":"x Object class “bats/tbats”. main Main title plot. ... plotting parameters passed par. object Object class “bats/tbats”. range.bars Logical indicating plot bar right side representing relative size. NULL, automatic selection takes place.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot components from BATS model — plot.bats","text":"None. Function produces plot","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot components from BATS model — plot.bats","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot components from BATS model — plot.bats","text":"","code":"if (FALSE) { fit <- tbats(USAccDeaths) plot(fit) autoplot(fit, range.bars = TRUE)}"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot components from ETS model — plot.ets","title":"Plot components from ETS model — plot.ets","text":"Produces plot level, slope seasonal components ETS model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot components from ETS model — plot.ets","text":"","code":"# S3 method for ets plot(x, ...) # S3 method for ets autoplot(object, range.bars = NULL, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot components from ETS model — plot.ets","text":"x Object class “ets”. ... plotting parameters affect plot. object Object class “ets”. Used ggplot graphics (S3 method consistency). range.bars Logical indicating plot bar right side representing relative size. NULL, automatic selection takes place.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot components from ETS model — plot.ets","text":"None. Function produces plot","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot components from ETS model — plot.ets","text":"autoplot produce equivalent plot ggplot object.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot components from ETS model — plot.ets","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot components from ETS model — plot.ets","text":"","code":"fit <- ets(USAccDeaths) plot(fit) plot(fit,plot.type=\"single\",ylab=\"\",col=1:3) library(ggplot2) autoplot(fit)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast plot — plot.forecast","title":"Forecast plot — plot.forecast","text":"Plots historical data forecasts prediction intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast plot — plot.forecast","text":"","code":"# S3 method for forecast plot( x, include, PI = TRUE, showgap = TRUE, shaded = TRUE, shadebars = (length(x$mean) < 5), shadecols = NULL, col = 1, fcol = 4, pi.col = 1, pi.lty = 2, ylim = NULL, main = NULL, xlab = \"\", ylab = \"\", type = \"l\", flty = 1, flwd = 2, ... ) # S3 method for forecast autoplot( object, include, PI = TRUE, shadecols = c(\"#596DD5\", \"#D5DBFF\"), fcol = \"#0000AA\", flwd = 0.5, ... ) # S3 method for splineforecast autoplot(object, PI = TRUE, ...) # S3 method for forecast autolayer(object, series = NULL, PI = TRUE, showgap = TRUE, ...) # S3 method for splineforecast plot(x, fitcol = 2, type = \"o\", pch = 19, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast plot — plot.forecast","text":"x Forecast object produced forecast. include number values time series include plot. Default values. PI Logical flag indicating whether plot prediction intervals. showgap showgap=FALSE, gap historical observations forecasts removed. shaded Logical flag indicating whether prediction intervals shaded (TRUE) lines (FALSE) shadebars Logical flag indicating prediction intervals plotted shaded bars (TRUE) shaded polygon (FALSE). Ignored shaded=FALSE. Bars plotted default fewer five forecast horizons. shadecols Colors shaded prediction intervals. get default colors used prior v3.26, set shadecols=\"oldstyle\". col Colour data line. fcol Colour forecast line. pi.col shaded=FALSE PI=TRUE, prediction intervals plotted colour. pi.lty shaded=FALSE PI=TRUE, prediction intervals plotted using line type. ylim Limits y-axis. main Main title. xlab X-axis label. ylab Y-axis label. type 1-character string giving type plot desired. plot.default. flty Line type forecast line. flwd Line width forecast line. ... plotting parameters affect plot. object Forecast object produced forecast. Used ggplot graphics (S3 method consistency). series Matches unidentified forecast layer coloured object plot. fitcol Line colour fitted values. pch Plotting character (type==\"p\" type==\"o\").","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast plot — plot.forecast","text":"None.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast plot — plot.forecast","text":"autoplot produce ggplot object. plot.splineforecast autoplot.splineforecast","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecast plot — plot.forecast","text":"Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast plot — plot.forecast","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast plot — plot.forecast","text":"","code":"library(ggplot2) wine.fit <- hw(wineind,h=48) plot(wine.fit) autoplot(wine.fit) fit <- tslm(wineind ~ fourier(wineind,4)) fcast <- forecast(fit, newdata=data.frame(fourier(wineind,4,20))) autoplot(fcast) fcast <- splinef(airmiles,h=5) plot(fcast) autoplot(fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Multivariate forecast plot — autoplot.mforecast","title":"Multivariate forecast plot — autoplot.mforecast","text":"Plots historical data multivariate forecasts prediction intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multivariate forecast plot — autoplot.mforecast","text":"","code":"# S3 method for mforecast autoplot(object, PI = TRUE, facets = TRUE, colour = FALSE, ...) # S3 method for mforecast autolayer(object, series = NULL, PI = TRUE, ...) # S3 method for mforecast plot(x, main = paste(\"Forecasts from\", unique(x$method)), xlab = \"time\", ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multivariate forecast plot — autoplot.mforecast","text":"object Multivariate forecast object class mforecast. Used ggplot graphics (S3 method consistency). PI FALSE, confidence intervals plotted, giving forecast line. facets TRUE, multiple time series faceted. FALSE, series assigned colour. colour TRUE, time series assigned colour aesthetic ... additional arguments individual plot. series Matches unidentified forecast layer coloured object plot. x Multivariate forecast object class mforecast. main Main title. Default forecast method. autoplot, specify vector titles plot. xlab X-axis label. autoplot, specify vector labels plot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multivariate forecast plot — autoplot.mforecast","text":"autoplot produce equivalent plot ggplot object.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Multivariate forecast plot — autoplot.mforecast","text":"Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multivariate forecast plot — autoplot.mforecast","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multivariate forecast plot — autoplot.mforecast","text":"","code":"library(ggplot2) lungDeaths <- cbind(mdeaths, fdeaths) fit <- tslm(lungDeaths ~ trend + season) fcast <- forecast(fit, h=10) plot(fcast) autoplot(fcast) carPower <- as.matrix(mtcars[,c(\"qsec\",\"hp\")]) carmpg <- mtcars[,\"mpg\"] fit <- lm(carPower ~ carmpg) fcast <- forecast(fit, newdata=data.frame(carmpg=30)) plot(fcast, xlab=\"Year\") autoplot(fcast, xlab=rep(\"Year\",2))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. generics accuracy, forecast ggplot2 autoplot magrittr %>%","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Residuals for various time series models — residuals.forecast","title":"Residuals for various time series models — residuals.forecast","text":"Returns time series residuals fitted model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Residuals for various time series models — residuals.forecast","text":"","code":"# S3 method for forecast residuals(object, type = c(\"innovation\", \"response\"), ...) # S3 method for ar residuals(object, type = c(\"innovation\", \"response\"), ...) # S3 method for Arima residuals(object, type = c(\"innovation\", \"response\", \"regression\"), h = 1, ...) # S3 method for bats residuals(object, type = c(\"innovation\", \"response\"), h = 1, ...) # S3 method for tbats residuals(object, type = c(\"innovation\", \"response\"), h = 1, ...) # S3 method for ets residuals(object, type = c(\"innovation\", \"response\"), h = 1, ...) # S3 method for ARFIMA residuals(object, type = c(\"innovation\", \"response\"), ...) # S3 method for nnetar residuals(object, type = c(\"innovation\", \"response\"), h = 1, ...) # S3 method for stlm residuals(object, type = c(\"innovation\", \"response\"), ...) # S3 method for tslm residuals(object, type = c(\"innovation\", \"response\", \"deviance\"), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Residuals for various time series models — residuals.forecast","text":"object object containing time series model class ar, Arima, bats, ets, arfima, nnetar stlm. object class forecast, function return object$residuals exists, otherwise returns differences observations fitted values. type Type residual. ... arguments used. h type='response', fitted values computed h-step forecasts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Residuals for various time series models — residuals.forecast","text":"ts object.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Residuals for various time series models — residuals.forecast","text":"Innovation residuals correspond white noise process drives evolution time series model. Response residuals difference observations fitted values (equivalent h-step forecasts). functions h argument, h=1. homoscedastic models, innovation residuals response residuals h=1 identical. Regression residuals available regression models ARIMA errors, equal original data minus effect regression variables. regression variables, errors identical original series (possibly adjusted zero mean). arima.errors deprecated function identical residuals.Arima(object, type=\"regression\"). nnetar objects, type=\"innovations\" lambda used, matrix time-series consisting residuals fitted neural networks returned.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Residuals for various time series models — residuals.forecast","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Residuals for various time series models — residuals.forecast","text":"","code":"fit <- Arima(lynx,order=c(4,0,0), lambda=0.5) plot(residuals(fit)) plot(residuals(fit, type='response'))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":null,"dir":"Reference","previous_headings":"","what":"Seasonal adjustment — seasadj","title":"Seasonal adjustment — seasadj","text":"Returns seasonally adjusted data constructed removing seasonal component.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Seasonal adjustment — seasadj","text":"","code":"seasadj(object, ...) # S3 method for stl seasadj(object, ...) # S3 method for mstl seasadj(object, ...) # S3 method for decomposed.ts seasadj(object, ...) # S3 method for tbats seasadj(object, ...) # S3 method for seas seasadj(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Seasonal adjustment — seasadj","text":"object Object created decompose, stl tbats. ... arguments currently used.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Seasonal adjustment — seasadj","text":"Univariate time series.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Seasonal adjustment — seasadj","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Seasonal adjustment — seasadj","text":"","code":"plot(AirPassengers) lines(seasadj(decompose(AirPassengers,\"multiplicative\")),col=4)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract components from a time series decomposition — seasonal","title":"Extract components from a time series decomposition — seasonal","text":"Returns univariate time series equal either seasonal component, trend-cycle component remainder component time series decomposition.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract components from a time series decomposition — seasonal","text":"","code":"seasonal(object) trendcycle(object) remainder(object)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract components from a time series decomposition — seasonal","text":"object Object created decompose, stl tbats.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract components from a time series decomposition — seasonal","text":"Univariate time series.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract components from a time series decomposition — seasonal","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract components from a time series decomposition — seasonal","text":"","code":"plot(USAccDeaths) fit <- stl(USAccDeaths, s.window=\"periodic\") lines(trendcycle(fit),col=\"red\") library(ggplot2) autoplot(cbind( Data=USAccDeaths, Seasonal=seasonal(fit), Trend=trendcycle(fit), Remainder=remainder(fit)), facets=TRUE) + ylab(\"\") + xlab(\"Year\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":null,"dir":"Reference","previous_headings":"","what":"Seasonal dummy variables — seasonaldummy","title":"Seasonal dummy variables — seasonaldummy","text":"seasonaldummy returns matrix dummy variables suitable use Arima, auto.arima tslm. last season omitted used control.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Seasonal dummy variables — seasonaldummy","text":"","code":"seasonaldummy(x, h = NULL) seasonaldummyf(x, h)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Seasonal dummy variables — seasonaldummy","text":"x Seasonal time series: ts msts object h Number periods ahead forecast (optional)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Seasonal dummy variables — seasonaldummy","text":"Numerical matrix.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Seasonal dummy variables — seasonaldummy","text":"seasonaldummyf deprecated, instead use h argument seasonaldummy. number dummy variables determined time series characteristics x. h missing, length x also determines number rows matrix returned seasonaldummy. value h determines number rows matrix returned seasonaldummy, typically used forecasting. values within x used.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Seasonal dummy variables — seasonaldummy","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Seasonal dummy variables — seasonaldummy","text":"","code":"plot(ldeaths) # Using seasonal dummy variables month <- seasonaldummy(ldeaths) deaths.lm <- tslm(ldeaths ~ month) tsdisplay(residuals(deaths.lm)) ldeaths.fcast <- forecast(deaths.lm, data.frame(month=I(seasonaldummy(ldeaths,36)))) plot(ldeaths.fcast) # A simpler approach to seasonal dummy variables deaths.lm <- tslm(ldeaths ~ season) ldeaths.fcast <- forecast(deaths.lm, h=36) plot(ldeaths.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Seasonal plot — ggseasonplot","title":"Seasonal plot — ggseasonplot","text":"Plots seasonal plot described Hyndman Athanasopoulos (2014, chapter 2). like time plot except data plotted seasons separate years.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Seasonal plot — ggseasonplot","text":"","code":"ggseasonplot( x, season.labels = NULL, year.labels = FALSE, year.labels.left = FALSE, type = NULL, col = NULL, continuous = FALSE, polar = FALSE, labelgap = 0.04, ... ) seasonplot( x, s, season.labels = NULL, year.labels = FALSE, year.labels.left = FALSE, type = \"o\", main, xlab = NULL, ylab = \"\", col = 1, labelgap = 0.1, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Seasonal plot — ggseasonplot","text":"x numeric vector time series class ts. season.labels Labels season \"year\" year.labels Logical flag indicating whether labels year data plotted right. year.labels.left Logical flag indicating whether labels year data plotted left. type plot type (plot). yet supported ggseasonplot. col Colour continuous colour scheme years continuous discrete? polar Plot graph seasonal coordinates labelgap Distance year labels plotted lines ... additional arguments plot. s seasonal frequency x main Main title. xlab X-axis label. ylab Y-axis label.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Seasonal plot — ggseasonplot","text":"None.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Seasonal plot — ggseasonplot","text":"Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Seasonal plot — ggseasonplot","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Seasonal plot — ggseasonplot","text":"","code":"ggseasonplot(AirPassengers, col=rainbow(12), year.labels=TRUE) ggseasonplot(AirPassengers, year.labels=TRUE, continuous=TRUE) seasonplot(AirPassengers, col=rainbow(12), year.labels=TRUE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential smoothing forecasts — ses","title":"Exponential smoothing forecasts — ses","text":"Returns forecasts information exponential smoothing forecasts applied y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential smoothing forecasts — ses","text":"","code":"ses( y, h = 10, level = c(80, 95), fan = FALSE, initial = c(\"optimal\", \"simple\"), alpha = NULL, lambda = NULL, biasadj = FALSE, x = y, ... ) holt( y, h = 10, damped = FALSE, level = c(80, 95), fan = FALSE, initial = c(\"optimal\", \"simple\"), exponential = FALSE, alpha = NULL, beta = NULL, phi = NULL, lambda = NULL, biasadj = FALSE, x = y, ... ) hw( y, h = 2 * frequency(x), seasonal = c(\"additive\", \"multiplicative\"), damped = FALSE, level = c(80, 95), fan = FALSE, initial = c(\"optimal\", \"simple\"), exponential = FALSE, alpha = NULL, beta = NULL, gamma = NULL, phi = NULL, lambda = NULL, biasadj = FALSE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential smoothing forecasts — ses","text":"y numeric vector time series class ts h Number periods forecasting. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. initial Method used selecting initial state values. optimal, initial values optimized along smoothing parameters using ets. simple, initial values set values obtained using simple calculations first observations. See Hyndman & Athanasopoulos (2014) details. alpha Value smoothing parameter level. NULL, estimated. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. x Deprecated. Included backwards compatibility. ... arguments passed forecast.ets. damped TRUE, use damped trend. exponential TRUE, exponential trend fitted. Otherwise, trend (locally) linear. beta Value smoothing parameter trend. NULL, estimated. phi Value damping parameter damped=TRUE. NULL, estimated. seasonal Type seasonality hw model. \"additive\" \"multiplicative\" gamma Value smoothing parameter seasonal component. NULL, estimated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential smoothing forecasts — ses","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned ets associated functions. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential smoothing forecasts — ses","text":"ses, holt hw simply convenient wrapper functions forecast(ets(...)).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Exponential smoothing forecasts — ses","text":"Hyndman, R.J., Koehler, .B., Ord, J.K., Snyder, R.D. (2008) Forecasting exponential smoothing: state space approach, Springer-Verlag: New York. http://www.exponentialsmoothing.net. Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Exponential smoothing forecasts — ses","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential smoothing forecasts — ses","text":"","code":"fcast <- holt(airmiles) plot(fcast) deaths.fcast <- hw(USAccDeaths,h=48) plot(deaths.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulation from a time series model — simulate.ets","title":"Simulation from a time series model — simulate.ets","text":"Returns time series based model object object.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulation from a time series model — simulate.ets","text":"","code":"# S3 method for ets simulate( object, nsim = length(object$x), seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, ... ) # S3 method for Arima simulate( object, nsim = length(object$x), seed = NULL, xreg = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, lambda = object$lambda, ... ) # S3 method for ar simulate( object, nsim = object$n.used, seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, ... ) # S3 method for lagwalk simulate( object, nsim = length(object$x), seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, lambda = object$lambda, ... ) # S3 method for fracdiff simulate( object, nsim = object$n, seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, ... ) # S3 method for nnetar simulate( object, nsim = length(object$x), seed = NULL, xreg = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, lambda = object$lambda, ... ) # S3 method for modelAR simulate( object, nsim = length(object$x), seed = NULL, xreg = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, lambda = object$lambda, ... ) # S3 method for tbats simulate( object, nsim = length(object$y), seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulation from a time series model — simulate.ets","text":"object object class \"ets\", \"Arima\", \"ar\" \"nnetar\". nsim Number periods simulated series. Ignored either xreg innov NULL. Otherwise default length series used train model (100 data found). seed Either NULL integer used call set.seed simulating time series. default, NULL, change random generator state. future Produce sample paths future conditional data object. Otherwise simulate unconditionally. bootstrap simulation using resampled errors rather normally distributed errors errors provided innov. innov vector innovations use error series. Ignored bootstrap==TRUE. NULL, value nsim set length innov. ... arguments, currently used. xreg New values xreg used forecasting. value nsim set number rows xreg NULL. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulation from a time series model — simulate.ets","text":"object class \"ts\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simulation from a time series model — simulate.ets","text":"simulate.Arima(), object produced Arima auto.arima, rather arima. default, error series assumed normally distributed generated using rnorm. innov present, used instead. bootstrap=TRUE innov=NULL, residuals resampled instead. future=TRUE, sample paths conditional data. future=FALSE model stationary, sample paths depend data . future=FALSE model non-stationary, location sample paths arbitrary, start value first observation.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Simulation from a time series model — simulate.ets","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulation from a time series model — simulate.ets","text":"","code":"fit <- ets(USAccDeaths) plot(USAccDeaths, xlim = c(1973, 1982)) lines(simulate(fit, 36), col = \"red\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast seasonal index — sindexf","title":"Forecast seasonal index — sindexf","text":"Returns vector containing seasonal index h future periods. seasonal index non-periodic, uses last values index.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast seasonal index — sindexf","text":"","code":"sindexf(object, h)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast seasonal index — sindexf","text":"object Output decompose stl. h Number periods ahead forecast","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast seasonal index — sindexf","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast seasonal index — sindexf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast seasonal index — sindexf","text":"","code":"uk.stl <- stl(UKDriverDeaths,\"periodic\") uk.sa <- seasadj(uk.stl) uk.fcast <- holt(uk.sa,36) seasf <- sindexf(uk.stl,36) uk.fcast$mean <- uk.fcast$mean + seasf uk.fcast$lower <- uk.fcast$lower + cbind(seasf,seasf) uk.fcast$upper <- uk.fcast$upper + cbind(seasf,seasf) uk.fcast$x <- UKDriverDeaths plot(uk.fcast,main=\"Forecasts from Holt's method with seasonal adjustment\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":null,"dir":"Reference","previous_headings":"","what":"Cubic Spline Forecast — splinef","title":"Cubic Spline Forecast — splinef","text":"Returns local linear forecasts prediction intervals using cubic smoothing splines.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cubic Spline Forecast — splinef","text":"","code":"splinef( y, h = 10, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, method = c(\"gcv\", \"mle\"), x = y )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cubic Spline Forecast — splinef","text":"y numeric vector time series class ts h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. method Method selecting smoothing parameter. method=\"gcv\", generalized cross-validation method smooth.spline used. method=\"mle\", maximum likelihood method Hyndman et al (2002) used. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cubic Spline Forecast — splinef","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned splinef. object class \"forecast\" containing following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). onestepf One-step forecasts fitted model. fitted Smooth estimates fitted trend using data. residuals Residuals fitted model. x minus one-step forecasts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cubic Spline Forecast — splinef","text":"cubic smoothing spline model equivalent ARIMA(0,2,2) model restricted parameter space. advantage spline model full ARIMA model provides smooth historical trend well linear forecast function. Hyndman, King, Pitrun, Billah (2002) show forecast performance method hardly affected restricted parameter space.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Cubic Spline Forecast — splinef","text":"Hyndman, King, Pitrun Billah (2005) Local linear forecasts using cubic smoothing splines. Australian New Zealand Journal Statistics, 47(1), 87-99. https://robjhyndman.com/publications/splinefcast/.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cubic Spline Forecast — splinef","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cubic Spline Forecast — splinef","text":"","code":"fcast <- splinef(uspop,h=5) plot(fcast) summary(fcast) #> #> Forecast method: Cubic Smoothing Spline #> #> Model Information: #> $beta #> [1] 0.0006859 #> #> $call #> splinef(y = uspop, h = 5) #> #> #> Error measures: #> ME RMSE MAE MPE MAPE MASE #> Training set 0.7704553 4.572546 3.165298 -0.6110405 8.174722 0.04536795 #> ACF1 #> Training set -0.4363661 #> #> Forecasts: #> Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 #> 1980 225.6937 219.8454 231.5419 216.7496 234.6378 #> 1990 248.1814 233.7246 262.6382 226.0717 270.2912 #> 2000 270.6692 245.5023 295.8361 232.1798 309.1586 #> 2010 293.1569 255.5241 330.7897 235.6025 350.7113 #> 2020 315.6447 264.0068 367.2826 236.6713 394.6181"},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":null,"dir":"Reference","previous_headings":"","what":"Subsetting a time series — subset.ts","title":"Subsetting a time series — subset.ts","text":"Various types subsetting time series. Allows subsetting index values (unlike window). Also allows extraction values specific season subset seasons year. example, extract values month May time series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subsetting a time series — subset.ts","text":"","code":"# S3 method for ts subset( x, subset = NULL, month = NULL, quarter = NULL, season = NULL, start = NULL, end = NULL, ... ) # S3 method for msts subset(x, subset = NULL, start = NULL, end = NULL, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subsetting a time series — subset.ts","text":"x univariate time series subsetted subset optional logical expression indicating elements keep; missing values taken false. subset must length x. month Numeric character vector months retain. Partial matching month names used. quarter Numeric character vector quarters retain. season Numeric vector seasons retain. start Index start contiguous subset. end Index end contiguous subset. ... arguments, unused.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subsetting a time series — subset.ts","text":"subset used, numeric vector returned ts attributes. start /end used, ts object returned consisting x[start:end], appropriate time series attributes retained. Otherwise, ts object returned frequency equal length month, quarter season.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Subsetting a time series — subset.ts","text":"character values months used, either upper lower case may used, partial unambiguous names acceptable. Possible character values quarters \"Q1\", \"Q2\", \"Q3\", \"Q4\".","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Subsetting a time series — subset.ts","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subsetting a time series — subset.ts","text":"","code":"plot(subset(gas,month=\"November\")) subset(woolyrnq,quarter=3) #> Time Series: #> Start = 1965.5 #> End = 1994.5 #> Frequency = 1 #> [1] 6633 6730 6946 6915 7190 7105 6840 7819 7045 5540 5906 5505 5318 5466 5696 #> [16] 5341 5464 5129 5524 6080 6540 6339 6590 6077 5146 5127 5222 4954 5309 6396 subset(USAccDeaths, start=49) #> Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec #> 1977 7792 6957 7726 8106 8890 9299 10625 9302 8314 8850 8265 8796 #> 1978 7836 6892 7791 8192 9115 9434 10484 9827 9110 9070 8633 9240"},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":null,"dir":"Reference","previous_headings":"","what":"Half-hourly electricity demand — taylor","title":"Half-hourly electricity demand — taylor","text":"Half-hourly electricity demand England Wales Monday 5 June 2000 Sunday 27 August 2000. Discussed Taylor (2003), kindly provided James W Taylor. Units: Megawatts","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Half-hourly electricity demand — taylor","text":"","code":"taylor"},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Half-hourly electricity demand — taylor","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Half-hourly electricity demand — taylor","text":"James W Taylor","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Half-hourly electricity demand — taylor","text":"Taylor, J.W. (2003) Short-term electricity demand forecasting using double seasonal exponential smoothing. Journal Operational Research Society, 54, 799-805.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Half-hourly electricity demand — taylor","text":"","code":"plot(taylor)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract components of a TBATS model — tbats.components","title":"Extract components of a TBATS model — tbats.components","text":"Extract level, slope seasonal components TBATS model. extracted components Box-Cox transformed using estimated transformation parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract components of a TBATS model — tbats.components","text":"","code":"tbats.components(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract components of a TBATS model — tbats.components","text":"x tbats object created tbats.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract components of a TBATS model — tbats.components","text":"multiple time series (mts) object. first series observed time series. second series trend component fitted model. Series three onwards seasonal components fitted model one time series seasonal components. components transformed using estimated Box-Cox parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Extract components of a TBATS model — tbats.components","text":"De Livera, .M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series complex seasonal patterns using exponential smoothing, Journal American Statistical Association, 106(496), 1513-1527.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract components of a TBATS model — tbats.components","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract components of a TBATS model — tbats.components","text":"","code":"if (FALSE) { fit <- tbats(USAccDeaths, use.parallel=FALSE) components <- tbats.components(fit) plot(components)}"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":null,"dir":"Reference","previous_headings":"","what":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"Fits TBATS model applied y, described De Livera, Hyndman & Snyder (2011). Parallel processing used default speed computations.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"","code":"tbats( y, use.box.cox = NULL, use.trend = NULL, use.damped.trend = NULL, seasonal.periods = NULL, use.arma.errors = TRUE, use.parallel = length(y) > 1000, num.cores = 2, bc.lower = 0, bc.upper = 1, biasadj = FALSE, model = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"y time series forecast. Can numeric, msts ts. univariate time series supported. use.box.cox TRUE/FALSE indicates whether use Box-Cox transformation . NULL tried best fit selected AIC. use.trend TRUE/FALSE indicates whether include trend . NULL tried best fit selected AIC. use.damped.trend TRUE/FALSE indicates whether include damping parameter trend . NULL tried best fit selected AIC. seasonal.periods y numeric seasonal periods can specified parameter. use.arma.errors TRUE/FALSE indicates whether include ARMA errors . TRUE best fit selected AIC. FALSE selection algorithm consider ARMA errors. use.parallel TRUE/FALSE indicates whether use parallel processing. num.cores number parallel processes used using parallel processing. NULL number logical cores detected available cores used. bc.lower lower limit (inclusive) Box-Cox transformation. bc.upper upper limit (inclusive) Box-Cox transformation. biasadj Use adjusted back-transformed mean Box-Cox transformations. TRUE, point forecasts fitted values mean forecast. Otherwise, points can considered median forecast densities. model Output previous call tbats. model passed, model fitted y without re-estimating parameters. ... Additional arguments passed auto.arima choose ARMA(p, q) model errors. (Note xreg ignored, arguments concerning seasonality differencing, arguments controlling values p q used.)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"object class c(\"tbats\", \"bats\"). generic accessor functions fitted.values residuals extract useful features value returned bats associated functions. fitted model designated TBATS(omega, p,q, phi, ,...,) omega Box-Cox parameter phi damping parameter; error modelled ARMA(p,q) process m1,...,mJ list seasonal periods used model k1,...,kJ corresponding number Fourier terms used seasonality.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"De Livera, .M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series complex seasonal patterns using exponential smoothing, Journal American Statistical Association, 106(496), 1513-1527.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"","code":"if (FALSE) { fit <- tbats(USAccDeaths) plot(forecast(fit)) taylor.fit <- tbats(taylor) plot(forecast(taylor.fit))}"},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":null,"dir":"Reference","previous_headings":"","what":"Theta method forecast — thetaf","title":"Theta method forecast — thetaf","text":"Returns forecasts prediction intervals theta method forecast.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Theta method forecast — thetaf","text":"","code":"thetaf( y, h = ifelse(frequency(y) > 1, 2 * frequency(y), 10), level = c(80, 95), fan = FALSE, x = y )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Theta method forecast — thetaf","text":"y numeric vector time series class ts h Number periods forecasting level Confidence levels prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Theta method forecast — thetaf","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned rwf. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Theta method forecast — thetaf","text":"theta method Assimakopoulos Nikolopoulos (2000) equivalent simple exponential smoothing drift. demonstrated Hyndman Billah (2003). series tested seasonality using test outlined &N. deemed seasonal, series seasonally adjusted using classical multiplicative decomposition applying theta method. resulting forecasts reseasonalized. Prediction intervals computed using underlying state space model. general theta methods available forecTheta package.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Theta method forecast — thetaf","text":"Assimakopoulos, V. Nikolopoulos, K. (2000). theta model: decomposition approach forecasting. International Journal Forecasting 16, 521-530. Hyndman, R.J., Billah, B. (2003) Unmasking Theta method. International J. Forecasting, 19, 287-290.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Theta method forecast — thetaf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Theta method forecast — thetaf","text":"","code":"nile.fcast <- thetaf(Nile) plot(nile.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":null,"dir":"Reference","previous_headings":"","what":"Time series cross-validation — tsCV","title":"Time series cross-validation — tsCV","text":"tsCV computes forecast errors obtained applying forecastfunction subsets time series y using rolling forecast origin.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time series cross-validation — tsCV","text":"","code":"tsCV(y, forecastfunction, h = 1, window = NULL, xreg = NULL, initial = 0, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time series cross-validation — tsCV","text":"y Univariate time series forecastfunction Function return object class forecast. first argument must univariate time series, must argument h forecast horizon. exogenous predictors used, must also xreg newxreg arguments corresponding training test periods. h Forecast horizon window Length rolling window, NULL, rolling window used. xreg Exogeneous predictor variables passed forecast function required. initial Initial period time series cross-validation performed. ... arguments passed forecastfunction.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time series cross-validation — tsCV","text":"Numerical time series object containing forecast errors vector (h=1) matrix otherwise. time index corresponds last period training data. columns correspond forecast horizons.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time series cross-validation — tsCV","text":"Let y contain time series \\(y_1,\\dots,y_T\\). forecastfunction applied successively time series \\(y_1,\\dots,y_t\\), \\(t=1,\\dots,T-h\\), making predictions \\(\\hat{y}_{t+h|t}\\). errors given \\(e_{t+h} = y_{t+h}-\\hat{y}_{t+h|t}\\). h=1, returned vector, \\(e_1,\\dots,e_T\\). h>1, returned matrix hth column containing errors forecast horizon h. first errors may missing may possible apply forecastfunction short time series.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time series cross-validation — tsCV","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time series cross-validation — tsCV","text":"","code":"#Fit an AR(2) model to each rolling origin subset far2 <- function(x, h){forecast(Arima(x, order=c(2,0,0)), h=h)} e <- tsCV(lynx, far2, h=1) #Fit the same model with a rolling window of length 30 e <- tsCV(lynx, far2, h=1, window=30) #Example with exogenous predictors far2_xreg <- function(x, h, xreg, newxreg) { forecast(Arima(x, order=c(2,0,0), xreg=xreg), xreg=newxreg) } y <- ts(rnorm(50)) xreg <- matrix(rnorm(100),ncol=2) e <- tsCV(y, far2_xreg, h=3, xreg=xreg)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify and replace outliers and missing values in a time series — tsclean","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"Uses supsmu non-seasonal series robust STL decomposition seasonal series. estimate missing values outlier replacements, linear interpolation used (possibly seasonally adjusted) series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"","code":"tsclean(x, replace.missing = TRUE, iterate = 2, lambda = NULL)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"x time series replace.missing TRUE, replaces outliers, also interpolates missing values iterate number iterations required lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"Hyndman (2021) \"Detecting time series outliers\" https://robjhyndman.com/hyndsight/tsoutliers/.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"","code":"cleangold <- tsclean(gold)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":null,"dir":"Reference","previous_headings":"","what":"Time series display — ggtsdisplay","title":"Time series display — ggtsdisplay","text":"Plots time series along acf either pacf, lagged scatterplot spectrum.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time series display — ggtsdisplay","text":"","code":"ggtsdisplay( x, plot.type = c(\"partial\", \"histogram\", \"scatter\", \"spectrum\"), points = TRUE, smooth = FALSE, lag.max, na.action = na.contiguous, theme = NULL, ... ) tsdisplay( x, plot.type = c(\"partial\", \"histogram\", \"scatter\", \"spectrum\"), points = TRUE, ci.type = c(\"white\", \"ma\"), lag.max, na.action = na.contiguous, main = NULL, xlab = \"\", ylab = \"\", pch = 1, cex = 0.5, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time series display — ggtsdisplay","text":"x numeric vector time series class ts. plot.type type plot include lower right corner. points logical flag indicating whether show individual points time plot. smooth logical flag indicating whether show smooth loess curve superimposed time plot. lag.max maximum lag plot acf pacf. suitable value selected default argument missing. na.action function handle missing values acf, pacf spectrum calculations. default na.contiguous. Useful alternatives na.pass na.interp. theme Adds ggplot element plot, typically theme. ... additional arguments acf. ci.type type confidence limits ACF passed acf. confidence limits assume white noise input lag \\(k\\) MA(\\(k-1\\)) input? main Main title. xlab X-axis label. ylab Y-axis label. pch Plotting character. cex Character size.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time series display — ggtsdisplay","text":"None.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time series display — ggtsdisplay","text":"ggtsdisplay produce equivalent plot using ggplot graphics.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Time series display — ggtsdisplay","text":"Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time series display — ggtsdisplay","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time series display — ggtsdisplay","text":"","code":"library(ggplot2) ggtsdisplay(USAccDeaths, plot.type=\"scatter\", theme=theme_bw()) tsdisplay(diff(WWWusage)) ggtsdisplay(USAccDeaths, plot.type=\"scatter\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit a linear model with time series components — tslm","title":"Fit a linear model with time series components — tslm","text":"tslm used fit linear models time series including trend seasonality components.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit a linear model with time series components — tslm","text":"","code":"tslm(formula, data, subset, lambda = NULL, biasadj = FALSE, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit a linear model with time series components — tslm","text":"formula object class \"formula\" (one can coerced class): symbolic description model fitted. data optional data frame, list environment (object coercible .data.frame data frame) containing variables model. found data, variables taken environment(formula), typically environment lm called. subset optional subset containing rows data keep. best results, pass logical vector rows keep. Also supports subset() functions. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments passed lm()","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit a linear model with time series components — tslm","text":"Returns object class \"lm\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit a linear model with time series components — tslm","text":"tslm largely wrapper lm() except allows variables \"trend\" \"season\" created fly time series characteristics data. variable \"trend\" simple time trend \"season\" factor indicating season (e.g., month quarter depending frequency data).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit a linear model with time series components — tslm","text":"Mitchell O'Hara-Wild Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit a linear model with time series components — tslm","text":"","code":"y <- ts(rnorm(120,0,3) + 1:120 + 20*sin(2*pi*(1:120)/12), frequency=12) fit <- tslm(y ~ trend + season) plot(forecast(fit, h=20))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify and replace outliers in a time series — tsoutliers","title":"Identify and replace outliers in a time series — tsoutliers","text":"Uses supsmu non-seasonal series periodic stl decomposition seasonal series identify outliers estimate replacements.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify and replace outliers in a time series — tsoutliers","text":"","code":"tsoutliers(x, iterate = 2, lambda = NULL)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify and replace outliers in a time series — tsoutliers","text":"x time series iterate number iterations required lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify and replace outliers in a time series — tsoutliers","text":"index Indicating index outlier(s) replacement Suggested numeric values replace identified outliers","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Identify and replace outliers in a time series — tsoutliers","text":"Hyndman (2021) \"Detecting time series outliers\" https://robjhyndman.com/hyndsight/tsoutliers/.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify and replace outliers in a time series — tsoutliers","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify and replace outliers in a time series — tsoutliers","text":"","code":"data(gold) tsoutliers(gold) #> $index #> [1] 770 #> #> $replacements #> [1] 494.9 #>"},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":null,"dir":"Reference","previous_headings":"","what":"Australian total wine sales — wineind","title":"Australian total wine sales — wineind","text":"Australian total wine sales wine makers bottles <= 1 litre. Jan 1980 -- Aug 1994.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Australian total wine sales — wineind","text":"","code":"wineind"},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Australian total wine sales — wineind","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Australian total wine sales — wineind","text":"Time Series Data Library. https://pkg.yangzhuoranyang.com/tsdl/","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Australian total wine sales — wineind","text":"","code":"tsdisplay(wineind)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":null,"dir":"Reference","previous_headings":"","what":"Quarterly production of woollen yarn in Australia — woolyrnq","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"Quarterly production woollen yarn Australia: tonnes. Mar 1965 -- Sep 1994.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"","code":"woolyrnq"},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"Time Series Data Library. https://pkg.yangzhuoranyang.com/tsdl/","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"","code":"tsdisplay(woolyrnq)"},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-8220","dir":"Changelog","previous_headings":"","what":"forecast 8.22.0","title":"forecast 8.22.0","text":"hfitted now much faster ARIMA models (danigiro, #949) hfitted now much faster ETS models, produces fitted values initial states (#950)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-8211","dir":"Changelog","previous_headings":"","what":"forecast 8.21.1","title":"forecast 8.21.1","text":"CRAN release: 2023-08-31 nnetar now allows p P 0 Bug fixes improved docs","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-821","dir":"Changelog","previous_headings":"","what":"forecast 8.21","title":"forecast 8.21","text":"CRAN release: 2023-02-27 Fixed df calculation Ljung-Box tests checkresiduals Fixed broken tests","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-820","dir":"Changelog","previous_headings":"","what":"forecast 8.20","title":"forecast 8.20","text":"CRAN release: 2023-01-06 Improvements unit tests, migrate testthat 3e Prevent failure C23 mode","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-819","dir":"Changelog","previous_headings":"","what":"forecast 8.19","title":"forecast 8.19","text":"CRAN release: 2022-11-20 Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-818","dir":"Changelog","previous_headings":"","what":"forecast 8.18","title":"forecast 8.18","text":"CRAN release: 2022-10-02 Updated RW forecasts use unbiased estimate sigma2 Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-8170","dir":"Changelog","previous_headings":"","what":"forecast 8.17.0","title":"forecast 8.17.0","text":"CRAN release: 2022-07-25 Updated dm.test() add alternative variance estimators. (#898) Added simulate.tbats() simulating TBATS models. Added dependency generics accuracy() forecast() (#902) Bux fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-816","dir":"Changelog","previous_headings":"","what":"forecast 8.16","title":"forecast 8.16","text":"CRAN release: 2022-01-10 Fixed tslm() incorrectly applying Box-Cox transformations mts provided data argument (#886). Set D=0 auto.arima applied series 2m observations fewer. Improved performance parallel search ARIMA models (jonlachmann, #891). Fixed scoping functions used ggAcf() (#896). Fixed checks xreg simulate.Arima() (#818) Improved docs bug fixes.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-815","dir":"Changelog","previous_headings":"","what":"forecast 8.15","title":"forecast 8.15","text":"CRAN release: 2021-06-01 Changed summary() methods defer console output print() Changed default s.window values mstl(), stlf() stlm(). new defaults based extensive empirical testing.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-814","dir":"Changelog","previous_headings":"","what":"forecast 8.14","title":"forecast 8.14","text":"CRAN release: 2021-03-11 Changed default BoxCox(lambda = \"auto\") lower bound -0.9. Use better variance estimates ets() bias adjustments. Improved robustness autoplot.seas() non-seasonal decomposition. Fixed scoping parameters auto.arima(parallel = TRUE) (#874). Fixed handling xreg tsCV().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-813","dir":"Changelog","previous_headings":"","what":"forecast 8.13","title":"forecast 8.13","text":"CRAN release: 2020-09-12 Fixed forecasts Arima drift initial NAs. Fixed season colours gglagplot() match y-axis (original data). Fixed facet order classical decomposition autoplot() Fixed summary() erroring tslm() models containing NA values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-812","dir":"Changelog","previous_headings":"","what":"forecast 8.12","title":"forecast 8.12","text":"CRAN release: 2020-03-31 Fixed bias adjusted forecast mean ARIMA forecasts. Improved naming accuracy() generic formals. Fix seasonal periods taylor dataset.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-811","dir":"Changelog","previous_headings":"","what":"forecast 8.11","title":"forecast 8.11","text":"CRAN release: 2020-02-09 axis gglagplot() reversed consistency stats::lag.plot().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-810","dir":"Changelog","previous_headings":"","what":"forecast 8.10","title":"forecast 8.10","text":"CRAN release: 2019-12-05 Updates remove new CRAN errors Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-89","dir":"Changelog","previous_headings":"","what":"forecast 8.9","title":"forecast 8.9","text":"CRAN release: 2019-08-22 Updates CRAN policies Suggests packages Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-88","dir":"Changelog","previous_headings":"","what":"forecast 8.8","title":"forecast 8.8","text":"CRAN release: 2019-08-02 Updates compatibility fable Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-87","dir":"Changelog","previous_headings":"","what":"forecast 8.7","title":"forecast 8.7","text":"CRAN release: 2019-04-29 Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-86","dir":"Changelog","previous_headings":"","what":"forecast 8.6","title":"forecast 8.6","text":"CRAN release: 2019-04-16 Reduced conflicts tidy forecasting packages Forecast autoplots now use colour shading autolayer() geom_forecast Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-85","dir":"Changelog","previous_headings":"","what":"forecast 8.5","title":"forecast 8.5","text":"CRAN release: 2019-01-18 Updated tsCV() handle exogenous regressors Reimplemented lagwalk methods (naive, snaive, rwf) speed improvements Added support passing arguments auto.arima() unit root tests Improved auto.arima() stepwise search algorithm Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-84","dir":"Changelog","previous_headings":"","what":"forecast 8.4","title":"forecast 8.4","text":"CRAN release: 2018-06-21 Added modelAR(), generalising nnetar() support user-defined functions Added na.action argument ets Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-83","dir":"Changelog","previous_headings":"","what":"forecast 8.3","title":"forecast 8.3","text":"CRAN release: 2018-04-11 Added mstl() handle multiple seasonal decomposition stlf(), stlm(), tsoutliers() tsclean() now use mstl(). Updated tsCV() handle multiple horizons Switched unit root tests ndiffs() use urca package Added ocsb.test Changed method choosing D auto.arima() measure seasonal strength. Added baggedModel() function generalize baggedETS Added bootstrapped PI functions Allowed lambda=‘auto’ functions lambda argument. Updated author list include major contributors Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-82","dir":"Changelog","previous_headings":"","what":"forecast 8.2","title":"forecast 8.2","text":"CRAN release: 2017-09-25 Added pkgdown site Added rolling window option tsCV Improved robustness short time series missing values Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-81","dir":"Changelog","previous_headings":"","what":"forecast 8.1","title":"forecast 8.1","text":"CRAN release: 2017-06-17 Added .character.ets, .character.bats, .character.tbats Made gghistogram() checkresiduals() robust missing values documentation now generated using roxygen Improved documentation many functions Added autoplot.msts() autolayer.msts Added .character methods many models generate model names Added .ts.forecast autoplot method bats/tbats models Better ARIMA trace output Made accuracy S3 method Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-80","dir":"Changelog","previous_headings":"","what":"forecast 8.0","title":"forecast 8.0","text":"CRAN release: 2017-02-23 Added tips start message Added pipe operator Added tsCV() CVar() functions Added baggedETS Added head.ts() tail.ts(), head tail now work properly ts objects. Added gghistogram() checkresiduals Added ggseasonplot polar coordinates Modified defaults gglagplot Added autolayer.ts Added type argument residuals() different types residuals Added support seas objects seasonal package Component extraction seasonal decomposition methods Range bars decomposition autoplots Added autoplot.StructTS Added vignette based 2008 JSS article Hyndman Khandakar Improved ggplot functions mforecast objects re-structured Added .data.frame.mforecast autoplot functions now exported Refit support arfima() stlm Better bias adjustment support Box-Cox transformation print.ARIMA better labelling constants Bug fixes Removed fortify method forecast objects","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-73","dir":"Changelog","previous_headings":"","what":"forecast 7.3","title":"forecast 7.3","text":"CRAN release: 2016-10-13 Added prediction intervals simulation nnetar(). Documentation improvement Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-72","dir":"Changelog","previous_headings":"","what":"forecast 7.2","title":"forecast 7.2","text":"CRAN release: 2016-09-09 Faceting autoplot.mts Box-Cox support ses, holt, hw ets() now works tiny time series Added h-step fitted values fitted() function. seasonal adjustment added thetaf y now standard first argument modelling functions Added truncate argument auto.arima seasadj() now S3 method series frequency < 1 non-integer seasonality now handled better ggplot2 theme support Added gglagplot, gglagchull Arima() auto.arima() now allow argument passed stats::arima(). Bug fixes speed improvements","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-71","dir":"Changelog","previous_headings":"","what":"forecast 7.1","title":"forecast 7.1","text":"CRAN release: 2016-04-14 Fixed bug auto.arima Box-Cox transformation sometimes applied twice Improved axes ggseasonalplot Improved tslm() avoid problems finding data nnetar() updated allow subsets Modified initial values ets Improved unit tests avoid deprecated functions avoid data fpp Removed fpp Suggests list","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-70","dir":"Changelog","previous_headings":"","what":"forecast 7.0","title":"forecast 7.0","text":"CRAN release: 2016-04-04 Added ggplot2 graphics Bias adjustment option added functions allow Box-Cox transformations Added Ccf function, rewrote Acf handle multivariate series. tslm() completely rewritten robust handle fourier terms easily Support multivariate linear models added subset.ts() robust, captures errors. Added xreg argument nnetar Improved labels seasonplot unit tests added Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-62","dir":"Changelog","previous_headings":"","what":"forecast 6.2","title":"forecast 6.2","text":"CRAN release: 2015-10-20 Many unit tests added using testthat. Fixed bug ets short seasonal series passed data frame. Fixed bug nnetar initial predictor vector reversed. Corrected model name returned nnetar(). Fixed bug accuracy() non-integer seasonality used. Made auto.arima() robust non-integer seasonality. Fixed bug auto.arima allowmean ignored stepwise=FALSE. Improved robustness forecast.ets() explosive models multiplicative trends. Exogenous variables now passed VAR forecasts Increased maximum nmse ets() 30. Made tsoutliers() robust weak seasonality Changed tsoutliers() use supsmu non-seasonal seasonally adjusted data. Fixed bug tbats() seasonal period 1 small multiple seasonal period 2. bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-61","dir":"Changelog","previous_headings":"","what":"forecast 6.1","title":"forecast 6.1","text":"CRAN release: 2015-05-12 Made auto.arima robust","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-60","dir":"Changelog","previous_headings":"","what":"forecast 6.0","title":"forecast 6.0","text":"CRAN release: 2015-05-09 Modified dm.test give error variance zero Corrected help file splinef(). Fixed typo accuracy help file regarding RMSE Fixed bug accuracy() occurred Arima ets objects. Fixed arima.errors() handle Box-Cox transformed models. Modified auto.arima() stricter near-unit-roots. Added allowmean argument auto.arima(). Improved handling constant series Arima() forecast.Arima(). Added plot.Arima() plot.ar() functions. Added .character.Arima Captured problem bats/tbats data constant. Modified TBATS BATS estimation avoid occasional instabilities. Fixed bug forecasts bats labelled TBATS. Added allow.multiplicative.trend argument ets(). Set allow.multiplictive.trend=FALSE stlf(), stlm() forecast.ts(). Simplified arguments stlf(). Added taperedacf taperedpacf functions Added functions bootstrapping time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-59","dir":"Changelog","previous_headings":"","what":"forecast 5.9","title":"forecast 5.9","text":"CRAN release: 2015-02-26 Improved documentation accuracy() function. Fixed occasional bug accuracy() test set single observation. Improved Acf() give better handling horizontal axis seasonal data … passed. Removed print.Arima predict.Arima added print.ARIMA method argument now passed re-fitting ARIMA model. Fixed error CH test applied short series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-58","dir":"Changelog","previous_headings":"","what":"forecast 5.8","title":"forecast 5.8","text":"CRAN release: 2015-01-06 Fixed bug versions R 3.10 using fourier fourierf. Made BoxCox.lambda() robust missing values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-57","dir":"Changelog","previous_headings":"","what":"forecast 5.7","title":"forecast 5.7","text":"CRAN release: 2014-12-17 Fixed bug tbats/bats optional arguments passed auto.arima(). Revised fourier() fourierf() avoid large orders, avoid zero columns. Improved accuracy fourier() fourierf(), simplifying code. Removed duplicate columns returned fourier/fourierf multiple seasonal periods. Corrected bugs simulate.Arima models involving xreg. Centred simulations simulate.Arima non-stationary models conditioning first observation. Added findfrequency() function. Fixed error computed residuals forecast.stl(). Improved handling short series auto.arima(). Fixed error forecasting additive damped models. Damping previously applied second forecast horizon. Fixed misuse abs() two places C code. Added na.action argument Acf() fixed na.action argument tsdisplay().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-56","dir":"Changelog","previous_headings":"","what":"forecast 5.6","title":"forecast 5.6","text":"CRAN release: 2014-09-24 Improved tbats bats ensuring ARMA coefficients close boundary invertibility stationarity. Improved nsdiffs() handling degenerate series (e.g., zeros). Improved forecast.ar() function buried within functions. Improved handling degenerate ARIMA models xreg used. robust ets() initialization. Fixed problem na.interp() seasonal data frequency <= 5. Removed undocumented option use Rmalschains optimization ets().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-55","dir":"Changelog","previous_headings":"","what":"forecast 5.5","title":"forecast 5.5","text":"CRAN release: 2014-08-12 Improved documentation croston Added stlm() forecast.stlm() functions, added forecastfunction argument way specifying forecast method stlf() forecast.stl(). Improved forecast.ar() likely work ar() forecast.ar() embedded within functions. Improved handling ARIMA models seasonality greater 48 Improved handling degenerate regression models nsdiffs Update fourier() fourierf() work msts object. Added new argument find.frequency forecast.ts(). Added new arguments d D accuracy() MASE. Corrected bugs accuracy(). Better handling regression models perfect fit auto.arima(). Fixed bug tbats.components() seasonal components.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-54","dir":"Changelog","previous_headings":"","what":"forecast 5.4","title":"forecast 5.4","text":"CRAN release: 2014-05-08 Fixed bug forecast.tbats() forecast.bats() ts.frequency match seasonal.periods. Fixed bug getResponse.lm() ’s logged dependent variable. Modified ets() avoid problems data contains large numbers. Modified ets() produce forecasts data constant. Improved arima.errors() find xreg often, return error can’t found.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-53","dir":"Changelog","previous_headings":"","what":"forecast 5.3","title":"forecast 5.3","text":"CRAN release: 2014-03-24 Unit tests added Fixed bug zzhw() reversed sign residuals. Updated help file CV() specify leave-one-. Fixed guer.cv() allow non-integer periods without warning. Added use.initial.values argument ets(). Added arimaorder() function. Modified warnings suppression using suppressWarnings() throughout.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-52","dir":"Changelog","previous_headings":"","what":"forecast 5.2","title":"forecast 5.2","text":"CRAN release: 2014-02-24 Changed default number cores 2 functions use parallel processing. Removed remaining call bats() examples run.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-51","dir":"Changelog","previous_headings":"","what":"forecast 5.1","title":"forecast 5.1","text":"CRAN release: 2014-02-08 Fixed bug tsoutliers() tsclean() short seasonal series. Fixed bug Arima() seasonal order specified numerically instead via list. Removed dimension attribution output arima.errors Improved handling “test” accuracy Changed parallel processing parLapply auto.arima Added timeDate dependency avoid errors easter() link Rcpp >= 0.11.0.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-50","dir":"Changelog","previous_headings":"","what":"forecast 5.0","title":"forecast 5.0","text":"CRAN release: 2014-01-17 Added argument model dshw(). Added bizdays() easter() calendar variables. Added arguments max.D max.d auto.arima(), ndiffs() nsdiffs(). Made several functions robust zoo objects. Corrected error calculation AICc using CV(). Made minimum default p nnetar equal 1. Added tsoutliers() tsclean() identifying replacing outliers Improved na.interp() handle seasonality added argument lambda na.interp Added robust option forecast.ts() allow outliers missing values Improved output snaive() naive() better reflect user expectations Allowed Acf() handle missing values using na.contiguous Changed default information criterion ets() AICc. Removed drift term Arima() d+D>1. Added bootstrap option forecast.Arima","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-48","dir":"Changelog","previous_headings":"","what":"forecast 4.8","title":"forecast 4.8","text":"CRAN release: 2013-09-30 Fixed bug rwf() introduced v4.7","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-47","dir":"Changelog","previous_headings":"","what":"forecast 4.7","title":"forecast 4.7","text":"CRAN release: 2013-09-27 Added forecast.forecast() simply return object passed. Removed leading zero package number. .e., 4.7 instead 4.07. better handling nearly constant time series, nearly linear time series improved handling missing values rwf corrected fitted values residuals meanf() time series data bats() tbats() now handle missing values way ets(). .e., using longest contiguous portion. better handling short time series initial states ets() modified short time series (less 3 years). nsdiffs CH test now handles degenerate cases without returning error. nnetar now handles missing values Fixed bug forecast.varest() residuals fitted values computed correctly. Added accuracy() calculation VAR models Fixed bug simulate.fracdiff() future=TRUE. Sometimes future argument ignored.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-406","dir":"Changelog","previous_headings":"","what":"forecast 4.06","title":"forecast 4.06","text":"CRAN release: 2013-06-30 accuracy() returning mape mpe 100 times large -sample errors.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-405","dir":"Changelog","previous_headings":"","what":"forecast 4.05","title":"forecast 4.05","text":"CRAN release: 2013-06-19 Fixed bug hw() works initial=“simple” Allowed bats() tbats() take non-positive values. ets() now calls optim direct via c code making ets() run much faster. Added Rmalschains possible optimizer ets(). documented. Modified forecast.lm likely original data stored returned object. Corrected bug forecast.Arima occurred Box-Cox transformation used bootstrap=TRUE. accuracy() updated gives information, returns matrix test training measures. Corrected training error measures splinef() forecasts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-404","dir":"Changelog","previous_headings":"","what":"forecast 4.04","title":"forecast 4.04","text":"CRAN release: 2013-04-22 Added ylim argument Acf Avoided clash signal package using auto.arima(). Fixed problem plot.forecast() historical data NA available historical data. forecast.Arima() now little robust zoo object passed instead ts object. CV() now handles missing values residuals. Fixed bug holt() hw() printed model longer contains missing values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-403","dir":"Changelog","previous_headings":"","what":"forecast 4.03","title":"forecast 4.03","text":"CRAN release: 2013-03-17 forecast.lm now guesses variable name one predictor variable. Removed error trap forecast.lm xreg variables passed catching legitimate calls.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-402","dir":"Changelog","previous_headings":"","what":"forecast 4.02","title":"forecast 4.02","text":"CRAN release: 2013-03-06 Fixed error prediction intervals returned forecast.ets() simulation used Box-Cox transformation specified. Fixed bug accuracy() numerical f vector passed. Fixed man file Diebold-Mariano test. Corrected references nsdiffs() help page. Added warning nsdiffs series short seasonal differencing. Fixed problem getResponse.Arima Arima object created stats::arima() within function. Added tbats.components() extended seasadj() allow tbats objects. Added undocumented functions forecasting, printing plotting output vars::VAR.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-401","dir":"Changelog","previous_headings":"","what":"forecast 4.01","title":"forecast 4.01","text":"CRAN release: 2013-01-22 Error now trapped newxreg variables passed forecast.lm Corrected help file dshw() remove references prediction intervals. Improved help file dm.test() give information alternative hypotheses. Improved dm.test() performance small samples using t-distribution instead normal. Modified bats() tbats() examples follow CRAN policies parallel processing. Moved packages Depends Imports. Added getResponse() function return historical time series various time series model objects. Modified accuracy() use getResponse(). Allowed user-generated innovations simulate.ets(), simulate.Arima(), etc. Allowed xreg argument forecast.stl() stlf() ARIMA model used. Removed reliance caret, associated fitted residuals functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-400","dir":"Changelog","previous_headings":"","what":"forecast 4.00","title":"forecast 4.00","text":"CRAN release: 2012-11-27 robust handling degenerate ARIMA models. New defaults shaded colors used prediction intervals plots. auto.arima() now remembers name series Box-Cox transformation used. New function nnetar() automatic neural network forecasting time series. arfima() now tries harder ensure ARMA part stationary. ts control added forecast linear models forecast.lm(). Fixed bug bats() caused error use.box.cox=FALSE use.trend=FALSE. Added residuals fitted methods train avNNet objects caret package. accuracy() can now figure overlapping times x f. rwf() now handles missing values. Revised ses(), holt() hw() can optionally use traditional initialization.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-325","dir":"Changelog","previous_headings":"","what":"forecast 3.25","title":"forecast 3.25","text":"CRAN release: 2012-09-11 Fixed bug simulate.Arima. Improved handling short seasonal time series auto.arima(). Added seasonal argument auto.arima(). Fixed bug splinef() added gcv method estimating smoothing parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-324-23-july-2012","dir":"Changelog","previous_headings":"","what":"forecast 3.24 (23 July 2012","title":"forecast 3.24 (23 July 2012","text":"CRAN release: 2012-07-23 Fixed bug auto.arima() introduced v3.23 meant ARIMA(0,0,0) model returned half time.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-323","dir":"Changelog","previous_headings":"","what":"forecast 3.23","title":"forecast 3.23","text":"CRAN release: 2012-07-18 Fixed bug arfima() meant drange argument ignored. Extended auto.arima() returns something sensible data constant.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-322","dir":"Changelog","previous_headings":"","what":"forecast 3.22","title":"forecast 3.22","text":"CRAN release: 2012-06-07 Increased maximum forecast horizon ets models 2000 unlimited. Corrected bug Arima(). Previously include.constant=FALSE ignored. corrections bats tbats. Modified parallel implementation auto.arima Windows.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-321","dir":"Changelog","previous_headings":"","what":"forecast 3.21","title":"forecast 3.21","text":"CRAN release: 2012-04-30 Fixed bug auto.arima() lambda non-zero stepwise FALSE. Fixed bug auto.arima() selecting d D>0. Fixed bug ets() seasonal period less 1. Turned warnings auto.arima() ets() seasonal period less 1. Added plotting methods bats tbats objects. Changed default forecast horizons bats tbats objects. Modified bats tbats now use seasonal.periods ts msts objects modelled.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-320","dir":"Changelog","previous_headings":"","what":"forecast 3.20","title":"forecast 3.20","text":"CRAN release: 2012-04-02 Fixed bugs forecast.lm(). Improved handling newdata forecast.lm() provide meaningful error messages. Fixed bug dm.test() occurred errors small.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-319","dir":"Changelog","previous_headings":"","what":"forecast 3.19","title":"forecast 3.19","text":"CRAN release: 2012-02-22 Improved plotting forecast objects lm models Added MASE lm forecasts using insample mean forecasts scaling. Modified definition MASE seasonal time series use seasonal naive insample scaling. Modified meanf() allow used cross-sectional data. Updated accuracy() allow used cross-sectional data, lm forecasts lm objects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-318","dir":"Changelog","previous_headings":"","what":"forecast 3.18","title":"forecast 3.18","text":"CRAN release: 2012-02-17 Added method plotting non-time-series forecasts plot.forecast(). Removed partial arg matching. Cleaned code, removing commented sections, etc. Added robust option stlf(). Added naive rwdrift options stlf() forecast.stl(). Improved handling msts objects BoxCox.lambda Fixed minor bugs tbats() bats Improved speed bats() tbats().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-317","dir":"Changelog","previous_headings":"","what":"forecast 3.17","title":"forecast 3.17","text":"CRAN release: 2012-02-02 Improved forecast.lm() likely find original data lm object. Parallel processing now available auto.arima() stepwise=FALSE Default model selection auto.arima() changed AICc rather AIC. may affect model selection short time series. max orders auto.arima() now restricted less 1/3 length data.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-316","dir":"Changelog","previous_headings":"","what":"forecast 3.16","title":"forecast 3.16","text":"CRAN release: 2011-12-24 Corrected problem AIC computation bats tbats Fixed handling non-seasonal data bats Changed dependency >= R 2.14.0 order ensure parallel package available.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-315","dir":"Changelog","previous_headings":"","what":"forecast 3.15","title":"forecast 3.15","text":"CRAN release: 2011-12-22 New functions tbats() forecast.tbats() multiple seasonal time series modelling. bats() tbats() use parallel processing possible. Minor improvements bats() forecast.bats(). decompose() removed function stats package now fixed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-314","dir":"Changelog","previous_headings":"","what":"forecast 3.14","title":"forecast 3.14","text":"CRAN release: 2011-12-09 Improved documentation forecast.ts Corrected bug dshw() applied non-ts object. Added error message dshw() applied data containing zeros negative values Added checks dshw() applied time series non-nested periods. Added msts object class multiple seasonal time series Made taylor data set msts object. Added bats() function multiple seasonal time series modelling Added forecast.bats() function forecasting BATS models Byte compiling turned Depending Rcpp RcppArmadillo speed code .","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-313","dir":"Changelog","previous_headings":"","what":"forecast 3.13","title":"forecast 3.13","text":"CRAN release: 2011-11-20 Bug fix forecast.StructTS() due changes StructTS object. default h set 0. Thanks Tarmo Leinonen reporting problem. Bug fix forecast.stl() h longer one seasonal period sometimes returned missing forecasts. Thanks Kevin Burton reporting problem. forecast.stl() longer allows seasonal ETS model specified. Thanks Stefano Birmani suggestion.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-312","dir":"Changelog","previous_headings":"","what":"forecast 3.12","title":"forecast 3.12","text":"CRAN release: 2011-11-16 Added option control ets model stlf() forecast.stl(). Thanks Stefano Birmani suggestion. Reordered arguments forecast.lm() stlf() consistent forecast functions. Modified tslm() likely find relevant data passed argument. Fixed bug forecast.ets returned zero forecasts models seasonal period > 24.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-311","dir":"Changelog","previous_headings":"","what":"forecast 3.11","title":"forecast 3.11","text":"CRAN release: 2011-11-02 Fixed bug dshw() smallest period odd","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-310","dir":"Changelog","previous_headings":"","what":"forecast 3.10","title":"forecast 3.10","text":"CRAN release: 2011-10-27 Added lambda argument naive() snaive(). Fixed bug ets() high frequency data. Fixed bug rwf() incorrect fitted values residuals sometimes returned. Modified number lags displayed default tsdisplay().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-309","dir":"Changelog","previous_headings":"","what":"forecast 3.09","title":"forecast 3.09","text":"CRAN release: 2011-10-18 Fixed bug causing occasional problems simulate.Arima() MA order greater 2 future=TRUE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-308","dir":"Changelog","previous_headings":"","what":"forecast 3.08","title":"forecast 3.08","text":"CRAN release: 2011-10-15 Bug fix forecast.stl() occurred forecast horizon less seasonal period. Added lambda argument forecast.stl().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-307","dir":"Changelog","previous_headings":"","what":"forecast 3.07","title":"forecast 3.07","text":"CRAN release: 2011-10-11 Bug fix ets() concerning non-seasonal models high-frequency data. sometimes returned forecasts equal zero.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-306","dir":"Changelog","previous_headings":"","what":"forecast 3.06","title":"forecast 3.06","text":"CRAN release: 2011-10-04 Switched useDynLib preparation Rv2.14.0.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-305","dir":"Changelog","previous_headings":"","what":"forecast 3.05","title":"forecast 3.05","text":"CRAN release: 2011-10-03 Fixed bug ets() prevent non-seasonal models fitted high frequency data.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-304","dir":"Changelog","previous_headings":"","what":"forecast 3.04","title":"forecast 3.04","text":"CRAN release: 2011-09-23 Fixed bug drift xreg used together auto.arima() Arima().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-303","dir":"Changelog","previous_headings":"","what":"forecast 3.03","title":"forecast 3.03","text":"CRAN release: 2011-09-02 Bug fix dshw() using slightly incorrect seasonal estimates forecasts Bug fix forecast.StructTS due change structure StructTS object. Better error capture tslm seasonal dummies specified non-seasonal data. Re-formatted help files prevent viewing problems pdf manual.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-302","dir":"Changelog","previous_headings":"","what":"forecast 3.02","title":"forecast 3.02","text":"CRAN release: 2011-08-25 Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-300","dir":"Changelog","previous_headings":"","what":"forecast 3.00","title":"forecast 3.00","text":"CRAN release: 2011-08-24 Added Box-Cox parameter argument Arima(), ets(), arfima(), stlf(), rwf(), meanf(), splinef Added Box-Cox parameter argument forecast.Arima(), forecast.ets(), forecast.fracdiff(), forecast.ar(), forecast.StructTS, forecast.HoltWinters(). Removed lambda argument plot.forecast() accuracy(). Added BoxCox.lambda() function allow automatic choice Box-Cox parameter using Guerrero’s method profile log likelihood method. Modified BoxCox InvBoxCox return missing values lambda < 0 data < 0. Add nsdiffs() function selecting number seasonal differences. Modified selection seasonal differencing auto.arima(). Better error message seasonal factor used tslm() non-seasonal data. Added PI argument forecast.ets() allow point forecasts computed. Added include.constant argument Arima(). Added subset.ts() function. Upgraded seasonplot() function allow colors fix bugs. Fixed fitted values returned forecast.HoltWinters Modified simulate.Arima() undocumented changes filter() function stats package. Changed residuals returned splinef() ordinary residuals. standardized residuals now returned standardizedresiduals. Added dshw() function double-seasonal Holt-Winters method based Taylor (2003). Fixed bugs decompose() function caused results incorrect odd frequencies.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-219","dir":"Changelog","previous_headings":"","what":"forecast 2.19","title":"forecast 2.19","text":"CRAN release: 2011-06-04 Added xreg information object returned auto.arima(). Added Acf(), Pacf(), ma() CV() functions. Fixed bugs re-fitting ARIMA models new data.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-218-2011-05-19","dir":"Changelog","previous_headings":"","what":"forecast 2.18 (2011-05-19)","title":"forecast 2.18 (2011-05-19)","text":"Fixed bug seasonplot() year labels sometimes incorrect.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-217","dir":"Changelog","previous_headings":"","what":"forecast 2.17","title":"forecast 2.17","text":"CRAN release: 2011-04-06 Modified simulate.Arima() handle seasonal ARIMA models. Modified ets() handle missing values. largest continuous section data now modelled. Improved plot.forecast() handle missing values end observed series. Added replacement decompose() avoid truncation seasonal term seasonally adjusted series. Fixed bug seasadj() handle multiplicative decomposition, avoid missing values ends.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-216","dir":"Changelog","previous_headings":"","what":"forecast 2.16","title":"forecast 2.16","text":"CRAN release: 2011-03-07 Changed way missing values handled tslm","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-215","dir":"Changelog","previous_headings":"","what":"forecast 2.15","title":"forecast 2.15","text":"CRAN release: 2011-03-05 Added fourier(), fourierf(), tslm Improved forecast.lm() allow trend seasonal terms.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-214","dir":"Changelog","previous_headings":"","what":"forecast 2.14","title":"forecast 2.14","text":"CRAN release: 2011-03-04 Added forecast.lm Modified accuracy() print.forecast() allow non time series forecasts. Fixed visibility stlf().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-213","dir":"Changelog","previous_headings":"","what":"forecast 2.13","title":"forecast 2.13","text":"CRAN release: 2011-02-16 Fixed bug accuracy() 1 forecast specified. Added forecast.stl() stlf() functions Modified forecast.ts() use stlf() frequency > 12. Made BoxCox() InvBoxCox() robust negative values Fixed bug simulate.Arima() future=TRUE. bias sample paths.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-212","dir":"Changelog","previous_headings":"","what":"forecast 2.12","title":"forecast 2.12","text":"CRAN release: 2011-01-19 Added naive() snaive() functions. Improved handling seasonal data frequency < 1. Added lambda argument accuracy().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-211","dir":"Changelog","previous_headings":"","what":"forecast 2.11","title":"forecast 2.11","text":"CRAN release: 2010-11-04 MLE arfima() fails (usually series non-stationary), LS estimate now returned.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-210","dir":"Changelog","previous_headings":"","what":"forecast 2.10","title":"forecast 2.10","text":"Fixed bug arfima() MA parameters wrong sign estim=“mle” chosen. arfima() now allowed sequence missing values start series end series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-209","dir":"Changelog","previous_headings":"","what":"forecast 2.09","title":"forecast 2.09","text":"CRAN release: 2010-10-15 Fixed bug forecast.fracdiff() caused error h=1. Added shadebars plot.forecast(). Fixed bug plot.forecast() allow plotting h=1.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-208","dir":"Changelog","previous_headings":"","what":"forecast 2.08","title":"forecast 2.08","text":"CRAN release: 2010-09-22 Added pp test option auto.arima() ndiffs(). Fixed bug simulate.ets() causing problems forecasting ETS models including ETS(M,M,N).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-207","dir":"Changelog","previous_headings":"","what":"forecast 2.07","title":"forecast 2.07","text":"CRAN release: 2010-09-09 Fixed bug simulate.Arima(). Previous sample paths d=2 future=TRUE incorrect. Changed way color implemented plot.forecast() avoid colour changes graphics window refreshed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-206","dir":"Changelog","previous_headings":"","what":"forecast 2.06","title":"forecast 2.06","text":"CRAN release: 2010-07-29 Added MLE option arfima(). Added simulate.Arima(), simulate.ar() simulate.fracdiff","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-205","dir":"Changelog","previous_headings":"","what":"forecast 2.05","title":"forecast 2.05","text":"CRAN release: 2010-05-11 Added arfima() forecast method handle ARFIMA models arfima() fracdiff(). Added residuals fitted methods fracdiff objects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-204","dir":"Changelog","previous_headings":"","what":"forecast 2.04","title":"forecast 2.04","text":"CRAN release: 2010-04-16 Fixed bug auto.arima() occurred rarely.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-203","dir":"Changelog","previous_headings":"","what":"forecast 2.03","title":"forecast 2.03","text":"CRAN release: 2009-12-24 Added option auto.arima() allow drift terms excluded models considered.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-202","dir":"Changelog","previous_headings":"","what":"forecast 2.02","title":"forecast 2.02","text":"CRAN release: 2009-12-23 Fixed bug auto.arima() occurred xreg drift, approximation=TRUE stepwise=FALSE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-201","dir":"Changelog","previous_headings":"","what":"forecast 2.01","title":"forecast 2.01","text":"CRAN release: 2009-09-18 Fixed bug time index croston() output. Added explanation models croston() help file.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-200","dir":"Changelog","previous_headings":"","what":"forecast 2.00","title":"forecast 2.00","text":"CRAN release: 2009-09-07 Package removed forecasting bundle","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-126-29-august-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.26 (29 August 2009)","title":"forecast 1.26 (29 August 2009)","text":"Added .data.frame.forecast(). allows write.table() work forecast objects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-125-22-july-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.25 (22 July 2009)","title":"forecast 1.25 (22 July 2009)","text":"Added argument auto.arima() ndiffs() allow ADF test used instead KPSS test selecting number differences. Added argument plot.forecast() allow different colors line types plotting prediction intervals. Modified forecast.ts() give sensible results time series containing fewer four observations.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-124-9-april-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.24 (9 April 2009)","title":"forecast 1.24 (9 April 2009)","text":"Fixed bug dm.test() avoid errors missing values residuals. informative error messages auto.arima() fails find suitable model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-123-22-february-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.23 (22 February 2009)","title":"forecast 1.23 (22 February 2009)","text":"Fixed bugs meant xreg terms auto.arima() sometimes caused errors stepwise=FALSE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-122-30-january-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.22 (30 January 2009)","title":"forecast 1.22 (30 January 2009)","text":"Fixed bug meant regressor variables used seasonal time series auto.arima().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-121-16-december-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.21 (16 December 2008)","title":"forecast 1.21 (16 December 2008)","text":"Fixed bugs introduced v1.20.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-120-14-december-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.20 (14 December 2008)","title":"forecast 1.20 (14 December 2008)","text":"Updated auto.arima() allow regression variables. Fixed bug print.Arima() caused problems data inside data.frame. forecast.Arima(), argument h now set length xreg argument null.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-119-7-november-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.19 (7 November 2008)","title":"forecast 1.19 (7 November 2008)","text":"Updated Arima() allow regression variables refitting existing model new data.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-118-6-november-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.18 (6 November 2008)","title":"forecast 1.18 (6 November 2008)","text":"Bug fix ets(): models frequency less 1 cause R hang. Bug fix ets(): models frequency greater 12 fit due parameters range. Default lower upper bounds parameters , ets() changed 0.0001 0.9999 (instead 0.01 0.99).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-117-10-october-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.17 (10 October 2008)","title":"forecast 1.17 (10 October 2008)","text":"Calculation BIC account reduction length series due differencing. Now fixed auto.arima() print.Arima(). tsdiag() now works ets objects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-116-29-september-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.16 (29 September 2008)","title":"forecast 1.16 (29 September 2008)","text":"Another bug fix auto.arima(). Occasionally root checking cause error. condition now trapped.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-115-16-september-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.15 (16 September 2008)","title":"forecast 1.15 (16 September 2008)","text":"Bug fix auto.arima(). series wasn’t always stored part return object stepwise=FALSE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-114-1-august-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.14 (1 August 2008)","title":"forecast 1.14 (1 August 2008)","text":"time series stored M3 Mcomp package contain components listed help file. problem now fixed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-113-16-june-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.13 (16 June 2008)","title":"forecast 1.13 (16 June 2008)","text":"Bug plot.ets() fixed plots non-seasonal models seasonal data now work. Warning added ets() time series contains large numbers (can cause numerical problems). Anything 1,000,000 ok, larger best scale series first. Fixed problem forecast.HoltWinters() lower upper limits interchanged.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-112-22-april-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.12 (22 April 2008)","title":"forecast 1.12 (22 April 2008)","text":"Objects now coerced class ts ets(). allows work zoo objects. new function dm.test() added. implements Diebold-Mariano test predictive accuracy. Yet bug-fixes auto.arima().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-111-8-february-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.11 (8 February 2008)","title":"forecast 1.11 (8 February 2008)","text":"Modifications auto.arima() case ML estimation work chosen model. Previously return model. Now returns model estimated using CSS. AIC values reported auto.arima() trace=TRUE approximation=TRUE now comparable final AIC values. Addition expsmooth package.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-110-21-january-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.10 (21 January 2008)","title":"forecast 1.10 (21 January 2008)","text":"Fixed bug seasadj() allows multiple seasonality Fixed another bug print.Arima() Bug fixes auto.arima(). sometimes returning non-optimal model, occasionally model . Also, additional stationarity invertibility testing now done.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-109-11-december-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.09 (11 December 2007)","title":"forecast 1.09 (11 December 2007)","text":"new argument ‘restrict’ added ets() default TRUE. set FALSE, unstable ETS models also allowed. bug print.Arima() function fixed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-108-21-november-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.08 (21 November 2007)","title":"forecast 1.08 (21 November 2007)","text":"AICc BIC corrected. Previously taken account sigma^2 parameter computing number parameters. arima() function changed Arima() avoid clash arima() function stats package. auto.arima now uses approximation likelihood selecting model series 100 observations seasonal period greater 12. behaviour can -ridden via approximation argument. new function plot.ets() provides decomposition plot ETS model. predict() now alias forecast() wherever existing predict() method. argument conf changed level forecasting methods consistent R functions. functions gof() forecasterrors() replaced accuracy() handles -sample --sample forecast accuracy. initialization method used non-seasonal ETS model applied seasonal data changed slightly. following methods ets objects added: summary, coef logLik. following methods Arima objects added: summary.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-107-25-july-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.07 (25 July 2007)","title":"forecast 1.07 (25 July 2007)","text":"Bug fix summary -sample errors. ets models multiplicative errors, reported -sample values MSE, MAPE, MASE, etc., summary() gof() incorrect. ARIMA models frequency greater 49 now allowed. unit-root testing frequency 50 , careful! Improvements documentation.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-106-15-june-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.06 (15 June 2007)","title":"forecast 1.06 (15 June 2007)","text":"Bug fix auto.arima(). always respect stated values max.p, max.q, max.P max.Q. tseries package now installed automatically along forecasting bundle, whereas previously suggested.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-105-28-may-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.05 (28 May 2007)","title":"forecast 1.05 (28 May 2007)","text":"Introduced auto.arima() provide stepwise approach ARIMA modelling. much faster old best.arima(). old grid-search method used best.arima() still available using stepwise=FALSE calling auto.arima(). Automated choice seasonal differences introduced auto.arima(). small changes starting values ets() models. Fixed bug applying ets() new data using previously fitted model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-104-30-january-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.04 (30 January 2007)","title":"forecast 1.04 (30 January 2007)","text":"Added include.drift arima() Fixed bug seasonal forecasting ets()","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-103-20-october-2006","dir":"Changelog","previous_headings":"","what":"forecast 1.03 (20 October 2006)","title":"forecast 1.03 (20 October 2006)","text":"Fixed DOS line feed problems bothering unix users.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-102-12-october-2006","dir":"Changelog","previous_headings":"","what":"forecast 1.02 (12 October 2006)","title":"forecast 1.02 (12 October 2006)","text":"Added AICc option ets() best.arima(). Corrected bug calculation fitted values ets models multiplicative errors.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-101-25-september-2006","dir":"Changelog","previous_headings":"","what":"forecast 1.01 (25 September 2006)","title":"forecast 1.01 (25 September 2006)","text":"Modified ndiffs() maximum number differences allowed 2.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-10-31-august-2006","dir":"Changelog","previous_headings":"","what":"forecast 1.0 (31 August 2006)","title":"forecast 1.0 (31 August 2006)","text":"Added MASE gof(). croston() now returns fitted values residuals. arima() longer allows linear trend + ARMA errors default. Also, drift non-stationary models can turned . version first uploaded CRAN.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-099992-8-august-2006","dir":"Changelog","previous_headings":"","what":"forecast 0.99992 (8 August 2006)","title":"forecast 0.99992 (8 August 2006)","text":"Corrections help files. changes functionality.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-099991-2-august-2006","dir":"Changelog","previous_headings":"","what":"forecast 0.99991 (2 August 2006)","title":"forecast 0.99991 (2 August 2006)","text":"bug fixes. ets now converges good model often.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-09999-1-august-2006","dir":"Changelog","previous_headings":"","what":"forecast 0.9999 (1 August 2006)","title":"forecast 0.9999 (1 August 2006)","text":"Mostly bug fixes. data sets moved fma forecast used book. ets now considerably slower gives better results. Full optimization now option (slows ). many problems poor models partial optimization used. ’ll work speeding sometime, high priority. fast enough use. really need forecast 1000 series, run overnight. ets, ’ve experimented new starting conditions optimization seems fairly robust now. Multiplicative error models can longer applied series containing zeros negative values. However, forecasts models constrained positive.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0999-27-july-2006","dir":"Changelog","previous_headings":"","what":"forecast 0.999 (27 July 2006)","title":"forecast 0.999 (27 July 2006)","text":"package turned three packages forming bundle. functions datasets still forecast package. data Makridakis, Wheelwright Hyndman (1998) now fma package. M-competition data now Mcomp package. fma Mcomp automatically load forecast. first version available operating systems (just Windows). pegels replaced ets. ets fits model; doesn’t produce forecasts. get forecasts, apply forecast function ets object. ets completely rewritten makes slower, much easier maintain. Different boundary conditions used different optimizer used, don’t expect results identical done old pegels function. get something like results old pegels function, use forecast(ets()). simulate.ets() added simulate ets model. Changed name cars auto avoid clash cars data datasets package. arima2 functionality now handled arima() pegels2 functionality now handled ets. best.arima now allows option BIC used model selection. Croston’s method added function croston(). ts.display renamed tsdisplay mean.f changed meanf, theta.f changed thetaf, rw.f changed rwf, seasonaldummy.f seasonaldummyf, sindex.f sindexf, spline.f splinef. changes avoid potential problems anyone introduces ‘f’ class.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0994-4-october-2004","dir":"Changelog","previous_headings":"","what":"forecast 0.994 (4 October 2004)","title":"forecast 0.994 (4 October 2004)","text":"Fixed bug arima caused predict() sometimes fail xreg term. bug fixes handling regression terms arima models. New print.Arima function informative output.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0993-20-july-2004","dir":"Changelog","previous_headings":"","what":"forecast 0.993 (20 July 2004)","title":"forecast 0.993 (20 July 2004)","text":"Added forecast function structural time series models obtained using StructTS(). Changed default parameter space pegels() force admissibility. Added option pegels() allow restriction models finite forecast variance. restriction imposed default. Fixed bug arima.errors(). Changes made arima() meant arima.errors() often returning error message. Added namespace package making fewer functions visible user.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-099-21-may-2004","dir":"Changelog","previous_headings":"","what":"forecast 0.99 (21 May 2004)","title":"forecast 0.99 (21 May 2004)","text":"Added automatic selection order differencing best.arima. Added possibility linear trend arima models. pegels(), option added allow parameters exponential smoothing model ‘admissible’ (invertible) region rather within usual (0,1) region. Fixed bugs pegels. Included M1 M3 data functions subset plot . Note: package work R1.9 later.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-098-23-august-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.98 (23 August 2003)","title":"forecast 0.98 (23 August 2003)","text":"Added facilities pegels. o now possible specify particular values smoothing parameters rather always use optimized values. none specified, optimal values still estimated . o also possible specify upper lower bounds parameter separately. New function: theta.f. implements Theta method well M3 competition. minor problems pegels fixed bug forecast.plot meant didn’t work series contained missing values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0972-11-july-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.972 (11 July 2003)","title":"forecast 0.972 (11 July 2003)","text":"Small bug fix: pegels return correct model model partially specified.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0971-10-july-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.971 (10 July 2003)","title":"forecast 0.971 (10 July 2003)","text":"Minor fixes make sure package work R v1.6.x. changes functionality.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-097-9-july-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.97 (9 July 2003)","title":"forecast 0.97 (9 July 2003)","text":"Fully automatic forecasting based state space approach exponential smoothing now added. technical details, see Hyndman, Koehler, Snyder Grose (2002). Local linear forecasting using cubic smoothing splines added. technical details, see Hyndman, King, Pitrun Billah (2002).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-096-15-may-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.96 (15 May 2003)","title":"forecast 0.96 (15 May 2003)","text":"Many functions rewritten make use methods classes. Consequently several functions names changed many arguments altered. Please see help files details. Added functions forecast.Arima forecat.ar Added functions gof seasadj Fixed bug plot.forecast. starting date plot sometimes incorrect. Added residuals components rw.f mean.f. Made several changes ensure compatibility Rv1.7.0. Removed work-around fix bug monthplot command present R v<=1.6.2. Fixed motel data set (columns swapped)","code":""}] +[{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Automatic forecasts large numbers univariate time series often needed business. common one thousand product lines need forecasting least monthly. Even smaller number forecasts required, may nobody suitably trained use time series models produce . circumstances, automatic forecasting algorithm essential tool. Automatic forecasting algorithms must determine appropriate time series model, estimate parameters compute forecasts. must robust unusual time series patterns, applicable large numbers series without user intervention. popular automatic forecasting algorithms based either exponential smoothing ARIMA models. article, discuss implementation two automatic univariate forecasting methods package . also briefly describe univariate forecasting methods part package. package system statistical computing ( Development Core Team 2008) available Comprehensive Archive Network . Version 8.22.0 package used paper. package contains functions univariate forecasting examples real time series data. extensive testing forecasting methods, package contains 90 data sets Spyros Makridakis, Wheelwright, Hyndman (1998), package contains 24 data sets Hyndman et al. (2008), package contains 1001 time series M-competition (S. Makridakis et al. 1982) 3003 time series M3-competition (Spyros Makridakis Hibon 2000). package implements automatic forecasting using exponential smoothing, ARIMA models, Theta method (Assimakopoulos Nikolopoulos 2000), cubic splines (Hyndman, King, et al. 2005), well common forecasting methods. article, primarily discuss exponential smoothing approach (Section \\(\\ref{sec:expsmooth}\\)) ARIMA modelling approach (Section \\(\\ref{sec:arima}\\)) automatic forecasting. Section \\(\\ref{sec:package}\\), describe implementation methods package, along features package.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:expsmooth","dir":"Articles","previous_headings":"","what":"Exponential smoothing","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Although exponential smoothing methods around since 1950s, modelling framework incorporating procedures model selection developed relatively recently. J. K. Ord, Koehler, Snyder (1997), Hyndman et al. (2002) Hyndman, Koehler, et al. (2005) shown exponential smoothing methods (including non-linear methods) optimal forecasts innovations state space models. Exponential smoothing methods originally classified Pegels’ (1969) taxonomy. later extended Gardner (1985), modified Hyndman et al. (2002), extended Taylor (2003), giving total fifteen methods seen following table. methods better known names. example, cell (N,N) describes simple exponential smoothing (SES) method, cell (,N) describes Holt’s linear method, cell (,N) describes damped trend method. additive Holt-Winters’ method given cell (,) multiplicative Holt-Winters’ method given cell (,M). cells correspond less commonly used analogous methods.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"point-forecasts-for-all-methods","dir":"Articles","previous_headings":"Exponential smoothing","what":"Point forecasts for all methods","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"denote observed time series \\(y_1,y_2,\\dots,y_n\\). forecast \\(y_{t+h}\\) based data time \\(t\\) denoted \\(\\hat{y}_{t+h|t}\\). illustrate method, give point forecasts updating equations method (,), Holt-Winters’ additive method: \\(m\\) length seasonality (e.g., number months quarters year), \\(\\ell_t\\) represents level series, \\(b_t\\) denotes growth, \\(s_t\\) seasonal component, \\(\\hat{y}_{t+h|t}\\) forecast \\(h\\) periods ahead, \\(h_m^+ = \\big[(h-1) \\mbox{ mod } m\\big] + 1\\). use method \\(\\eqref{eq:AMmethod}\\), need values initial states \\(\\ell_0\\), \\(b_0\\) \\(s_{1-m},\\dots,s_0\\), smoothing parameters \\(\\alpha\\), \\(\\beta^*\\) \\(\\gamma\\). estimated observed data. Equation \\(\\eqref{eq:3-46a}\\) slightly different usual Holt-Winters equations Spyros Makridakis, Wheelwright, Hyndman (1998) Bowerman, O’Connell, Koehler (2005). authors replace \\(\\eqref{eq:3-46a}\\) \\[ s_t = \\gamma^*(y_t - \\ell_{t}) + (1-\\gamma^*)s_{t-m}. \\] \\(\\ell_t\\) substituted using \\(\\eqref{eq:3-44a}\\), obtain \\[s_t = \\gamma^*(1-\\alpha)(y_t - \\ell_{t-1}-b_{t-1}) + \\{1-\\gamma^*(1-\\alpha)\\}s_{t-m}. \\] Thus, obtain identical forecasts using approach replacing \\(\\gamma\\) \\(\\eqref{eq:3-46a}\\) \\(\\gamma^*(1-\\alpha)\\). modification given \\(\\eqref{eq:3-46a}\\) proposed J. K. Ord, Koehler, Snyder (1997) make state space formulation simpler. equivalent Archibald’s (1990) variation Holt-Winters’ method. Table \\(\\ref{table:pegels}\\) gives recursive formulae computing point forecasts \\(h\\) periods ahead exponential smoothing methods. interesting special cases can obtained setting smoothing parameters extreme values. example, \\(\\alpha=0\\), level constant time; \\(\\beta^*=0\\), slope constant time; \\(\\gamma=0\\), seasonal pattern constant time. extreme, naïve forecasts (.e., \\(\\hat{y}_{t+h|t}=y_t\\) \\(h\\)) obtained using (N,N) method \\(\\alpha=1\\). Finally, additive multiplicative trend methods special cases damped counterparts obtained letting \\(\\phi=1\\).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:statespace","dir":"Articles","previous_headings":"Exponential smoothing","what":"Innovations state space models","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"exponential smoothing method Table \\(\\ref{table:pegels}\\), Hyndman et al. (2008) describe two possible innovations state space models, one corresponding model additive errors model multiplicative errors. parameter values used, two models give equivalent point forecasts, although different prediction intervals. Thus 30 potential models described classification. Historically, nature error component often ignored, distinction additive multiplicative errors makes difference point forecasts. careful distinguish exponential smoothing underlying state space . exponential smoothing method algorithm producing point forecasts . underlying stochastic state space model gives point forecasts, also provides framework computing prediction intervals properties. distinguish models additive multiplicative errors, add extra letter front method notation. triplet (E,T,S) refers three components: error, trend seasonality. model ETS(,,N) additive errors, additive trend seasonality—words, Holt’s linear method additive errors. Similarly, ETS(M,M,M) refers model multiplicative errors, damped multiplicative trend multiplicative seasonality. notation ETS(\\(\\cdot\\),\\(\\cdot\\),\\(\\cdot\\)) helps remembering order components specified. model specified, can study probability distribution future values series find, example, conditional mean future observation given knowledge past. denote \\(\\mu_{t+h|t} = \\E(y_{t+h} \\mid \\bm{x}_t)\\), \\(\\bm{x}_t\\) contains unobserved components \\(\\ell_t\\), \\(b_t\\) \\(s_t\\). \\(h=1\\) use \\(\\mu_t\\equiv\\mu_{t+1|t}\\) shorthand notation. many models, conditional means identical point forecasts given Table \\(\\ref{table:pegels}\\), \\(\\mu_{t+h|t}=\\hat{y}_{t+h|t}\\). However, models (multiplicative trend multiplicative seasonality), conditional mean point forecast differ slightly \\(h\\ge 2\\). illustrate ideas using damped trend method Gardner McKenzie (1985). Let \\(\\mu_t = \\hat{y}_t = \\ell_{t-1}+b_{t-1}\\) denote one-step forecast \\(y_{t}\\) assuming know values parameters. Also, let \\(\\varepsilon_t = y_t - \\mu_t\\) denote one-step forecast error time \\(t\\). equations Table \\(\\ref{table:pegels}\\), find \\[\\begin{align} \\label{ss1} y_t &= \\ell_{t-1} + \\phi b_{t-1} + \\varepsilon_t\\\\ \\ell_t &= \\ell_{t-1} + \\phi b_{t-1} + \\alpha \\varepsilon_t \\label{ss2}\\\\ b_t &= \\phi b_{t-1} + \\beta^*(\\ell_t - \\ell_{t-1}- \\phi b_{t-1}) = \\phi b_{t-1} + \\alpha\\beta^*\\varepsilon_t. \\label{ss3} \\end{align}\\] simplify last expression setting \\(\\beta=\\alpha\\beta^*\\). three equations constitute state space model underlying damped Holt’s method. Note state space model (Anderson Moore 1979; Aoki 1987) error term appears equation. write standard state space notation defining state vector \\(\\bm{x}_t = (\\ell_t,b_t)'\\) expressing \\(\\eqref{ss1}\\)–\\(\\eqref{ss3}\\) model fully specified state distribution error term \\(\\varepsilon_t\\). Usually assume independent identically distributed, following normal distribution mean 0 variance \\(\\sigma^2\\), write \\(\\varepsilon_t \\sim\\mbox{NID}(0, \\sigma^2)\\). model multiplicative error can derived similarly, first setting \\(\\varepsilon_t = (y_t-\\mu_t)/\\mu_t\\), \\(\\varepsilon_t\\) relative error. , following similar approach additive errors, find \\[\\begin{align*} y_t &= (\\ell_{t-1} + \\phi b_{t-1})(1 + \\varepsilon_t)\\\\ \\ell_t &= (\\ell_{t-1} + \\phi b_{t-1})(1 + \\alpha \\varepsilon_t)\\\\ b_t &= \\phi b_{t-1} + \\beta(\\ell_{t-1}+\\phi b_{t-1})\\varepsilon_t, \\end{align*}\\] \\[\\begin{align*} y_t &= \\left[ 1 \\phi \\right] \\bm{x}_{t-1}(1 + \\varepsilon_t)\\\\ \\bm{x}_t &= \\left[\\begin{array}{ll} 1 & \\phi \\\\ 0 & \\phi \\end{array}\\right]\\bm{x}_{t-1} + \\left[ 1 \\phi \\right] \\bm{x}_{t-1} \\left[\\begin{array}{l} \\alpha\\\\ \\beta \\end{array}\\right]\\varepsilon_t. \\end{align*}\\] assume \\(\\varepsilon_t \\sim \\mbox{NID}(0,\\sigma^2)\\). course, nonlinear state space model, usually considered difficult handle estimating forecasting. However, one many advantages innovations form state space models — can still compute forecasts, likelihood prediction intervals nonlinear model effort required additive error model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:ssmodels","dir":"Articles","previous_headings":"Exponential smoothing","what":"State space models for all exponential smoothing methods","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"similar state space models 30 exponential smoothing variations. general model involves state vector \\(\\bm{x}_t = (\\ell_t, b_t\\), \\(s_t, s_{t-1}, \\dots, s_{t-m+1})'\\) state space equations form \\(\\{\\varepsilon_t\\}\\) Gaussian white noise process mean zero variance \\(\\sigma^2\\), \\(\\mu_t = w(\\bm{x}_{t-1})\\). model additive errors \\(r(\\bm{x}_{t-1})=1\\), \\(y_t = \\mu_{t} + \\varepsilon_t\\). model multiplicative errors \\(r(\\bm{x}_{t-1})=\\mu_t\\), \\(y_t = \\mu_{t}(1 + \\varepsilon_t)\\). Thus, \\(\\varepsilon_t = (y_t - \\mu_t)/\\mu_t\\) relative error multiplicative model. models unique. Clearly, value \\(r(\\bm{x}_{t-1})\\) lead identical point forecasts \\(y_t\\). methods Table \\(\\ref{table:pegels}\\) can written form \\(\\eqref{eq:ss1}\\) \\(\\eqref{eq:ss2}\\). specific form model given Hyndman et al. (2008). combinations trend, seasonality error can occasionally lead numerical difficulties; specifically, model equation requires division state component involve division zero. problem models additive errors either multiplicative trend multiplicative seasonality, well model multiplicative errors, multiplicative trend additive seasonality. models therefore used caution. multiplicative error models useful data strictly positive, numerically stable data contain zeros negative values. time series strictly positive, six fully additive models may applied. point forecasts given Table \\(\\ref{table:pegels}\\) easily obtained models iterating equations \\(\\eqref{eq:ss1}\\) \\(\\eqref{eq:ss2}\\) \\(t=n+1, n+2,\\dots,n+h\\), setting \\(\\varepsilon_{n+j}=0\\) \\(j=1,\\dots,h\\). cases (notable exceptions models multiplicative seasonality multiplicative trend \\(h\\ge2\\)), point forecasts can shown equal \\(\\mu_{t+h|t} = \\E(y_{t+h} \\mid \\bm{x}_t)\\), conditional expectation corresponding state space model. models also provide means obtaining prediction intervals. case linear models, forecast distributions normal, can derive conditional variance \\(v_{t+h|t} = \\VAR (y_{t+h} \\mid \\bm{x}_t)\\) obtain prediction intervals accordingly. approach also works many nonlinear models. Detailed derivations results many models given Hyndman, Koehler, et al. (2005). direct approach works models simply simulate many future sample paths conditional last estimate state vector, \\(\\bm{x}_t\\). prediction intervals can obtained percentiles simulated sample paths. Point forecasts can also obtained way taking average simulated values future time period. advantage approach generate estimate complete predictive distribution, especially useful applications inventory planning, expected costs depend whole distribution.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:estimation","dir":"Articles","previous_headings":"Exponential smoothing","what":"Estimation","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"order use models forecasting, need know values \\(\\bm{x}_0\\) parameters \\(\\alpha\\), \\(\\beta\\), \\(\\gamma\\) \\(\\phi\\). easy compute likelihood innovations state space model \\(\\eqref{eq:ss}\\), obtain maximum likelihood estimates. J. K. Ord, Koehler, Snyder (1997) show \\[\\begin{equation}\\label{likelihood} L^*(\\bm\\theta,\\bm{x}_0) = n\\log\\Big(\\sum_{t=1}^n \\varepsilon^2_t\\Big) + 2\\sum_{t=1}^n \\log|r(\\bm{x}_{t-1})| \\end{equation}\\] equal twice negative logarithm likelihood function (constant terms eliminated), conditional parameters \\(\\bm\\theta = (\\alpha,\\beta,\\gamma,\\phi)'\\) initial states \\(\\bm{x}_0 = (\\ell_0,b_0,s_0,s_{-1},\\dots,s_{-m+1})'\\), \\(n\\) number observations. easily computed simply using recursive equations Table \\(\\ref{table:pegels}\\). Unlike state space models multiple sources error, need use Kalman filter compute likelihood. parameters \\(\\bm\\theta\\) initial states \\(\\bm{x}_0\\) can estimated minimizing \\(L^*\\). implementations exponential smoothing use ad hoc heuristic scheme estimate \\(\\bm{x}_0\\). However, modern computers, reason estimate \\(\\bm{x}_0\\) along \\(\\bm\\theta\\), resulting forecasts often substantially better . constrain initial states \\(\\bm{x}_0\\) seasonal indices add zero additive seasonality, add \\(m\\) multiplicative seasonality. several suggestions restricting parameter space \\(\\alpha\\), \\(\\beta\\) \\(\\gamma\\). traditional approach ensure various equations can interpreted weighted averages, thus requiring \\(\\alpha\\), \\(\\beta^*=\\beta/\\alpha\\), \\(\\gamma^*=\\gamma/(1-\\alpha)\\) \\(\\phi\\) lie within \\((0,1)\\). suggests \\[0<\\alpha<1,\\qquad 0<\\beta<\\alpha,\\qquad 0<\\gamma < 1-\\alpha,\\qquad\\mbox{}\\qquad 0<\\phi<1. \\] However, Hyndman, Akram, Archibald (2008) show restrictions usually stricter necessary (although cases restrictive enough).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"model-selection","dir":"Articles","previous_headings":"Exponential smoothing","what":"Model selection","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Forecast accuracy measures mean squared error (MSE) can used selecting model given set data, provided errors computed data hold-set data used model estimation. However, often --sample errors draw reliable conclusions. Consequently, penalized method based -sample fit usually better. One approach uses penalized likelihood Akaike’s Information Criterion: \\[\\mbox{AIC} = L^*(\\hat{\\bm\\theta},\\hat{\\bm{x}}_0) + 2q, \\] \\(q\\) number parameters \\(\\bm\\theta\\) plus number free states \\(\\bm{x}_0\\), \\(\\hat{\\bm\\theta}\\) \\(\\hat{\\bm{x}}_0\\) denote estimates \\(\\bm\\theta\\) \\(\\bm{x}_0\\). select model minimizes AIC amongst models appropriate data. AIC also provides method selecting additive multiplicative error models. point forecasts two models identical standard forecast accuracy measures MSE mean absolute percentage error (MAPE) unable select error types. AIC able select error types based likelihood rather one-step forecasts. Obviously, model selection criteria (BIC) also used similar manner.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:algorithm","dir":"Articles","previous_headings":"Exponential smoothing","what":"Automatic forecasting","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Hyndman et al. (2002) applied automatic forecasting strategy M-competition data (S. Makridakis et al. 1982) IJF-M3 competition data (Spyros Makridakis Hibon 2000) using restricted set exponential smoothing models, demonstrated methodology particularly good short term forecasts (6 periods ahead), especially seasonal short-term series (beating methods competitions series).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:arima","dir":"Articles","previous_headings":"","what":"ARIMA models","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"common obstacle many people using Autoregressive Integrated Moving Average (ARIMA) models forecasting order selection process usually considered subjective difficult apply. . several attempts automate ARIMA modelling last 25 years. Hannan Rissanen (1982) proposed method identify order ARMA model stationary series. method innovations can obtained fitting long autoregressive model data, likelihood potential models computed via series standard regressions. established asymptotic properties procedure general conditions. Gómez (1998) extended Hannan-Rissanen identification method include multiplicative seasonal ARIMA model identification. Gómez Maravall (1998) implemented automatic identification procedure software . given series, algorithm attempts find model minimum BIC. Liu (1989) proposed method identification seasonal ARIMA models using filtering method certain heuristic rules; algorithm used software. Another approach described Mélard Pasteels (2000) whose algorithm univariate ARIMA models also allows intervention analysis. implemented software package ``Time Series Expert’’ (). algorithms use commercial software, although documented public domain literature. particular, (Goodrich 2000) well-known excellent automatic ARIMA algorithm used M3-forecasting competition (Spyros Makridakis Hibon 2000). Another proprietary algorithm implemented (Reilly 2000). K. Ord Lowe (1996) provide early review commercial software implement automatic ARIMA forecasting.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"choosing-the-model-order-using-unit-root-tests-and-the-aic","dir":"Articles","previous_headings":"ARIMA models","what":"Choosing the model order using unit root tests and the AIC","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"non-seasonal ARIMA(\\(p,d,q\\)) process given \\[ \\phi(B)(1-B^d)y_{t} = c + \\theta(B)\\varepsilon_t \\] \\(\\{\\varepsilon_t\\}\\) white noise process mean zero variance \\(\\sigma^2\\), \\(B\\) backshift operator, \\(\\phi(z)\\) \\(\\theta(z)\\) polynomials order \\(p\\) \\(q\\) respectively. ensure causality invertibility, assumed \\(\\phi(z)\\) \\(\\theta(z)\\) roots \\(|z|<1\\) (Brockwell Davis 1991). \\(c\\ne0\\), implied polynomial order \\(d\\) forecast function. seasonal ARIMA\\((p,d,q)(P,D,Q)_m\\) process given \\[ \\Phi(B^m)\\phi(B)(1-B^{m})^D(1-B)^dy_{t} = c + \\Theta(B^m)\\theta(B)\\varepsilon_t \\] \\(\\Phi(z)\\) \\(\\Theta(z)\\) polynomials orders \\(P\\) \\(Q\\) respectively, containing roots inside unit circle. \\(c\\ne0\\), implied polynomial order \\(d+D\\) forecast function. main task automatic ARIMA forecasting selecting appropriate model order, values \\(p\\), \\(q\\), \\(P\\), \\(Q\\), \\(D\\), \\(d\\). \\(d\\) \\(D\\) known, can select orders \\(p\\), \\(q\\), \\(P\\) \\(Q\\) via information criterion AIC: \\[\\mbox{AIC} = -2\\log(L) + 2(p+q+P+Q+k)\\] \\(k=1\\) \\(c\\ne0\\) 0 otherwise, \\(L\\) maximized likelihood model fitted data \\((1-B^m)^D(1-B)^dy_t\\). likelihood full model \\(y_t\\) actually defined value AIC different levels differencing comparable. One solution difficulty ``diffuse prior’’ approach outlined Durbin Koopman (2001) implemented function (Ripley 2002) . approach, initial values time series (observed values) assumed mean zero large variance. However, choosing \\(d\\) \\(D\\) minimizing AIC using approach tends lead -differencing. forecasting purposes, believe better make differences possible -differencing harms forecasts (Smith Yadav 1994) widens prediction intervals. (Although, see Hendry 1997 contrary view.) Consequently, need approach choose \\(d\\) \\(D\\). prefer unit-root tests. However, unit-root tests based null hypothesis unit root exists biases results towards differences rather fewer differences. example, variations Dickey-Fuller test (Dickey Fuller 1981) assume unit root lag 1, HEGY test Hylleberg et al. (1990) based null hypothesis seasonal unit root. Instead, prefer unit-root tests based null hypothesis unit-root. non-seasonal data, consider ARIMA(\\(p,d,q\\)) models \\(d\\) selected based successive KPSS unit-root tests (Kwiatkowski et al. 1992). , test data unit root; test result significant, test differenced data unit root; . stop procedure obtain first insignificant result. seasonal data, consider ARIMA\\((p,d,q)(P,D,Q)_m\\) models \\(m\\) seasonal frequency \\(D=0\\) \\(D=1\\) depending extended Canova-Hansen test (Canova Hansen 1995). Canova Hansen provide critical values \\(21\\). Let \\(C_m\\) critical value seasonal period \\(m\\). plotted \\(C_m\\) \\(m\\) values \\(m\\) 365 noted fit line \\(C_m = 0.269 m^{0.928}\\) almost exactly. \\(m>12\\), use simple expression obtain critical value. note passing null hypothesis Canova-Hansen test ARIMA model includes seasonal dummy terms. test whether seasonal pattern changes sufficiently time warrant seasonal unit root, whether stable seasonal pattern modelled using fixed dummy variables appropriate. Nevertheless, found test still useful choosing \\(D\\) strictly ARIMA framework (.e., without seasonal dummy variables). stable seasonal pattern selected (.e., null hypothesis rejected), seasonality effectively handled stationary seasonal AR MA terms. \\(D\\) selected, choose \\(d\\) applying successive KPSS unit-root tests seasonally differenced data (\\(D=1\\)) original data (\\(D=0\\)). \\(d\\) (possibly \\(D\\)) selected, proceed select values \\(p\\), \\(q\\), \\(P\\) \\(Q\\) minimizing AIC. allow \\(c\\ne0\\) models \\(d+D < 2\\).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"a-step-wise-procedure-for-traversing-the-model-space","dir":"Articles","previous_headings":"ARIMA models","what":"A step-wise procedure for traversing the model space","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Suppose seasonal data consider ARIMA\\((p,d,q)(P,D,Q)_m\\) models \\(p\\) \\(q\\) can take values 0 3, \\(P\\) \\(Q\\) can take values 0 1. \\(c=0\\) total 288 possible models, \\(c\\ne 0\\) total 192 possible models, giving 480 models altogether. values \\(p\\), \\(d\\), \\(q\\), \\(P\\), \\(D\\) \\(Q\\) allowed range widely, number possible models increases rapidly. Consequently, often feasible simply fit every potential model choose one lowest AIC. Instead, need way traversing space models efficiently order arrive model lowest AIC value. algorithm guaranteed return valid model model space finite least one starting models accepted (model AR MA parameters). selected model used produce forecasts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"comparisons-with-exponential-smoothing","dir":"Articles","previous_headings":"ARIMA models","what":"Comparisons with exponential smoothing","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"widespread myth ARIMA models general exponential smoothing. true. two classes models overlap. linear exponential smoothing models special cases ARIMA models—equivalences discussed Hyndman, Akram, Archibald (2008). However, non-linear exponential smoothing models equivalent ARIMA counterpart. hand, many ARIMA models exponential smoothing counterpart. Thus, two model classes overlap complimentary; strengths weaknesses. exponential smoothing state space models non-stationary. Models seasonality non-damped trend () two unit roots; models—, non-seasonal models either trend damped trend—one unit root. possible define stationary model similar characteristics exponential smoothing, normally done. philosophy exponential smoothing world non-stationary. stationary model required, ARIMA models better. One advantage exponential smoothing models can non-linear. time series exhibit non-linear characteristics including heteroscedasticity may better modelled using exponential smoothing state space models. seasonal data, many ARIMA models 30 possible models exponential smoothing class Section \\(\\ref{sec:expsmooth}\\). may thought larger model class advantageous. However, results Hyndman et al. (2002) show exponential smoothing models performed better ARIMA models seasonal M3 competition data. (annual M3 data, ARIMA models performed better.) discussion results, Hyndman (2001) speculates larger model space ARIMA models actually harms forecasting performance introduces additional uncertainty. smaller exponential smoothing class sufficiently rich capture dynamics almost real business economic time series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:package","dir":"Articles","previous_headings":"","what":"The forecast package","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Four time series showing point forecasts 80% & 95% prediction intervals obtained using exponential smoothing state space models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"implementation-of-the-automatic-exponential-smoothing-algorithm","dir":"Articles","previous_headings":"The forecast package","what":"Implementation of the automatic exponential smoothing algorithm","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Although lot computation involved, can handled remarkably quickly modern computers. forecasts shown Figure \\(\\ref{fig:etsexamples}\\) took seconds standard PC. US electricity generation series took longest analytical prediction intervals available ETS(M,M,N) model. Consequently, prediction intervals series computed using simulation 5000 future sample paths. apply algorithm US net electricity generation time series , use following command. object class ``’’ contains necessary information fitted model including model parameters, value state vector \\(\\bm{x}_t\\) \\(t\\), residuals . Printing object shows main items interest. goodness--fit measures (defined Hyndman Koehler 2006) obtained using . also , , , , methods objects class ``’’. function shows time plots original time series along extracted components (level, growth seasonal). function computes required forecasts plotted Figure \\(\\ref{fig:etsexamples}\\)(b). Printing object gives table showing prediction intervals. function also provides useful feature applying fitted model new data set. example, withhold 10 observations data set fitting, compute one-step forecast errors --sample data. can also look measures forecast accuracy forecasts based fitting data.","code":"etsfit <- ets(usnetelec) etsfit ## ETS(M,A,N) ## ## Call: ## ets(y = usnetelec) ## ## Smoothing parameters: ## alpha = 0.9999 ## beta = 0.2191 ## ## Initial states: ## l = 254.9338 ## b = 38.3125 ## ## sigma: 0.0259 ## ## AIC AICc BIC ## 634.0437 635.2682 644.0803 accuracy(etsfit) ## ME RMSE MAE MPE MAPE MASE ## Training set 1.162583 52.00363 36.77721 0.2629582 1.942062 0.5211014 ## ACF1 ## Training set 0.006113498 fcast ## Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 ## 2004 3900.329 3770.801 4029.857 3702.233 4098.425 ## 2005 3952.650 3747.279 4158.022 3638.562 4266.738 ## 2006 4004.972 3725.589 4284.355 3577.692 4432.251 ## 2007 4057.293 3701.885 4412.701 3513.743 4600.842 ## 2008 4109.614 3674.968 4544.259 3444.881 4774.347 ## 2009 4161.935 3644.367 4679.503 3370.383 4953.487 ## 2010 4214.256 3609.881 4818.632 3289.944 5138.569 ## 2011 4266.577 3571.428 4961.726 3203.439 5329.716 ## 2012 4318.898 3528.985 5108.812 3110.830 5526.967 ## 2013 4371.220 3482.552 5259.888 3012.119 5730.320 fit <- ets(usnetelec[1:45]) test <- ets(usnetelec[46:55], model = fit) accuracy(test) accuracy(forecast(fit,10), usnetelec[46:55])"},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"the-holtwinters-function","dir":"Articles","previous_headings":"The forecast package","what":"The HoltWinters() function","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"another implementation exponential smoothing  via function (Meyer 2002) package. implements (N,N), (,N), (,) (,M) methods. initial states \\(\\bm{x}_0\\) fixed using heuristic algorithm. way initial states estimated, full three years seasonal data required implement seasonal forecasts using . (See Hyndman Kostenko (2007) minimal sample size required.) smoothing parameters optimized minimizing average squared prediction errors, equivalent minimizing \\(\\eqref{likelihood}\\) case additive errors. method resulting object can produce point forecasts prediction intervals. Although nowhere documented, appears prediction intervals produced object class based equivalent ARIMA model case (N,N), (,N) (,) methods, assuming additive errors. prediction intervals equivalent prediction intervals arise (,N,N), (,,N) (,,) state space models. (,M) method, prediction interval provided appears based Chatfield Yar (1991) approximation true prediction interval arising (,,M) model. Prediction intervals multiplicative errors possible using function.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"implementation-of-the-automatic-arima-algorithm","dir":"Articles","previous_headings":"The forecast package","what":"Implementation of the automatic ARIMA algorithm","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"Four time series showing point forecasts 80% & 95% prediction intervals obtained using ARIMA models. algorithm Section \\(\\ref{sec:arima}\\) applied four time series. Unlike exponential smoothing algorithm, ARIMA class models assumes homoscedasticity, always appropriate. Consequently, transformations sometimes necessary. four time series, model raw data series ()–(c), logged data series (d). prediction intervals back-transformed point forecasts preserve probability coverage. apply algorithm US net electricity generation time series , use following commands. Note  parameterization \\(\\theta(B) = (1 + \\theta_1B + \\dots + \\theta_qB)\\) \\(\\phi(B) = (1 - \\phi_1B + \\dots - \\phi_qB)\\), similarly seasonal terms. summary forecasts available, part shown . training set error measures two models similar. Note information criteria comparable. package also contains function largely wrapper function package. function package makes easier include drift term \\(d+D=1\\). (Setting function package work \\(d+D=0\\).) also provides facility fitting existing ARIMA model new data set (demonstrated function earlier). One-step forecasts ARIMA models now available via function. also provide new function returns original time series adjusting regression variables. regression variables ARIMA model, errors identical original series. regression variables ARIMA model, errors equal original series minus effect regression variables, leaving serial correlation modelled AR MA terms. contrast, provides true residuals, removing AR MA terms well. generic functions , , apply models obtained either functions.","code":"arimafit <- auto.arima(usnetelec) fcast <- forecast(arimafit) plot(fcast) Forecast method: ARIMA(2,1,2) with drift Series: usnetelec Coefficients: ar1 ar2 ma1 ma2 drift -1.3032 -0.4332 1.5284 0.8340 66.1585 s.e. 0.2122 0.2084 0.1417 0.1185 7.5595 sigma^2 estimated as 2262: log likelihood=-283.34 AIC=578.67 AICc=580.46 BIC=590.61 Error measures: ME RMSE MAE MPE MAPE MASE ACF1 Training set 0.046402 44.894 32.333 -0.61771 2.1012 0.45813 0.022492 Forecasts: Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 2004 3968.957 3908.002 4029.912 3875.734 4062.180 2005 3970.350 3873.950 4066.751 3822.919 4117.782 2006 4097.171 3971.114 4223.228 3904.383 4289.959 2007 4112.332 3969.691 4254.973 3894.182 4330.482 2008 4218.671 4053.751 4383.591 3966.448 4470.894 2009 4254.559 4076.108 4433.010 3981.641 4527.476 2010 4342.760 4147.088 4538.431 4043.505 4642.014 2011 4393.306 4185.211 4601.401 4075.052 4711.560 2012 4470.261 4248.068 4692.455 4130.446 4810.077 2013 4529.113 4295.305 4762.920 4171.535 4886.690"},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"the-forecast-function","dir":"Articles","previous_headings":"The forecast package","what":"The forecast() function","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"function generic S3 methods wide range time series models. computes point forecasts prediction intervals time series model. Methods exist models fitted using , , , , , . also method object. time series object passed first argument , function produce forecasts based exponential smoothing algorithm Section \\(\\ref{sec:expsmooth}\\). cases, existing function intended much thing. Unfortunately, resulting objects function contain different information case possible build generic functions () results. , instead, acts wrapper , packages information obtained common format (class). also define default method used existing function exists, calls relevant function. Thus, methods parallel methods, latter provide consistent output usable. , methods ``’’ class. Figures \\(\\ref{fig:etsexamples}\\) \\(\\ref{fig:arimaexamples}\\) produced using method. prediction intervals , default, computed 80% 95% coverage, although values possible requested. Fan charts (Wallis 1999) possible using combination .","code":""},{"path":"https://pkg.robjhyndman.com/forecast/articles/JSS2008.html","id":"sec:other","dir":"Articles","previous_headings":"The forecast package","what":"Other functions","title":"Automatic Time Series Forecasting:\\newline the \\pkg{forecast} Package for \\proglang{R},Automatic Time Series Forecasting: the forecast Package for R,\\pkg{forecast}: Automatic Time Series Forecasting","text":"now briefly describe features package. following functions produces object class ``’’. : implements method Croston (1972) intermittent demand forecasting. method, time series decomposed two separate sequences: non-zero values time intervals non-zero values. independently forecast using simple exponential smoothing forecasts original series obtained ratios two sets forecasts. prediction intervals provided underlying stochastic model (Shenstone Hyndman 2005). : provides forecasts Theta method (Assimakopoulos Nikolopoulos 2000). Hyndman Billah (2003) showed equivalent special case simple exponential smoothing drift. : gives cubic-spline forecasts, based fitting cubic spline historical data extrapolating linearly. details method, associated prediction intervals, discussed Hyndman, King, et al. (2005). : returns forecasts based historical mean. : gives ``naïve’’ forecasts equal recent observation assuming random walk model. function also allows forecasting using random walk drift. addition, new plotting functions time series. : provides time plot along ACF PACF. : produces seasonal plot described Spyros Makridakis, Wheelwright, Hyndman (1998).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Rob Hyndman. Author, maintainer, copyright holder. George Athanasopoulos. Author. Christoph Bergmeir. Author. Gabriel Caceres. Author. Leanne Chhay. Author. Kirill Kuroptev. Author. Mitchell O'Hara-Wild. Author. Fotios Petropoulos. Author. Slava Razbash. Author. Earo Wang. Author. Farah Yasmeen. Author. Federico Garza. Contributor. Daniele Girolimetto. Contributor. Ross Ihaka. Contributor, copyright holder. R Core Team. Contributor, copyright holder. Daniel Reid. Contributor. David Shaub. Contributor. Yuan Tang. Contributor. Xiaoqian Wang. Contributor. Zhenyu Zhou. Contributor.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Hyndman R, Athanasopoulos G, Bergmeir C, Caceres G, Chhay L, O'Hara-Wild M, Petropoulos F, Razbash S, Wang E, Yasmeen F (2024). forecast: Forecasting functions time series linear models. R package version 8.22.0, https://pkg.robjhyndman.com/forecast/. Hyndman RJ, Khandakar Y (2008). “Automatic time series forecasting: forecast package R.” Journal Statistical Software, 27(3), 1–22. doi:10.18637/jss.v027.i03.","code":"@Manual{, title = {{forecast}: Forecasting functions for time series and linear models}, author = {Rob Hyndman and George Athanasopoulos and Christoph Bergmeir and Gabriel Caceres and Leanne Chhay and Mitchell O'Hara-Wild and Fotios Petropoulos and Slava Razbash and Earo Wang and Farah Yasmeen}, year = {2024}, note = {R package version 8.22.0}, url = {https://pkg.robjhyndman.com/forecast/}, } @Article{, title = {Automatic time series forecasting: the forecast package for {R}}, author = {Rob J Hyndman and Yeasmin Khandakar}, journal = {Journal of Statistical Software}, volume = {27}, number = {3}, pages = {1--22}, year = {2008}, doi = {10.18637/jss.v027.i03}, }"},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"forecast-","dir":"","previous_headings":"","what":"Forecasting Functions for Time Series and Linear Models","title":"Forecasting Functions for Time Series and Linear Models","text":"R package forecast provides methods tools displaying analysing univariate time series forecasts including exponential smoothing via state space models automatic ARIMA modelling. complementary forecasting package fable package, implements many models tidyverse framework.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Forecasting Functions for Time Series and Linear Models","text":"can install stable version CRAN. can install development version Github","code":"install.packages('forecast', dependencies = TRUE) # install.packages(\"remotes\") remotes::install_github(\"robjhyndman/forecast\")"},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Forecasting Functions for Time Series and Linear Models","text":"","code":"library(forecast) library(ggplot2) # ETS forecasts USAccDeaths %>% ets() %>% forecast() %>% autoplot() # Automatic ARIMA forecasts WWWusage %>% auto.arima() %>% forecast(h=20) %>% autoplot() # ARFIMA forecasts library(fracdiff) x <- fracdiff.sim( 100, ma=-.4, d=.3)$series arfima(x) %>% forecast(h=30) %>% autoplot() # Forecasting with STL USAccDeaths %>% stlm(modelfunction=ar) %>% forecast(h=36) %>% autoplot() AirPassengers %>% stlf(lambda=0) %>% autoplot() USAccDeaths %>% stl(s.window='periodic') %>% forecast() %>% autoplot() # TBATS forecasts USAccDeaths %>% tbats() %>% forecast() %>% autoplot() taylor %>% tbats() %>% forecast() %>% autoplot()"},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"for-more-information","dir":"","previous_headings":"","what":"For more information","title":"Forecasting Functions for Time Series and Linear Models","text":"Get started forecasting online textbook http://OTexts.org/fpp2/ Read Hyndsight blog https://robjhyndman.com/hyndsight/ Ask forecasting questions http://stats.stackexchange.com/tags/forecasting Ask R questions http://stackoverflow.com/tags/forecasting+r Join International Institute Forecasters: http://forecasters.org/","code":""},{"path":"https://pkg.robjhyndman.com/forecast/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Forecasting Functions for Time Series and Linear Models","text":"package free open source software, licensed GPL-3.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":null,"dir":"Reference","previous_headings":"","what":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"function Acf computes (default plots) estimate autocorrelation function (possibly multivariate) time series. Function Pacf computes (default plots) estimate partial autocorrelation function (possibly multivariate) time series. Function Ccf computes cross-correlation cross-covariance two univariate series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"","code":"Acf( x, lag.max = NULL, type = c(\"correlation\", \"covariance\", \"partial\"), plot = TRUE, na.action = na.contiguous, demean = TRUE, ... ) Pacf( x, lag.max = NULL, plot = TRUE, na.action = na.contiguous, demean = TRUE, ... ) Ccf( x, y, lag.max = NULL, type = c(\"correlation\", \"covariance\"), plot = TRUE, na.action = na.contiguous, ... ) taperedacf( x, lag.max = NULL, type = c(\"correlation\", \"partial\"), plot = TRUE, calc.ci = TRUE, level = 95, nsim = 100, ... ) taperedpacf(x, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"x univariate multivariate (Ccf) numeric time series object numeric vector matrix. lag.max maximum lag calculate acf. Default $10*log10(N/m)$ $N$ number observations $m$ number series. automatically limited one less number observations series. type character string giving type acf computed. Allowed values “correlation” (default), “covariance” “partial”. plot logical. TRUE (default) resulting acf, pacf ccf plotted. na.action function handle missing values. Default na.contiguous. Useful alternatives na.pass na.interp. demean covariances sample means? ... Additional arguments passed plotting function. y univariate numeric time series object numeric vector. calc.ci TRUE, confidence intervals ACF/PACF estimates calculated. level Percentage level used confidence intervals. nsim number bootstrap samples used estimating confidence intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"Acf, Pacf Ccf functions return objects class \"acf\" described acf stats package. taperedacf taperedpacf functions return objects class \"mpacf\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"functions improve acf, pacf ccf functions. main differences Acf plot spike lag 0 type==\"correlation\" (redundant) horizontal axes show lags time units rather seasonal units. tapered versions implement ACF PACF estimates plots described Hyndman (2015), based banded tapered estimates autocovariance proposed McMurry Politis (2010).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"Hyndman, R.J. (2015). Discussion ``High-dimensional autocovariance matrices optimal linear prediction''. Electronic Journal Statistics, 9, 792-796. McMurry, T. L., & Politis, D. N. (2010). Banded tapered estimates autocovariance matrices linear process bootstrap. Journal Time Series Analysis, 31(6), 471-482.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Acf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"(Partial) Autocorrelation and Cross-Correlation Function Estimation — Acf","text":"","code":"Acf(wineind) Pacf(wineind) if (FALSE) { taperedacf(wineind, nsim=50) taperedpacf(wineind, nsim=50) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit ARIMA model to univariate time series — Arima","title":"Fit ARIMA model to univariate time series — Arima","text":"Largely wrapper arima function stats package. main difference function allows drift term. also possible take ARIMA model previous call Arima re-apply data y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit ARIMA model to univariate time series — Arima","text":"","code":"Arima( y, order = c(0, 0, 0), seasonal = c(0, 0, 0), xreg = NULL, include.mean = TRUE, include.drift = FALSE, include.constant, lambda = model$lambda, biasadj = FALSE, method = c(\"CSS-ML\", \"ML\", \"CSS\"), model = NULL, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit ARIMA model to univariate time series — Arima","text":"y univariate time series class ts. order specification non-seasonal part ARIMA model: three components (p, d, q) AR order, degree differencing, MA order. seasonal specification seasonal part ARIMA model, plus period (defaults frequency(y)). list components order period, specification just numeric vector length 3 turned suitable list specification order. xreg Optionally, numerical vector matrix external regressors, must number rows y. data frame. include.mean ARIMA model include mean term? default TRUE undifferenced series, FALSE differenced ones (mean affect fit predictions). include.drift ARIMA model include linear drift term? (.e., linear regression ARIMA errors fitted.) default FALSE. include.constant TRUE, include.mean set TRUE undifferenced series include.drift set TRUE differenced series. Note one difference taken, constant included regardless value argument. deliberate otherwise quadratic higher order polynomial trends induced. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. method Fitting method: maximum likelihood minimize conditional sum--squares. default (unless missing values) use conditional-sum--squares find starting values, maximum likelihood. model Output previous call Arima. model passed, model fitted y without re-estimating parameters. x Deprecated. Included backwards compatibility. ... Additional arguments passed arima.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit ARIMA model to univariate time series — Arima","text":"See arima function stats package. additional objects returned x time series data xreg regressors used fitting (relevant). sigma2 bias adjusted MLE innovations variance.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit ARIMA model to univariate time series — Arima","text":"See arima function stats package.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit ARIMA model to univariate time series — Arima","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/Arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit ARIMA model to univariate time series — Arima","text":"","code":"library(ggplot2) WWWusage %>% Arima(order=c(3,1,0)) %>% forecast(h=20) %>% autoplot # Fit model to first few years of AirPassengers data air.model <- Arima(window(AirPassengers,end=1956+11/12),order=c(0,1,1), seasonal=list(order=c(0,1,1),period=12),lambda=0) plot(forecast(air.model,h=48)) lines(AirPassengers) # Apply fitted model to later data air.model2 <- Arima(window(AirPassengers,start=1957),model=air.model) # Forecast accuracy measures on the log scale. # in-sample one-step forecasts. accuracy(air.model) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 0.3576253 7.89734 5.788344 0.1458472 2.670181 0.1982148 0.05807465 # out-of-sample one-step forecasts. accuracy(air.model2) #> ME RMSE MAE MPE MAPE MASE #> Training set 0.5159268 12.13132 8.14054 0.07949083 1.900931 0.2266508 #> ACF1 #> Training set -0.2166661 # out-of-sample multi-step forecasts accuracy(forecast(air.model,h=48,lambda=NULL), log(window(AirPassengers,start=1957))) #> ME RMSE MAE MPE MAPE MASE #> Training set 0.35762533 7.8973404 5.78834425 0.1458472 2.670181 0.1982148 #> Test set -0.08403416 0.1031891 0.08801596 -1.3982000 1.463555 0.0030140 #> ACF1 Theil's U #> Training set 0.05807465 NA #> Test set 0.75730561 0.9290965"},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":null,"dir":"Reference","previous_headings":"","what":"Box Cox Transformation — BoxCox","title":"Box Cox Transformation — BoxCox","text":"BoxCox() returns transformation input variable using Box-Cox transformation. InvBoxCox() reverses transformation.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Box Cox Transformation — BoxCox","text":"","code":"BoxCox(x, lambda) InvBoxCox(x, lambda, biasadj = FALSE, fvar = NULL)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Box Cox Transformation — BoxCox","text":"x numeric vector time series class ts. lambda transformation parameter. lambda = \"auto\", transformation parameter lambda chosen using BoxCox.lambda (lower bound -0.9) biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. fvar Optional parameter required biasadj=TRUE. Can either forecast variance, list containing interval level, corresponding upper lower intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Box Cox Transformation — BoxCox","text":"numeric vector length x.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Box Cox Transformation — BoxCox","text":"Box-Cox transformation (given Bickel & Doksum 1981) given $$f_\\lambda(x) =(sign(x)|x|^\\lambda - 1)/\\lambda$$ \\(\\lambda\\ne0\\). \\(\\lambda=0\\), $$f_0(x)=\\log(x)$$.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Box Cox Transformation — BoxCox","text":"Box, G. E. P. Cox, D. R. (1964) analysis transformations. JRSS B 26 211--246. Bickel, P. J. Doksum K. . (1981) Analysis Transformations Revisited. JASA 76 296-311.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Box Cox Transformation — BoxCox","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box Cox Transformation — BoxCox","text":"","code":"lambda <- BoxCox.lambda(lynx) lynx.fit <- ar(BoxCox(lynx,lambda)) plot(forecast(lynx.fit,h=20,lambda=lambda)) #> Error in NextMethod(.Generic): cannot assign 'tsp' to zero-length vector"},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"method==\"guerrero\", Guerrero's (1993) method used, lambda minimizes coefficient variation subseries x.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"","code":"BoxCox.lambda(x, method = c(\"guerrero\", \"loglik\"), lower = -1, upper = 2)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"x numeric vector time series class ts method Choose method used calculating lambda. lower Lower limit possible lambda values. upper Upper limit possible lambda values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"number indicating Box-Cox transformation parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"method==\"loglik\", value lambda chosen maximize profile log likelihood linear model fitted x. non-seasonal data, linear time trend fitted seasonal data, linear time trend seasonal dummy variables used.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"Box, G. E. P. Cox, D. R. (1964) analysis transformations. JRSS B 26 211--246. Guerrero, V.M. (1993) Time-series analysis supported power transformations. Journal Forecasting, 12, 37--48.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"Leanne Chhay Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/BoxCox.lambda.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic selection of Box Cox transformation parameter — BoxCox.lambda","text":"","code":"lambda <- BoxCox.lambda(AirPassengers,lower=0) air.fit <- Arima(AirPassengers, order=c(0,1,1), seasonal=list(order=c(0,1,1),period=12), lambda=lambda) plot(forecast(air.fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":null,"dir":"Reference","previous_headings":"","what":"Cross-validation statistic — CV","title":"Cross-validation statistic — CV","text":"Computes leave-one-cross-validation statistic (mean PRESS -- prediction residual sum squares), AIC, corrected AIC, BIC adjusted R^2 values linear model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cross-validation statistic — CV","text":"","code":"CV(obj)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cross-validation statistic — CV","text":"obj output lm tslm","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cross-validation statistic — CV","text":"Numerical vector containing CV, AIC, AICc, BIC AdjR2 values.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cross-validation statistic — CV","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CV.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cross-validation statistic — CV","text":"","code":"y <- ts(rnorm(120,0,3) + 20*sin(2*pi*(1:120)/12), frequency=12) fit1 <- tslm(y ~ trend + season) fit2 <- tslm(y ~ season) CV(fit1) #> CV AIC AICc BIC AdjR2 #> 11.2586211 290.9296316 294.9296316 329.9545160 0.9504162 CV(fit2) #> CV AIC AICc BIC AdjR2 #> 11.1266227 289.8343573 293.2683196 326.0717500 0.9505035"},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":null,"dir":"Reference","previous_headings":"","what":"k-fold Cross-Validation applied to an autoregressive model — CVar","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"CVar computes errors obtained applying autoregressive modelling function subsets time series y using k-fold cross-validation described Bergmeir, Hyndman Koo (2015). also applies Ljung-Box test residuals. test significant (see returned pvalue), serial correlation residuals model can considered underfitting data. case, cross-validated errors can underestimate generalization error used.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"","code":"CVar( y, k = 10, FUN = nnetar, cvtrace = FALSE, blocked = FALSE, LBlags = 24, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"y Univariate time series k Number folds use cross-validation. FUN Function fit autoregressive model. Currently, works nnetar function. cvtrace Provide progress information. blocked choose folds randomly blocks? LBlags lags Ljung-Box test, defaults 24, yearly series can set 20 ... arguments passed FUN.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"list containing information model accuracy fold, plus summary information computed across folds.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"Bergmeir, C., Hyndman, R.J., Koo, B. (2018) note validity cross-validation evaluating time series prediction. Computational Statistics & Data Analysis, 120, 70-83. https://robjhyndman.com/publications/cv-time-series/.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"Gabriel Caceres Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/CVar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"k-fold Cross-Validation applied to an autoregressive model — CVar","text":"","code":"modelcv <- CVar(lynx, k=5, lambda=0.15) print(modelcv) #> Series: lynx #> Call: CVar(y = lynx, k = 5, lambda = 0.15) #> #> 5-fold cross-validation #> Mean SD #> ME -7.399045e+01 209.5564198 #> RMSE 1.008670e+03 255.8655599 #> MAE 6.679454e+02 172.1851058 #> MPE -2.689215e+01 51.6590777 #> MAPE 6.685048e+01 36.9979203 #> ACF1 -4.401883e-03 0.1321075 #> Theil's U 1.058446e+00 0.2532232 #> #> p-value of Ljung-Box test of residuals is 0.1454125 #> if this value is significant (<0.05), #> the result of the cross-validation should not be used #> as the model is underfitting the data. print(modelcv$fold1) #> $model #> Series: y #> Model: NNAR(11,6) #> Call: FUN(y = y, lambda = 0.15, subset = trainset) #> #> Average of 20 networks, each of which is #> a 11-6-1 network with 79 weights #> options were - linear output units #> #> sigma^2 estimated as 0.09578 #> #> $accuracy #> ME RMSE MAE MPE MAPE ACF1 Theil's U #> Test set 76.85482 1185.761 715.7763 2.319121 53.37024 0.03753834 1.303367 #> #> $testfit #> Time Series: #> Start = 1821 #> End = 1934 #> Frequency = 1 #> [1] NA NA NA NA NA NA #> [7] NA NA NA NA NA 287.19570 #> [13] 184.21320 282.91496 409.19593 2192.03796 2877.01566 3417.18384 #> [19] 2022.21189 1599.00233 149.74329 47.64919 67.24354 211.40517 #> [25] 532.11622 1052.86007 2092.77341 2549.59355 987.47308 376.91182 #> [31] 352.80268 246.88152 358.68024 741.97139 1650.64997 2654.73639 #> [37] 3219.93678 2165.79913 730.32194 301.26331 365.38976 236.18078 #> [43] 522.28826 1577.03121 3280.64184 5675.68453 4409.60188 3106.08734 #> [49] 250.89901 424.84849 370.97720 762.50398 1617.20849 1772.41723 #> [55] 2325.21047 2529.90193 767.97707 296.31146 171.03166 258.69082 #> [61] 443.41225 762.85045 1975.78213 2924.22641 4344.50209 2604.72846 #> [67] 1570.87272 149.85585 40.30856 50.70034 66.53577 139.63290 #> [73] 377.87725 585.66515 3965.98801 3512.01272 1134.45446 106.48592 #> [79] 155.49786 365.45650 770.68567 1319.06536 3391.92020 3441.94281 #> [85] 5951.02582 3771.51526 1781.75796 370.88750 382.15521 789.27459 #> [91] 1395.54100 2761.97997 3672.80097 3164.25896 2874.32795 3572.64579 #> [97] 672.93393 84.42843 53.25289 106.46359 222.59445 411.01094 #> [103] 1147.65876 1042.18121 3431.96897 2909.09436 1483.21392 498.12837 #> [109] 454.26605 707.99384 1175.52810 1648.48631 2659.55348 3352.11427 #> #> $testset #> [1] 1 6 8 9 10 12 20 30 41 48 56 59 67 68 72 74 77 84 99 #> [20] 104 110 111 112 #> library(ggplot2) autoplot(lynx, series=\"Data\") + autolayer(modelcv$testfit, series=\"Fits\") + autolayer(modelcv$residuals, series=\"Residuals\") #> Warning: Removed 11 rows containing missing values or values outside the scale range #> (`geom_line()`). #> Warning: Removed 11 rows containing missing values or values outside the scale range #> (`geom_line()`). ggAcf(modelcv$residuals)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":null,"dir":"Reference","previous_headings":"","what":"Accuracy measures for a forecast model — accuracy.default","title":"Accuracy measures for a forecast model — accuracy.default","text":"Returns range summary measures forecast accuracy. x provided, function measures test set forecast accuracy based x-f. x provided, function produces training set accuracy measures forecasts based f[\"x\"]-fitted(f). measures defined discussed Hyndman Koehler (2006).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Accuracy measures for a forecast model — accuracy.default","text":"","code":"# S3 method for default accuracy(object, x, test = NULL, d = NULL, D = NULL, f = NULL, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Accuracy measures for a forecast model — accuracy.default","text":"object object class “forecast”, numerical vector containing forecasts. also work Arima, ets lm objects x omitted -- case training set accuracy measures returned. x optional numerical vector containing actual values length object, time series overlapping times f. test Indicator elements x f test. test NULL, elements used. Otherwise test numeric vector containing indices elements use test. d integer indicating number lag-1 differences used denominator MASE calculation. Default value 1 non-seasonal series 0 seasonal series. D integer indicating number seasonal differences used denominator MASE calculation. Default value 0 non-seasonal series 1 seasonal series. f Deprecated. Please use `object` instead. ... Additional arguments depending specific method.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Accuracy measures for a forecast model — accuracy.default","text":"Matrix giving forecast accuracy measures.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Accuracy measures for a forecast model — accuracy.default","text":"measures calculated : : Mean Error RMSE: Root Mean Squared Error MAE: Mean Absolute Error MPE: Mean Percentage Error MAPE: Mean Absolute Percentage Error MASE: Mean Absolute Scaled Error ACF1: Autocorrelation errors lag 1. default, MASE calculation scaled using MAE training set naive forecasts non-seasonal time series, training set seasonal naive forecasts seasonal time series training set mean forecasts non-time series data. f numerical vector rather forecast object, MASE returned training data available. See Hyndman Koehler (2006) Hyndman Athanasopoulos (2014, Section 2.5) details.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Accuracy measures for a forecast model — accuracy.default","text":"Hyndman, R.J. Koehler, .B. (2006) \"Another look measures forecast accuracy\". International Journal Forecasting, 22(4), 679-688. Hyndman, R.J. Athanasopoulos, G. (2018) \"Forecasting: principles practice\", 2nd ed., OTexts, Melbourne, Australia. Section 3.4 \"Evaluating forecast accuracy\". https://otexts.com/fpp2/accuracy.html.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Accuracy measures for a forecast model — accuracy.default","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/accuracy.default.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Accuracy measures for a forecast model — accuracy.default","text":"","code":"fit1 <- rwf(EuStockMarkets[1:200, 1], h = 100) fit2 <- meanf(EuStockMarkets[1:200, 1], h = 100) accuracy(fit1) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 0.4393467 15.8461 8.959648 0.02128535 0.5533582 1 -0.007760885 accuracy(fit2) #> ME RMSE MAE MPE MAPE MASE #> Training set 6.24991e-14 57.83723 46.98108 -0.1240662 2.865357 1 accuracy(fit1, EuStockMarkets[201:300, 1]) #> ME RMSE MAE MPE MAPE MASE #> Training set 0.4393467 15.8461 8.959648 0.02128535 0.5533582 1.00000 #> Test set 0.8900000 78.1811 63.311200 -0.16763307 3.7897316 7.06626 #> ACF1 #> Training set -0.007760885 #> Test set NA accuracy(fit2, EuStockMarkets[201:300, 1]) #> ME RMSE MAE MPE MAPE MASE #> Training set 6.249910e-14 57.83723 46.98108 -0.1240662 2.865357 1.000000 #> Test set 8.429485e+01 114.96571 105.65361 4.7004265 6.075968 2.248855 plot(fit1) lines(EuStockMarkets[1:300, 1])"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit a fractionally differenced ARFIMA model — arfima","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"ARFIMA(p,d,q) model selected estimated automatically using Hyndman-Khandakar (2008) algorithm select p q Haslett Raftery (1989) algorithm estimate parameters including d.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"","code":"arfima( y, drange = c(0, 0.5), estim = c(\"mle\", \"ls\"), model = NULL, lambda = NULL, biasadj = FALSE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"y univariate time series (numeric vector). drange Allowable values d considered. Default c(0,0.5) ensures stationary model returned. estim estim==\"ls\", ARMA parameters calculated using Haslett-Raftery algorithm. estim==\"mle\", ARMA parameters calculated using full MLE via arima function. model Output previous call arfima. model passed, model fitted y without re-estimating parameters. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. x Deprecated. Included backwards compatibility. ... arguments passed auto.arima selecting p q.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"list object S3 class \"fracdiff\", described fracdiff documentation. additional objects added list including x (original time series), residuals fitted values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"function combines fracdiff auto.arima automatically select estimate ARFIMA model. fractional differencing parameter chosen first assuming ARFIMA(2,d,0) model. data fractionally differenced using estimated d ARMA model selected resulting time series using auto.arima. Finally, full ARFIMA(p,d,q) model re-estimated using fracdiff. estim==\"mle\", ARMA coefficients refined using arima.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"J. Haslett . E. Raftery (1989) Space-time Modelling Long-memory Dependence: Assessing Ireland's Wind Power Resource (discussion); Applied Statistics 38, 1-50. Hyndman, R.J. Khandakar, Y. (2008) \"Automatic time series forecasting: forecast package R\", Journal Statistical Software, 26(3).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"Rob J Hyndman Farah Yasmeen","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arfima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit a fractionally differenced ARFIMA model — arfima","text":"","code":"library(fracdiff) x <- fracdiff.sim( 100, ma=-.4, d=.3)$series fit <- arfima(x) tsdisplay(residuals(fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":null,"dir":"Reference","previous_headings":"","what":"Errors from a regression model with ARIMA errors — arima.errors","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"Returns time series regression residuals fitted ARIMA model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"","code":"arima.errors(object)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"object object containing time series model class Arima.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"ts object","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"deprecated function identical residuals.Arima(object, type=\"regression\") Regression residuals equal original data minus effect regression variables. regression variables, errors identical original series (possibly adjusted zero mean).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/arima.errors.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Errors from a regression model with ARIMA errors — arima.errors","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the order of an ARIMA or ARFIMA model — arimaorder","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"Returns order univariate ARIMA ARFIMA model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"","code":"arimaorder(object)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"object object class “Arima”, dQuotear “fracdiff”. Usually result call arima, Arima, auto.arima, ar, arfima fracdiff.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"numerical vector giving values \\(p\\), \\(d\\) \\(q\\) ARIMA ARFIMA model. seasonal ARIMA model, returned vector contains values \\(p\\), \\(d\\), \\(q\\), \\(P\\), \\(D\\), \\(Q\\) \\(m\\), \\(m\\) period seasonality.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/arimaorder.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the order of an ARIMA or ARFIMA model — arimaorder","text":"","code":"WWWusage %>% auto.arima %>% arimaorder #> p d q #> 1 1 1"},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit best ARIMA model to univariate time series — auto.arima","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"Returns best ARIMA model according either AIC, AICc BIC value. function conducts search possible model within order constraints provided.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"","code":"auto.arima( y, d = NA, D = NA, max.p = 5, max.q = 5, max.P = 2, max.Q = 2, max.order = 5, max.d = 2, max.D = 1, start.p = 2, start.q = 2, start.P = 1, start.Q = 1, stationary = FALSE, seasonal = TRUE, ic = c(\"aicc\", \"aic\", \"bic\"), stepwise = TRUE, nmodels = 94, trace = FALSE, approximation = (length(x) > 150 | frequency(x) > 12), method = NULL, truncate = NULL, xreg = NULL, test = c(\"kpss\", \"adf\", \"pp\"), test.args = list(), seasonal.test = c(\"seas\", \"ocsb\", \"hegy\", \"ch\"), seasonal.test.args = list(), allowdrift = TRUE, allowmean = TRUE, lambda = NULL, biasadj = FALSE, parallel = FALSE, num.cores = 2, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"y univariate time series d Order first-differencing. missing, choose value based test. D Order seasonal-differencing. missing, choose value based season.test. max.p Maximum value p max.q Maximum value q max.P Maximum value P max.Q Maximum value Q max.order Maximum value p+q+P+Q model selection stepwise. max.d Maximum number non-seasonal differences max.D Maximum number seasonal differences start.p Starting value p stepwise procedure. start.q Starting value q stepwise procedure. start.P Starting value P stepwise procedure. start.Q Starting value Q stepwise procedure. stationary TRUE, restricts search stationary models. seasonal FALSE, restricts search non-seasonal models. ic Information criterion used model selection. stepwise TRUE, stepwise selection (faster). Otherwise, searches models. Non-stepwise selection can slow, especially seasonal models. nmodels Maximum number models considered stepwise search. trace TRUE, list ARIMA models considered reported. approximation TRUE, estimation via conditional sums squares information criteria used model selection approximated. final model still computed using maximum likelihood estimation. Approximation used long time series high seasonal period avoid excessive computation times. method fitting method: maximum likelihood minimize conditional sum--squares. default (unless missing values) use conditional-sum--squares find starting values, maximum likelihood. Can abbreviated. truncate integer value indicating many observations use model selection. last truncate values series used select model truncate NULL approximation=TRUE. observations used either truncate=NULL approximation=FALSE. xreg Optionally, numerical vector matrix external regressors, must number rows y. (data frame.) test Type unit root test use. See ndiffs details. test.args Additional arguments passed unit root test. seasonal.test determines method used select number seasonal differences. default method use measure seasonal strength computed STL decomposition. possibilities involve seasonal unit root tests. seasonal.test.args Additional arguments passed seasonal unit root test. See nsdiffs details. allowdrift TRUE, models drift terms considered. allowmean TRUE, models non-zero mean considered. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. parallel TRUE stepwise = FALSE, specification search done parallel. can give significant speedup multicore machines. num.cores Allows user specify amount parallel processes used parallel = TRUE stepwise = FALSE. NULL, number logical cores automatically detected available cores used. x Deprecated. Included backwards compatibility. ... Additional arguments passed arima.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"Arima","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"default arguments designed rapid estimation models many time series. analysing just one time series, can afford take time, recommended set stepwise=FALSE approximation=FALSE. Non-stepwise selection can slow, especially seasonal data. stepwise algorithm outlined Hyndman & Khandakar (2008) used except default method selecting seasonal differences now based estimate seasonal strength (Wang, Smith & Hyndman, 2006) rather Canova-Hansen test. also minor variations algorithm described Hyndman Khandakar (2008).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"Hyndman, RJ Khandakar, Y (2008) \"Automatic time series forecasting: forecast package R\", Journal Statistical Software, 26(3). Wang, X, Smith, KA, Hyndman, RJ (2006) \"Characteristic-based clustering time series data\", Data Mining Knowledge Discovery, 13(3), 335-364.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit best ARIMA model to univariate time series — auto.arima","text":"","code":"fit <- auto.arima(WWWusage) plot(forecast(fit,h=20))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autolayer.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a ggplot layer appropriate to a particular data type — autolayer","title":"Create a ggplot layer appropriate to a particular data type — autolayer","text":"autolayer() uses ggplot2 draw particular layer object particular class single command. defines S3 generic classes packages can extend.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autolayer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a ggplot layer appropriate to a particular data type — autolayer","text":"","code":"autolayer(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autolayer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a ggplot layer appropriate to a particular data type — autolayer","text":"object object, whose class determine behaviour autolayer ... arguments passed specific methods","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autolayer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a ggplot layer appropriate to a particular data type — autolayer","text":"ggplot layer","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":null,"dir":"Reference","previous_headings":"","what":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"Produces ggplot object equivalent Acf, Pacf, Ccf, taperedacf taperedpacf functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"","code":"# S3 method for acf autoplot(object, ci = 0.95, ...) ggAcf( x, lag.max = NULL, type = c(\"correlation\", \"covariance\", \"partial\"), plot = TRUE, na.action = na.contiguous, demean = TRUE, ... ) ggPacf( x, lag.max = NULL, plot = TRUE, na.action = na.contiguous, demean = TRUE, ... ) ggCcf( x, y, lag.max = NULL, type = c(\"correlation\", \"covariance\"), plot = TRUE, na.action = na.contiguous, ... ) # S3 method for mpacf autoplot(object, ...) ggtaperedacf( x, lag.max = NULL, type = c(\"correlation\", \"partial\"), plot = TRUE, calc.ci = TRUE, level = 95, nsim = 100, ... ) ggtaperedpacf(x, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"object Object class “acf”. ci coverage probability confidence interval. Plotting confidence interval suppressed ci zero negative. ... plotting parameters affect plot. x univariate multivariate (Ccf) numeric time series object numeric vector matrix. lag.max maximum lag calculate acf. type character string giving type acf computed. Allowed values \"correlation\" (default), “covariance” “partial”. plot logical. TRUE (default) resulting ACF, PACF CCF plotted. na.action function handle missing values. Default na.contiguous. Useful alternatives na.pass na.interp. demean covariances sample means? y univariate numeric time series object numeric vector. calc.ci TRUE, confidence intervals ACF/PACF estimates calculated. level Percentage level used confidence intervals. nsim number bootstrap samples used estimating confidence intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"ggplot object.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"autoplot given acf mpacf object, appropriate ggplot object created. ggtaperedpacf","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.acf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ggplot (Partial) Autocorrelation and Cross-Correlation Function Estimation\nand Plotting — autoplot.acf","text":"","code":"library(ggplot2) ggAcf(wineind) wineind %>% Acf(plot=FALSE) %>% autoplot if (FALSE) { wineind %>% taperedacf(plot=FALSE) %>% autoplot ggtaperedacf(wineind) ggtaperedpacf(wineind)} ggCcf(mdeaths, fdeaths)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"Produces ggplot object seasonally decomposed time series objects class “stl” (created stl), class “seas” (created seas), class “decomposed.ts” (created decompose).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"","code":"# S3 method for decomposed.ts autoplot(object, labels = NULL, range.bars = NULL, ...) # S3 method for stl autoplot(object, labels = NULL, range.bars = TRUE, ...) # S3 method for StructTS autoplot(object, labels = NULL, range.bars = TRUE, ...) # S3 method for seas autoplot(object, labels = NULL, range.bars = NULL, ...) # S3 method for mstl autoplot(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"object Object class “seas”, “stl”, “decomposed.ts”. labels Labels replace “seasonal”, “trend”, “remainder”. range.bars Logical indicating plot bar right side representing relative size. NULL, automatic selection takes place. ... plotting parameters affect plot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"Returns object class ggplot.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.seas.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot time series decomposition components using ggplot — autoplot.decomposed.ts","text":"","code":"library(ggplot2) co2 %>% decompose() %>% autoplot() nottem %>% stl(s.window = \"periodic\") %>% autoplot() if (FALSE) { library(seasonal) seas(USAccDeaths) %>% autoplot() }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatically create a ggplot for time series objects — autolayer.mts","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"autoplot takes object type ts mts creates ggplot object suitable usage stat_forecast.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"","code":"# S3 method for mts autolayer(object, colour = TRUE, series = NULL, ...) # S3 method for msts autolayer(object, series = NULL, ...) # S3 method for ts autolayer(object, colour = TRUE, series = NULL, ...) # S3 method for ts autoplot( object, series = NULL, xlab = \"Time\", ylab = deparse(substitute(object)), main = NULL, ... ) # S3 method for mts autoplot( object, colour = TRUE, facets = FALSE, xlab = \"Time\", ylab = deparse(substitute(object)), main = NULL, ... ) # S3 method for msts autoplot(object, ...) # S3 method for ts fortify(model, data, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"object Object class “ts” “mts”. colour TRUE, time series assigned colour aesthetic series Identifies time series colour, integrates well functionality geom_forecast. ... plotting parameters affect plot. xlab X-axis label. ylab Y-axis label. main Main title. facets TRUE, multiple time series faceted (unless specified, colour set FALSE). FALSE, series assigned colour. model Object class “ts” converted “data.frame”. data used (required fortify method)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"None. Function produces ggplot graph.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"fortify.ts takes ts object converts data frame (usage ggplot2).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/autoplot.ts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatically create a ggplot for time series objects — autolayer.mts","text":"","code":"library(ggplot2) autoplot(USAccDeaths) lungDeaths <- cbind(mdeaths, fdeaths) autoplot(lungDeaths) autoplot(lungDeaths, facets=TRUE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using a bagged model — baggedModel","title":"Forecasting using a bagged model — baggedModel","text":"bagged model forecasting method.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using a bagged model — baggedModel","text":"","code":"baggedModel(y, bootstrapped_series = bld.mbb.bootstrap(y, 100), fn = ets, ...) baggedETS(y, bootstrapped_series = bld.mbb.bootstrap(y, 100), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using a bagged model — baggedModel","text":"y numeric vector time series class ts. bootstrapped_series bootstrapped versions y. fn forecast function use. Default ets. ... arguments passed forecast function.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using a bagged model — baggedModel","text":"Returns object class \"baggedModel\". function print used obtain print summary results. models list containing fitted ensemble models. method function producing forecastable model. y original time series. bootstrapped_series bootstrapped series. modelargs arguments passed fn. fitted Fitted values (one-step forecasts). mean fitted values calculated ensemble. residuals Original values minus fitted values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using a bagged model — baggedModel","text":"function implements bagged model forecasting method described Bergmeir et al. default, ets function applied bootstrapped series. Base models ets can given parameter fn. Using default parameters, function bld.mbb.bootstrap used calculate bootstrapped series Box-Cox Loess-based decomposition (BLD) bootstrap. function forecast.baggedModel can used calculate forecasts. baggedETS wrapper baggedModel, setting fn \"ets\". function included backwards compatibility , may deprecated future.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasting using a bagged model — baggedModel","text":"Bergmeir, C., R. J. Hyndman, J. M. Benitez (2016). Bagging Exponential Smoothing Methods using STL Decomposition Box-Cox Transformation. International Journal Forecasting 32, 303-312.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using a bagged model — baggedModel","text":"Christoph Bergmeir, Fotios Petropoulos","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/baggedModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using a bagged model — baggedModel","text":"","code":"fit <- baggedModel(WWWusage) fcast <- forecast(fit) plot(fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":null,"dir":"Reference","previous_headings":"","what":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"Fits BATS model applied y, described De Livera, Hyndman & Snyder (2011). Parallel processing used default speed computations.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"","code":"bats( y, use.box.cox = NULL, use.trend = NULL, use.damped.trend = NULL, seasonal.periods = NULL, use.arma.errors = TRUE, use.parallel = length(y) > 1000, num.cores = 2, bc.lower = 0, bc.upper = 1, biasadj = FALSE, model = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"y time series forecast. Can numeric, msts ts. univariate time series supported. use.box.cox TRUE/FALSE indicates whether use Box-Cox transformation . NULL tried best fit selected AIC. use.trend TRUE/FALSE indicates whether include trend . NULL tried best fit selected AIC. use.damped.trend TRUE/FALSE indicates whether include damping parameter trend . NULL tried best fit selected AIC. seasonal.periods y numeric seasonal periods can specified parameter. use.arma.errors TRUE/FALSE indicates whether include ARMA errors . TRUE best fit selected AIC. FALSE selection algorithm consider ARMA errors. use.parallel TRUE/FALSE indicates whether use parallel processing. num.cores number parallel processes used using parallel processing. NULL number logical cores detected available cores used. bc.lower lower limit (inclusive) Box-Cox transformation. bc.upper upper limit (inclusive) Box-Cox transformation. biasadj Use adjusted back-transformed mean Box-Cox transformations. TRUE, point forecasts fitted values mean forecast. Otherwise, points can considered median forecast densities. model Output previous call bats. model passed, model fitted y without re-estimating parameters. ... Additional arguments passed auto.arima choose ARMA(p, q) model errors. (Note xreg ignored, arguments concerning seasonality differencing, arguments controlling values p q used.)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"object class \"bats\". generic accessor functions fitted.values residuals extract useful features value returned bats associated functions. fitted model designated BATS(omega, p,q, phi, m1,...mJ) omega Box-Cox parameter phi damping parameter; error modelled ARMA(p,q) process m1,...,mJ list seasonal periods used model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"De Livera, .M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series complex seasonal patterns using exponential smoothing, Journal American Statistical Association, 106(496), 1513-1527.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"BATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — bats","text":"","code":"if (FALSE) { fit <- bats(USAccDeaths) plot(forecast(fit)) taylor.fit <- bats(taylor) plot(forecast(taylor.fit)) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":null,"dir":"Reference","previous_headings":"","what":"Number of trading days in each season — bizdays","title":"Number of trading days in each season — bizdays","text":"Returns number trading days month quarter observed time period major financial center.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number of trading days in each season — bizdays","text":"","code":"bizdays(x, FinCenter = c(\"New York\", \"London\", \"NERC\", \"Toronto\", \"Zurich\"))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number of trading days in each season — bizdays","text":"x Monthly quarterly time series FinCenter Major financial center.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number of trading days in each season — bizdays","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Number of trading days in each season — bizdays","text":"Useful trading days length adjustments. define \"business days\", please refer isBizday.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Number of trading days in each season — bizdays","text":"Earo Wang","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bizdays.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number of trading days in each season — bizdays","text":"","code":"x <- ts(rnorm(30), start = c(2013, 2), frequency = 12) bizdays(x, FinCenter = \"New York\") #> Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec #> 2013 19 20 22 22 20 22 22 20 23 20 21 #> 2014 21 19 21 21 21 21 22 21 21 23 19 22 #> 2015 20 19 22 21 20 22 22"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":null,"dir":"Reference","previous_headings":"","what":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"Generates bootstrapped versions time series using Box-Cox Loess-based decomposition bootstrap.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"","code":"bld.mbb.bootstrap(x, num, block_size = NULL)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"x Original time series. num Number bootstrapped versions generate. block_size Block size moving block bootstrap.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"list bootstrapped versions series. first series list original series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"procedure described Bergmeir et al. Box-Cox decomposition applied, together STL Loess (non-seasonal time series), remainder bootstrapped using moving block bootstrap.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"Bergmeir, C., R. J. Hyndman, J. M. Benitez (2016). Bagging Exponential Smoothing Methods using STL Decomposition Box-Cox Transformation. International Journal Forecasting 32, 303-312.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"Christoph Bergmeir, Fotios Petropoulos","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/bld.mbb.bootstrap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box-Cox and Loess-based decomposition bootstrap. — bld.mbb.bootstrap","text":"","code":"bootstrapped_series <- bld.mbb.bootstrap(WWWusage, 100)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":null,"dir":"Reference","previous_headings":"","what":"Check that residuals from a time series model look like white noise — checkresiduals","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"plot=TRUE, produces time plot residuals, corresponding ACF, histogram. test FALSE, output either Ljung-Box test Breusch-Godfrey test printed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"","code":"checkresiduals(object, lag, test, plot = TRUE, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"object Either time series model, forecast object, time series (assumed residuals). lag Number lags use Ljung-Box Breusch-Godfrey test. missing, set min(10,n/5) non-seasonal data, min(2m, n/5) seasonal data, n length series, m seasonal period data. constrained least df+3 df degrees freedom model. ensures least 3 degrees freedom used chi-squared test. test Test use serial correlation. default, object class lm, test=\"BG\". Otherwise, test=\"LB\". Setting test=FALSE prevent test results printed. plot Logical. TRUE, produce plot. ... arguments passed ggtsdisplay.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"None","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/checkresiduals.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check that residuals from a time series model look like white noise — checkresiduals","text":"","code":"fit <- ets(WWWusage) checkresiduals(fit) #> #> \tLjung-Box test #> #> data: Residuals from ETS(A,Ad,N) #> Q* = 28.995, df = 10, p-value = 0.001249 #> #> Model df: 0. Total lags used: 10 #>"},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasts for intermittent demand using Croston's method — croston","title":"Forecasts for intermittent demand using Croston's method — croston","text":"Returns forecasts information Croston's forecasts applied y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasts for intermittent demand using Croston's method — croston","text":"","code":"croston(y, h = 10, alpha = 0.1, x = y)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasts for intermittent demand using Croston's method — croston","text":"y numeric vector time series class ts h Number periods forecasting. alpha Value alpha. Default value 0.1. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasts for intermittent demand using Croston's method — croston","text":"object class \"forecast\" list containing least following elements: model list containing information fitted model. first element gives model used non-zero demands. second element gives model used times non-zero demands. elements class forecast. method name forecasting method character string mean Point forecasts time series x original time series (either object time series used create model stored object). residuals Residuals fitted model. y minus fitted values. fitted Fitted values (one-step forecasts) function summary used obtain print summary results, function plot produces plot forecasts. generic accessor functions fitted.values residuals extract useful features value returned croston associated functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasts for intermittent demand using Croston's method — croston","text":"Based Croston's (1972) method intermittent demand forecasting, also described Shenstone Hyndman (2005). Croston's method involves using simple exponential smoothing (SES) non-zero elements time series separate application SES times non-zero elements time series. smoothing parameters two applications SES assumed equal denoted alpha. Note prediction intervals computed Croston's method underlying stochastic model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasts for intermittent demand using Croston's method — croston","text":"Croston, J. (1972) \"Forecasting stock control intermittent demands\", Operational Research Quarterly, 23(3), 289-303. Shenstone, L., Hyndman, R.J. (2005) \"Stochastic models underlying Croston's method intermittent demand forecasting\". Journal Forecasting, 24, 389-402.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasts for intermittent demand using Croston's method — croston","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/croston.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasts for intermittent demand using Croston's method — croston","text":"","code":"y <- rpois(20,lambda=.3) fcast <- croston(y) plot(fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Diebold-Mariano test for predictive accuracy — dm.test","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"Diebold-Mariano test compares forecast accuracy two forecast methods.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"","code":"dm.test( e1, e2, alternative = c(\"two.sided\", \"less\", \"greater\"), h = 1, power = 2, varestimator = c(\"acf\", \"bartlett\") )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"e1 Forecast errors method 1. e2 Forecast errors method 2. alternative character string specifying alternative hypothesis, must one \"two.sided\" (default), \"greater\" \"less\". can specify just initial letter. h forecast horizon used calculating e1 e2. power power used loss function. Usually 1 2. varestimator character string specifying long-run variance estimator. Options \"acf\" (default) \"bartlett\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"list class \"htest\" containing following components: statistic value DM-statistic. parameter forecast horizon loss function power used test. alternative character string describing alternative hypothesis. varestimator character string describing long-run variance estimator. p.value p-value test. method character string value \"Diebold-Mariano Test\". data.name character vector giving names two error series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"function implements modified test proposed Harvey, Leybourne Newbold (1997). null hypothesis two methods forecast accuracy. alternative=\"less\", alternative hypothesis method 2 less accurate method 1. alternative=\"greater\", alternative hypothesis method 2 accurate method 1. alternative=\"two.sided\", alternative hypothesis method 1 method 2 different levels accuracy. long-run variance estimator can either auto-correlation estimator varestimator = \"acf\", estimator based Bartlett weights varestimator = \"bartlett\" ensures positive estimate. long-run variance estimators proposed Diebold Mariano (1995).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"Diebold, F.X. Mariano, R.S. (1995) Comparing predictive accuracy. Journal Business Economic Statistics, 13, 253-263. Harvey, D., Leybourne, S., & Newbold, P. (1997). Testing equality prediction mean squared errors. International Journal forecasting, 13(2), 281-291.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"George Athanasopoulos Kirill Kuroptev","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dm.test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Diebold-Mariano test for predictive accuracy — dm.test","text":"","code":"# Test on in-sample one-step forecasts f1 <- ets(WWWusage) f2 <- auto.arima(WWWusage) accuracy(f1) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 0.2243266 3.40781 2.761668 0.2629465 2.162415 0.6102792 0.2308014 accuracy(f2) #> ME RMSE MAE MPE MAPE MASE #> Training set 0.3035616 3.113754 2.405275 0.2805566 1.917463 0.5315228 #> ACF1 #> Training set -0.01715517 dm.test(residuals(f1), residuals(f2), h = 1) #> #> \tDiebold-Mariano Test #> #> data: residuals(f1)residuals(f2) #> DM = 1.9078, Forecast horizon = 1, Loss function power = 2, p-value = #> 0.05932 #> alternative hypothesis: two.sided #> # Test on out-of-sample one-step forecasts f1 <- ets(WWWusage[1:80]) f2 <- auto.arima(WWWusage[1:80]) f1.out <- ets(WWWusage[81:100], model = f1) #> Model is being refit with current smoothing parameters but initial states are being re-estimated. #> Set 'use.initial.values=TRUE' if you want to re-use existing initial values. f2.out <- Arima(WWWusage[81:100], model = f2) accuracy(f1.out) #> ME RMSE MAE MPE MAPE MASE ACF1 #> Training set 0.2100836 3.24835 2.570459 0.1203497 1.352355 0.4246845 0.2287215 accuracy(f2.out) #> ME RMSE MAE MPE MAPE MASE #> Training set 1.081679 3.329012 2.437119 0.6810673 1.375924 0.4026544 #> ACF1 #> Training set -0.004460367 dm.test(residuals(f1.out), residuals(f2.out), h = 1) #> #> \tDiebold-Mariano Test #> #> data: residuals(f1.out)residuals(f2.out) #> DM = -0.14392, Forecast horizon = 1, Loss function power = 2, p-value = #> 0.8871 #> alternative hypothesis: two.sided #>"},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":null,"dir":"Reference","previous_headings":"","what":"Double-Seasonal Holt-Winters Forecasting — dshw","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"Returns forecasts using Taylor's (2003) Double-Seasonal Holt-Winters method.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"","code":"dshw( y, period1 = NULL, period2 = NULL, h = 2 * max(period1, period2), alpha = NULL, beta = NULL, gamma = NULL, omega = NULL, phi = NULL, lambda = NULL, biasadj = FALSE, armethod = TRUE, model = NULL )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"y Either msts object two seasonal periods numeric vector. period1 Period shorter seasonal period. used y msts object. period2 Period longer seasonal period. used y msts object. h Number periods forecasting. alpha Smoothing parameter level. NULL, parameter estimated using least squares. beta Smoothing parameter slope. NULL, parameter estimated using least squares. gamma Smoothing parameter first seasonal period. NULL, parameter estimated using least squares. omega Smoothing parameter second seasonal period. NULL, parameter estimated using least squares. phi Autoregressive parameter. NULL, parameter estimated using least squares. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. armethod TRUE, forecasts adjusted using AR(1) model errors. model specified, existing model applied new data set.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"object class \"forecast\" list includes following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series x original time series. residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) function summary used obtain print summary results, function plot produces plot forecasts. generic accessor functions fitted.values residuals extract useful features value returned dshw.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"Taylor's (2003) double-seasonal Holt-Winters method uses additive trend multiplicative seasonality, two seasonal components multiplied together. example, series half-hourly data, one set period1=48 daily period period2=336 weekly period. smoothing parameter notation used different Taylor (2003); instead matches used Hyndman et al (2008) used ets function.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"Taylor, J.W. (2003) Short-term electricity demand forecasting using double seasonal exponential smoothing. Journal Operational Research Society, 54, 799-805. Hyndman, R.J., Koehler, .B., Ord, J.K., Snyder, R.D. (2008) Forecasting exponential smoothing: state space approach, Springer-Verlag. http://www.exponentialsmoothing.net.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/dshw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Double-Seasonal Holt-Winters Forecasting — dshw","text":"","code":"if (FALSE) { fcast <- dshw(taylor) plot(fcast) t <- seq(0,5,by=1/20) x <- exp(sin(2*pi*t) + cos(2*pi*t*4) + rnorm(length(t),0,.1)) fit <- dshw(x,20,5) plot(fit) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":null,"dir":"Reference","previous_headings":"","what":"Easter holidays in each season — easter","title":"Easter holidays in each season — easter","text":"Returns vector 0's 1's fractional results Easter spans March April observed time period. Easter defined days Good Friday Easter Sunday inclusively, plus optionally Easter Monday easter.mon=TRUE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Easter holidays in each season — easter","text":"","code":"easter(x, easter.mon = FALSE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Easter holidays in each season — easter","text":"x Monthly quarterly time series easter.mon TRUE, length Easter holidays includes Easter Monday.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Easter holidays in each season — easter","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Easter holidays in each season — easter","text":"Useful adjusting calendar effects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Easter holidays in each season — easter","text":"Earo Wang","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/easter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Easter holidays in each season — easter","text":"","code":"easter(wineind, easter.mon = TRUE) #> Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec #> 1980 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1981 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1982 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1983 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1984 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1985 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1986 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1987 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1988 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1989 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1990 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1991 0.00 0.00 0.75 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1992 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1993 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 #> 1994 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential smoothing state space model — ets","title":"Exponential smoothing state space model — ets","text":"Returns ets model applied y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential smoothing state space model — ets","text":"","code":"ets( y, model = \"ZZZ\", damped = NULL, alpha = NULL, beta = NULL, gamma = NULL, phi = NULL, additive.only = FALSE, lambda = NULL, biasadj = FALSE, lower = c(rep(1e-04, 3), 0.8), upper = c(rep(0.9999, 3), 0.98), opt.crit = c(\"lik\", \"amse\", \"mse\", \"sigma\", \"mae\"), nmse = 3, bounds = c(\"both\", \"usual\", \"admissible\"), ic = c(\"aicc\", \"aic\", \"bic\"), restrict = TRUE, allow.multiplicative.trend = FALSE, use.initial.values = FALSE, na.action = c(\"na.contiguous\", \"na.interp\", \"na.fail\"), ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential smoothing state space model — ets","text":"y numeric vector time series class ts model Usually three-character string identifying method using framework terminology Hyndman et al. (2002) Hyndman et al. (2008). first letter denotes error type (\"\", \"M\" \"Z\"); second letter denotes trend type (\"N\",\"\",\"M\" \"Z\"); third letter denotes season type (\"N\",\"\",\"M\" \"Z\"). cases, \"N\"=none, \"\"=additive, \"M\"=multiplicative \"Z\"=automatically selected. , example, \"ANN\" simple exponential smoothing additive errors, \"MAM\" multiplicative Holt-Winters' method multiplicative errors, . also possible model class \"ets\", equal output previous call ets. case, model fitted y without re-estimating smoothing parameters. See also use.initial.values argument. damped TRUE, use damped trend (either additive multiplicative). NULL, damped non-damped trends tried best model (according information criterion ic) returned. alpha Value alpha. NULL, estimated. beta Value beta. NULL, estimated. gamma Value gamma. NULL, estimated. phi Value phi. NULL, estimated. additive.TRUE, consider additive models. Default FALSE. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. lambda specified, additive.set TRUE. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. lower Lower bounds parameters (alpha, beta, gamma, phi). Ignored bounds==\"admissible\". upper Upper bounds parameters (alpha, beta, gamma, phi). Ignored bounds==\"admissible\". opt.crit Optimization criterion. One \"mse\" (Mean Square Error), \"amse\" (Average MSE first nmse forecast horizons), \"sigma\" (Standard deviation residuals), \"mae\" (Mean absolute residuals), \"lik\" (Log-likelihood, default). nmse Number steps average multistep MSE (1<=nmse<=30). bounds Type parameter space impose: \"usual\" indicates parameters must lie specified lower upper bounds; \"admissible\" indicates parameters must lie admissible space; \"\" (default) takes intersection regions. ic Information criterion used model selection. restrict TRUE (default), models infinite variance allowed. allow.multiplicative.trend TRUE, models multiplicative trend allowed searching model. Otherwise, model space excludes . argument ignored multiplicative trend model explicitly requested (e.g., using model=\"MMN\"). use.initial.values TRUE model class \"ets\", initial values model also re-estimated. na.action function indicates happen data contains NA values. default, largest contiguous portion time-series used. ... undocumented arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential smoothing state space model — ets","text":"object class \"ets\". generic accessor functions fitted.values residuals extract useful features value returned ets associated functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential smoothing state space model — ets","text":"Based classification methods described Hyndman et al (2008). methodology fully automatic. required argument ets time series. model chosen automatically specified. methodology performed extremely well M3-competition data. (See Hyndman, et al, 2002, .)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Exponential smoothing state space model — ets","text":"Hyndman, R.J., Koehler, .B., Snyder, R.D., Grose, S. (2002) \"state space framework automatic forecasting using exponential smoothing methods\", International J. Forecasting, 18(3), 439--454. Hyndman, R.J., Akram, Md., Archibald, B. (2008) \"admissible parameter space exponential smoothing models\". Annals Statistical Mathematics, 60(2), 407--426. Hyndman, R.J., Koehler, .B., Ord, J.K., Snyder, R.D. (2008) Forecasting exponential smoothing: state space approach, Springer-Verlag. http://www.exponentialsmoothing.net.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Exponential smoothing state space model — ets","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential smoothing state space model — ets","text":"","code":"fit <- ets(USAccDeaths) plot(forecast(fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":null,"dir":"Reference","previous_headings":"","what":"Find dominant frequency of a time series — findfrequency","title":"Find dominant frequency of a time series — findfrequency","text":"findfrequency returns period dominant frequency time series. seasonal data, return seasonal period. cyclic data, return average cycle length.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find dominant frequency of a time series — findfrequency","text":"","code":"findfrequency(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find dominant frequency of a time series — findfrequency","text":"x numeric vector time series class ts","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find dominant frequency of a time series — findfrequency","text":"integer value","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find dominant frequency of a time series — findfrequency","text":"dominant frequency determined spectral analysis time series. First, linear trend removed, spectral density function estimated best fitting autoregressive model (based AIC). large (possibly local) maximum spectral density function frequency \\(f\\), function return period \\(1/f\\) (rounded nearest integer). dominant frequency can found, function return 1.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find dominant frequency of a time series — findfrequency","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find dominant frequency of a time series — findfrequency","text":"","code":"findfrequency(USAccDeaths) # Monthly data #> [1] 12 findfrequency(taylor) # Half-hourly data #> [1] 48 findfrequency(lynx) # Annual data #> [1] 10"},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":null,"dir":"Reference","previous_headings":"","what":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"Returns h-step forecasts data used fitting model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"","code":"# S3 method for ARFIMA fitted(object, h = 1, ...) # S3 method for Arima fitted(object, h = 1, ...) # S3 method for ar fitted(object, ...) # S3 method for bats fitted(object, h = 1, ...) # S3 method for ets fitted(object, h = 1, ...) # S3 method for modelAR fitted(object, h = 1, ...) # S3 method for nnetar fitted(object, h = 1, ...) # S3 method for tbats fitted(object, h = 1, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"object object class \"Arima\", \"bats\", \"tbats\", \"ets\" \"nnetar\". h number steps forecast ahead. ... arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"time series h-step forecasts.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fitted.Arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"h-step in-sample forecasts for time series models. — fitted.ARFIMA","text":"","code":"fit <- ets(WWWusage) plot(WWWusage) lines(fitted(fit), col='red') lines(fitted(fit, h=2), col='green') lines(fitted(fit, h=3), col='blue') legend(\"topleft\", legend=paste(\"h =\",1:3), col=2:4, lty=1)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast-package.html","id":null,"dir":"Reference","previous_headings":"","what":"forecast: Forecasting Functions for Time Series and Linear Models — forecast-package","title":"forecast: Forecasting Functions for Time Series and Linear Models — forecast-package","text":"Methods tools displaying analysing univariate time series forecasts including exponential smoothing via state space models automatic ARIMA modelling.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"forecast: Forecasting Functions for Time Series and Linear Models — forecast-package","text":"Maintainer: Rob Hyndman Rob.Hyndman@monash.edu (ORCID) [copyright holder] Authors: George Athanasopoulos (ORCID) Christoph Bergmeir (ORCID) Gabriel Caceres (ORCID) Leanne Chhay Kirill Kuroptev Mitchell O'Hara-Wild (ORCID) Fotios Petropoulos (ORCID) Slava Razbash Earo Wang (ORCID) Farah Yasmeen (ORCID) contributors: Federico Garza [contributor] Daniele Girolimetto [contributor] Ross Ihaka [contributor, copyright holder] R Core Team [contributor, copyright holder] Daniel Reid [contributor] David Shaub [contributor] Yuan Tang (ORCID) [contributor] Xiaoqian Wang [contributor] Zhenyu Zhou [contributor]","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"Returns forecasts information univariate ARIMA models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"","code":"# S3 method for fracdiff forecast( object, h = 10, level = c(80, 95), fan = FALSE, lambda = object$lambda, biasadj = NULL, ... ) # S3 method for Arima forecast( object, h = ifelse(object$arma[5] > 1, 2 * object$arma[5], 10), level = c(80, 95), fan = FALSE, xreg = NULL, lambda = object$lambda, bootstrap = FALSE, npaths = 5000, biasadj = NULL, ... ) # S3 method for ar forecast( object, h = 10, level = c(80, 95), fan = FALSE, lambda = NULL, bootstrap = FALSE, npaths = 5000, biasadj = FALSE, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"object object class \"Arima\", \"ar\" \"fracdiff\". Usually result call arima, auto.arima, ar, arfima fracdiff. h Number periods forecasting. xreg used, h ignored number forecast periods set number rows xreg. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments. xreg Future values regression variables (class Arima objects ). numerical vector matrix external regressors; data frame. bootstrap TRUE, prediction intervals computed using simulation resampled errors. npaths Number sample paths used computing simulated prediction intervals bootstrap=TRUE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.Arima. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"Arima ar objects, function calls predict.Arima predict.ar constructs object class \"forecast\" results. fracdiff objects, calculations done within forecast.fracdiff using equations given Peiris Perera (1988).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"Peiris, M. & Perera, B. (1988), prediction fractionally differenced ARIMA models, Journal Time Series Analysis, 9(3), 215-220.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.Arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using ARIMA or ARFIMA models — forecast.fracdiff","text":"","code":"fit <- Arima(WWWusage,c(3,1,0)) plot(forecast(fit)) library(fracdiff) x <- fracdiff.sim( 100, ma=-.4, d=.3)$series fit <- arfima(x) plot(forecast(fit,h=30))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using Holt-Winters objects — forecast.HoltWinters","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"Returns forecasts information univariate Holt-Winters time series models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"","code":"# S3 method for HoltWinters forecast( object, h = ifelse(frequency(object$x) > 1, 2 * frequency(object$x), 10), level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"object object class \"HoltWinters\". Usually result call HoltWinters. h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.HoltWinters. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"function calls predict.HoltWinters constructs object class \"forecast\" results. included completeness, ets recommended use instead HoltWinters.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.HoltWinters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using Holt-Winters objects — forecast.HoltWinters","text":"","code":"fit <- HoltWinters(WWWusage,gamma=FALSE) plot(forecast(fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using Structural Time Series models — forecast.StructTS","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"Returns forecasts information univariate structural time series models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"","code":"# S3 method for StructTS forecast( object, h = ifelse(object$coef[\"epsilon\"] > 1e-10, 2 * object$xtsp[3], 10), level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"object object class \"StructTS\". Usually result call StructTS. h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.StructTS. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"function calls predict.StructTS constructs object class \"forecast\" results.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.StructTS.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using Structural Time Series models — forecast.StructTS","text":"","code":"fit <- StructTS(WWWusage,\"level\") plot(forecast(fit))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using a bagged model — forecast.baggedModel","title":"Forecasting using a bagged model — forecast.baggedModel","text":"Returns forecasts information bagged models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using a bagged model — forecast.baggedModel","text":"","code":"# S3 method for baggedModel forecast( object, h = ifelse(frequency(object$y) > 1, 2 * frequency(object$y), 10), ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using a bagged model — forecast.baggedModel","text":"object object class \"baggedModel\" resulting call baggedModel. h Number periods forecasting. ... arguments, passed forecast function original method","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using a bagged model — forecast.baggedModel","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using a bagged model — forecast.baggedModel","text":"Intervals calculated min max values point forecasts models ensemble. .e., intervals prediction intervals, give indication different forecasts within ensemble .","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasting using a bagged model — forecast.baggedModel","text":"Bergmeir, C., R. J. Hyndman, J. M. Benitez (2016). Bagging Exponential Smoothing Methods using STL Decomposition Box-Cox Transformation. International Journal Forecasting 32, 303-312.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using a bagged model — forecast.baggedModel","text":"Christoph Bergmeir, Fotios Petropoulos","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.baggedModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using a bagged model — forecast.baggedModel","text":"","code":"fit <- baggedModel(WWWusage) fcast <- forecast(fit) plot(fcast) if (FALSE) { fit2 <- baggedModel(WWWusage, fn=\"auto.arima\") fcast2 <- forecast(fit2) plot(fcast2) accuracy(fcast2)}"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using BATS and TBATS models — forecast.bats","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"Forecasts h steps ahead BATS model. Prediction intervals also produced.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"","code":"# S3 method for bats forecast(object, h, level = c(80, 95), fan = FALSE, biasadj = NULL, ...) # S3 method for tbats forecast(object, h, level = c(80, 95), fan = FALSE, biasadj = NULL, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"object object class \"bats\". Usually result call bats. h Number periods forecasting. Default value twice largest seasonal period (seasonal data) ten (non-seasonal data). level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. biasadj Use adjusted back-transformed mean Box-Cox transformations. TRUE, point forecasts fitted values mean forecast. Otherwise, points can considered median forecast densities. ... arguments, currently ignored.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.bats. object class \"forecast\" list containing least following elements: model copy bats object method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"De Livera, .M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series complex seasonal patterns using exponential smoothing, Journal American Statistical Association, 106(496), 1513-1527.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.bats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using BATS and TBATS models — forecast.bats","text":"","code":"if (FALSE) { fit <- bats(USAccDeaths) plot(forecast(fit)) taylor.fit <- bats(taylor) plot(forecast(taylor.fit)) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using ETS models — forecast.ets","title":"Forecasting using ETS models — forecast.ets","text":"Returns forecasts information univariate ETS models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using ETS models — forecast.ets","text":"","code":"# S3 method for ets forecast( object, h = ifelse(object$m > 1, 2 * object$m, 10), level = c(80, 95), fan = FALSE, simulate = FALSE, bootstrap = FALSE, npaths = 5000, PI = TRUE, lambda = object$lambda, biasadj = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using ETS models — forecast.ets","text":"object object class \"ets\". Usually result call ets. h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. simulate TRUE, prediction intervals produced simulation rather using analytic formulae. Errors assumed normally distributed. bootstrap TRUE, prediction intervals produced simulation using resampled errors (rather normally distributed errors). npaths Number sample paths used computing simulated prediction intervals. PI TRUE, prediction intervals produced, otherwise point forecasts calculated. PI FALSE, level, fan, simulate, bootstrap npaths ignored. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using ETS models — forecast.ets","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.ets. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. models additive errors, residuals x - fitted values. models multiplicative errors, residuals equal x /(fitted values) - 1. fitted Fitted values (one-step forecasts)","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using ETS models — forecast.ets","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using ETS models — forecast.ets","text":"","code":"fit <- ets(USAccDeaths) plot(forecast(fit,h=48))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast a linear model with possible time series components — forecast.lm","title":"Forecast a linear model with possible time series components — forecast.lm","text":"forecast.lm used predict linear models, especially involving trend seasonality components.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast a linear model with possible time series components — forecast.lm","text":"","code":"# S3 method for lm forecast( object, newdata, h = 10, level = c(80, 95), fan = FALSE, lambda = object$lambda, biasadj = NULL, ts = TRUE, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast a linear model with possible time series components — forecast.lm","text":"object Object class \"lm\", usually result call lm tslm. newdata optional data frame look variables predict. omitted, assumed variables trend season, h forecasts produced. h Number periods forecasting. Ignored newdata present. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ts TRUE, forecasts treated time series provided original data time series; newdata interpreted related subsequent time periods. FALSE, time series attributes original data ignored. ... arguments passed predict.lm().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast a linear model with possible time series components — forecast.lm","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.lm. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x historical data response variable. residuals Residuals fitted model. x minus fitted values. fitted Fitted values","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast a linear model with possible time series components — forecast.lm","text":"forecast.lm largely wrapper predict.lm() except allows variables \"trend\" \"season\" created fly time series characteristics data. Also, output reformatted forecast object.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast a linear model with possible time series components — forecast.lm","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.lm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast a linear model with possible time series components — forecast.lm","text":"","code":"y <- ts(rnorm(120,0,3) + 1:120 + 20*sin(2*pi*(1:120)/12), frequency=12) fit <- tslm(y ~ trend + season) plot(forecast(fit, h=20))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast a multiple linear model with possible time series components — forecast.mlm","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"forecast.mlm used predict multiple linear models, especially involving trend seasonality components.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"","code":"# S3 method for mlm forecast( object, newdata, h = 10, level = c(80, 95), fan = FALSE, lambda = object$lambda, biasadj = NULL, ts = TRUE, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"object Object class \"mlm\", usually result call lm tslm. newdata optional data frame look variables predict. omitted, assumed variables trend season, h forecasts produced. h Number periods forecasting. Ignored newdata present. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ts TRUE, forecasts treated time series provided original data time series; newdata interpreted related subsequent time periods. FALSE, time series attributes original data ignored. ... arguments passed forecast.lm().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"object class \"mforecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.lm. object class \"mforecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts multivariate time series lower Lower limits prediction intervals series upper Upper limits prediction intervals series level confidence values associated prediction intervals x historical data response variable. residuals Residuals fitted model. x minus fitted values. fitted Fitted values","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"forecast.mlm largely wrapper forecast.lm() except allows forecasts generated multiple series. Also, output reformatted mforecast object.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mlm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast a multiple linear model with possible time series components — forecast.mlm","text":"","code":"lungDeaths <- cbind(mdeaths, fdeaths) fit <- tslm(lungDeaths ~ trend + season) fcast <- forecast(fit, h=10) carPower <- as.matrix(mtcars[,c(\"qsec\",\"hp\")]) carmpg <- mtcars[,\"mpg\"] fit <- lm(carPower ~ carmpg) fcast <- forecast(fit, newdata=data.frame(carmpg=30))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using user-defined model — forecast.modelAR","title":"Forecasting using user-defined model — forecast.modelAR","text":"Returns forecasts information user-defined models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using user-defined model — forecast.modelAR","text":"","code":"# S3 method for modelAR forecast( object, h = ifelse(object$m > 1, 2 * object$m, 10), PI = FALSE, level = c(80, 95), fan = FALSE, xreg = NULL, lambda = object$lambda, bootstrap = FALSE, npaths = 1000, innov = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using user-defined model — forecast.modelAR","text":"object object class \"modelAR\" resulting call modelAR. h Number periods forecasting. xreg used, h ignored number forecast periods set number rows xreg. PI TRUE, prediction intervals produced, otherwise point forecasts calculated. PI FALSE, level, fan, bootstrap npaths ignored. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. xreg Future values external regressor variables. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. bootstrap TRUE, prediction intervals computed using simulations resampled residuals rather normally distributed errors. Ignored innov NULL. npaths Number sample paths used computing simulated prediction intervals. innov Values use innovations prediction intervals. Must matrix h rows npaths columns (vectors coerced matrix). present, bootstrap ignored. ... Additional arguments passed simulate.nnetar","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using user-defined model — forecast.modelAR","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.nnetar. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) ... arguments","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using user-defined model — forecast.modelAR","text":"Prediction intervals calculated simulations can slow. Note model complex overfits data, residuals can arbitrarily small; used prediction interval calculations, lead misleadingly small values.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.modelAR.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using user-defined model — forecast.modelAR","text":"Rob J Hyndman Gabriel Caceres","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting time series — forecast.mts","title":"Forecasting time series — forecast.mts","text":"mforecast class objects forecasting multivariate time series multivariate time series models. function invokes particular methods depend class first argument.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting time series — forecast.mts","text":"","code":"# S3 method for mts forecast( object, h = ifelse(frequency(object) > 1, 2 * frequency(object), 10), level = c(80, 95), fan = FALSE, robust = FALSE, lambda = NULL, biasadj = FALSE, find.frequency = FALSE, allow.multiplicative.trend = FALSE, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting time series — forecast.mts","text":"object multivariate time series multivariate time series model forecasts required h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. robust TRUE, function robust missing values outliers object. argument valid object class mts. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. find.frequency TRUE, function determines appropriate period, data unknown period. allow.multiplicative.trend TRUE, ETS models multiplicative trends allowed. Otherwise, additive trend ETS models permitted. ... Additional arguments affecting forecasts produced.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting time series — forecast.mts","text":"object class \"mforecast\". function summary used obtain print summary results, function plot produces plot multivariate forecasts prediction intervals. generic accessors functions fitted.values residuals extract various useful features value returned forecast$model. object class \"mforecast\" list usually containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. models additive errors, residuals x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting time series — forecast.mts","text":"example, function forecast.mlm makes multivariate forecasts based results produced tslm.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.mts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting time series — forecast.mts","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using neural network models — forecast.nnetar","title":"Forecasting using neural network models — forecast.nnetar","text":"Returns forecasts information univariate neural network models.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using neural network models — forecast.nnetar","text":"","code":"# S3 method for nnetar forecast( object, h = ifelse(object$m > 1, 2 * object$m, 10), PI = FALSE, level = c(80, 95), fan = FALSE, xreg = NULL, lambda = object$lambda, bootstrap = FALSE, npaths = 1000, innov = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using neural network models — forecast.nnetar","text":"object object class \"nnetar\" resulting call nnetar. h Number periods forecasting. xreg used, h ignored number forecast periods set number rows xreg. PI TRUE, prediction intervals produced, otherwise point forecasts calculated. PI FALSE, level, fan, bootstrap npaths ignored. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. xreg Future values external regressor variables. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. bootstrap TRUE, prediction intervals computed using simulations resampled residuals rather normally distributed errors. Ignored innov NULL. npaths Number sample paths used computing simulated prediction intervals. innov Values use innovations prediction intervals. Must matrix h rows npaths columns (vectors coerced matrix). present, bootstrap ignored. ... Additional arguments passed simulate.nnetar","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using neural network models — forecast.nnetar","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned forecast.nnetar. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) ... arguments","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using neural network models — forecast.nnetar","text":"Prediction intervals calculated simulations can slow. Note network complex overfits data, residuals can arbitrarily small; used prediction interval calculations, lead misleadingly small values. possible use --sample residuals ameliorate , see examples.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using neural network models — forecast.nnetar","text":"Rob J Hyndman Gabriel Caceres","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.nnetar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using neural network models — forecast.nnetar","text":"","code":"## Fit & forecast model fit <- nnetar(USAccDeaths, size=2) fcast <- forecast(fit, h=20) plot(fcast) if (FALSE) { ## Include prediction intervals in forecast fcast2 <- forecast(fit, h=20, PI=TRUE, npaths=100) plot(fcast2) ## Set up out-of-sample innovations using cross-validation fit_cv <- CVar(USAccDeaths, size=2) res_sd <- sd(fit_cv$residuals, na.rm=TRUE) myinnovs <- rnorm(20*100, mean=0, sd=res_sd) ## Forecast using new innovations fcast3 <- forecast(fit, h=20, PI=TRUE, npaths=100, innov=myinnovs) plot(fcast3) }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting using stl objects — forecast.stl","title":"Forecasting using stl objects — forecast.stl","text":"Forecasts STL objects obtained applying non-seasonal forecasting method seasonally adjusted data re-seasonalizing using last year seasonal component.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting using stl objects — forecast.stl","text":"","code":"# S3 method for stl forecast( object, method = c(\"ets\", \"arima\", \"naive\", \"rwdrift\"), etsmodel = \"ZZN\", forecastfunction = NULL, h = frequency(object$time.series) * 2, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = NULL, xreg = NULL, newxreg = NULL, allow.multiplicative.trend = FALSE, ... ) stlm( y, s.window = 7 + 4 * seq(6), robust = FALSE, method = c(\"ets\", \"arima\"), modelfunction = NULL, model = NULL, etsmodel = \"ZZN\", lambda = NULL, biasadj = FALSE, xreg = NULL, allow.multiplicative.trend = FALSE, x = y, ... ) # S3 method for stlm forecast( object, h = 2 * object$m, level = c(80, 95), fan = FALSE, lambda = object$lambda, biasadj = NULL, newxreg = NULL, allow.multiplicative.trend = FALSE, ... ) stlf( y, h = frequency(x) * 2, s.window = 7 + 4 * seq(6), t.window = NULL, robust = FALSE, lambda = NULL, biasadj = FALSE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting using stl objects — forecast.stl","text":"object object class stl stlm. Usually result call stl stlm. method Method use forecasting seasonally adjusted series. etsmodel ets model specification passed ets. default allows non-seasonal model. method!=\"ets\", argument ignored. forecastfunction alternative way specifying function forecasting seasonally adjusted series. forecastfunction NULL, method ignored. Otherwise method used specify forecasting method used. h Number periods forecasting. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. xreg Historical regressors used auto.arima() method==\"arima\". newxreg Future regressors used forecast.Arima(). allow.multiplicative.trend TRUE, ETS models multiplicative trends allowed. Otherwise, additive trend ETS models permitted. ... arguments passed forecast.stl, modelfunction forecastfunction. y univariate numeric time series class ts s.window Either character string ``periodic'' span (lags) loess window seasonal extraction. robust TRUE, robust fitting used loess procedure within stl. modelfunction alternative way specifying function modelling seasonally adjusted series. modelfunction NULL, method ignored. Otherwise method used specify time series model used. model Output previous call stlm. stlm model passed, model fitted y without re-estimating parameters. x Deprecated. Included backwards compatibility. t.window number control smoothness trend. See stl details.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting using stl objects — forecast.stl","text":"stlm returns object class stlm. functions return objects class forecast. many methods working forecast objects including summary obtain print summary results, plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting using stl objects — forecast.stl","text":"stlm takes time series y, applies STL decomposition, models seasonally adjusted data using model passed modelfunction specified using method. returns object includes original STL decomposition time series model fitted seasonally adjusted data. object can passed forecast.stlm forecasting. forecast.stlm forecasts seasonally adjusted data, re-seasonalizes results adding back last year estimated seasonal component. stlf combines stlm forecast.stlm. takes ts argument, applies STL decomposition, models seasonally adjusted data, reseasonalizes, returns forecasts. However, allows general forecasting methods specified via forecastfunction. forecast.stl similar stlf except takes STL decomposition first argument, instead time series. Note prediction intervals ignore uncertainty associated seasonal component. computed using prediction intervals seasonally adjusted series, reseasonalized using last year seasonal component. uncertainty seasonal component ignored. time series model seasonally adjusted data can specified stlm using either method modelfunction. method argument provides shorthand way specifying modelfunction special cases. generally, modelfunction can function first argument ts object, returns object can passed forecast. example, forecastfunction=ar uses ar function modelling seasonally adjusted series. forecasting method seasonally adjusted data can specified stlf forecast.stl using either method forecastfunction. method argument provides shorthand way specifying forecastfunction special cases. generally, forecastfunction can function first argument ts object, h level, returns object class forecast. example, forecastfunction=thetaf uses thetaf function forecasting seasonally adjusted series.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting using stl objects — forecast.stl","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.stl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting using stl objects — forecast.stl","text":"","code":"tsmod <- stlm(USAccDeaths, modelfunction = ar) plot(forecast(tsmod, h = 36)) decomp <- stl(USAccDeaths, s.window = \"periodic\") plot(forecast(decomp)) plot(stlf(AirPassengers, lambda = 0))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecasting time series — forecast.ts","title":"Forecasting time series — forecast.ts","text":"forecast generic function forecasting time series time series models. function invokes particular methods depend class first argument.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecasting time series — forecast.ts","text":"","code":"# S3 method for ts forecast( object, h = ifelse(frequency(object) > 1, 2 * frequency(object), 10), level = c(80, 95), fan = FALSE, robust = FALSE, lambda = NULL, biasadj = FALSE, find.frequency = FALSE, allow.multiplicative.trend = FALSE, model = NULL, ... ) # S3 method for default forecast(object, ...) # S3 method for forecast print(x, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecasting time series — forecast.ts","text":"object time series time series model forecasts required h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. robust TRUE, function robust missing values outliers object. argument valid object class ts. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. find.frequency TRUE, function determines appropriate period, data unknown period. allow.multiplicative.trend TRUE, ETS models multiplicative trends allowed. Otherwise, additive trend ETS models permitted. model object describing time series model; e.g., one class ets, Arima, bats, tbats, nnetar. ... Additional arguments affecting forecasts produced. model=NULL, forecast.ts passes ets stlf depending frequency time series. model NULL, arguments passed relevant modelling function. x numeric vector time series class ts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecasting time series — forecast.ts","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessors functions fitted.values residuals extract various useful features value returned forecast$model. object class \"forecast\" list usually containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. models additive errors, residuals x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecasting time series — forecast.ts","text":"example, function forecast.Arima makes forecasts based results produced arima. model=NULL,function forecast.ts makes forecasts using ets models (data non-seasonal seasonal period 12 less) stlf (seasonal period 13 ). model NULL, forecast.ts apply model object time series, generate forecasts accordingly.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecasting time series — forecast.ts","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/forecast.ts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecasting time series — forecast.ts","text":"","code":"WWWusage %>% forecast %>% plot fit <- ets(window(WWWusage, end=60)) fc <- forecast(WWWusage, model=fit) #> Model is being refit with current smoothing parameters but initial states are being re-estimated. #> Set 'use.initial.values=TRUE' if you want to re-use existing initial values."},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":null,"dir":"Reference","previous_headings":"","what":"Fourier terms for modelling seasonality — fourier","title":"Fourier terms for modelling seasonality — fourier","text":"fourier returns matrix containing terms Fourier series, order K, suitable use Arima, auto.arima, tslm.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fourier terms for modelling seasonality — fourier","text":"","code":"fourier(x, K, h = NULL) fourierf(x, K, h)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fourier terms for modelling seasonality — fourier","text":"x Seasonal time series: ts msts object K Maximum order(s) Fourier terms h Number periods ahead forecast (optional)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fourier terms for modelling seasonality — fourier","text":"Numerical matrix.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fourier terms for modelling seasonality — fourier","text":"fourierf deprecated, instead use h argument fourier. period Fourier terms determined time series characteristics x. h missing, length x also determines number rows matrix returned fourier. Otherwise, value h determines number rows matrix returned fourier, typically used forecasting. values within x used. Typical use omit h generating Fourier terms training model include h generating Fourier terms forecasting. x ts object, value K integer specifies number sine cosine terms return. Thus, matrix returned 2*K columns. x msts object, K vector integers specifying number sine cosine terms seasonal periods. matrix returned 2*sum(K) columns.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fourier terms for modelling seasonality — fourier","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/fourier.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fourier terms for modelling seasonality — fourier","text":"","code":"library(ggplot2) # Using Fourier series for a \"ts\" object # K is chosen to minimize the AICc deaths.model <- auto.arima(USAccDeaths, xreg=fourier(USAccDeaths,K=5), seasonal=FALSE) deaths.fcast <- forecast(deaths.model, xreg=fourier(USAccDeaths, K=5, h=36)) autoplot(deaths.fcast) + xlab(\"Year\") # Using Fourier series for a \"msts\" object taylor.lm <- tslm(taylor ~ fourier(taylor, K = c(3, 3))) taylor.fcast <- forecast(taylor.lm, data.frame(fourier(taylor, K = c(3, 3), h = 270))) autoplot(taylor.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":null,"dir":"Reference","previous_headings":"","what":"Australian monthly gas production — gas","title":"Australian monthly gas production — gas","text":"Australian monthly gas production: 1956--1995.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Australian monthly gas production — gas","text":"","code":"gas"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Australian monthly gas production — gas","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Australian monthly gas production — gas","text":"Australian Bureau Statistics.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gas.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Australian monthly gas production — gas","text":"","code":"plot(gas) seasonplot(gas) tsdisplay(gas)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast plot — StatForecast","title":"Forecast plot — StatForecast","text":"Generates forecasts forecast.ts adds plot. Forecasts can modified via sending forecast specific arguments .","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast plot — StatForecast","text":"","code":"StatForecast GeomForecast geom_forecast( mapping = NULL, data = NULL, stat = \"forecast\", position = \"identity\", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, PI = TRUE, showgap = TRUE, series = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Forecast plot — StatForecast","text":"object class StatForecast (inherits Stat, ggproto, gg) length 3. object class GeomForecast (inherits Geom, ggproto, gg) length 7.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast plot — StatForecast","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot. data.frame, object, override plot data. objects fortified produce data frame. See fortify variables created. function called single argument, plot data. return value must data.frame, used layer data. stat stat object use calculate data. position Position adjustment, either string, result call position adjustment function. na.rm FALSE (default), removes missing values warning. TRUE silently removes missing values. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders. PI FALSE, confidence intervals plotted, giving forecast line. showgap showgap=FALSE, gap historical observations forecasts removed. series Matches unidentified forecast layer coloured object plot. ... Additional arguments forecast.ts, arguments passed layer. often aesthetics, used set aesthetic fixed value, like color = \"red\" alpha = .5. may also parameters paired geom/stat.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast plot — StatForecast","text":"layer ggplot graph.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast plot — StatForecast","text":"Multivariate forecasting supported time series different group. can also pass geom_forecast forecast object add plot. aesthetics required forecasting work includes forecast observations y axis, time observations x axis. Refer examples . automatically set aesthetics, use autoplot.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast plot — StatForecast","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/geom_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast plot — StatForecast","text":"","code":"if (FALSE) { library(ggplot2) autoplot(USAccDeaths) + geom_forecast() lungDeaths <- cbind(mdeaths, fdeaths) autoplot(lungDeaths) + geom_forecast() # Using fortify.ts p <- ggplot(aes(x=x, y=y), data=USAccDeaths) p <- p + geom_line() p + geom_forecast() # Without fortify.ts data <- data.frame(USAccDeaths=as.numeric(USAccDeaths), time=as.numeric(time(USAccDeaths))) p <- ggplot(aes(x=time, y=USAccDeaths), data=data) p <- p + geom_line() p + geom_forecast() p + geom_forecast(h=60) p <- ggplot(aes(x=time, y=USAccDeaths), data=data) p + geom_forecast(level=c(70,98)) p + geom_forecast(level=c(70,98),colour=\"lightblue\") #Add forecasts to multivariate series with colour groups lungDeaths <- cbind(mdeaths, fdeaths) autoplot(lungDeaths) + geom_forecast(forecast(mdeaths), series=\"mdeaths\") }"},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":null,"dir":"Reference","previous_headings":"","what":"Get response variable from time series model. — getResponse","title":"Get response variable from time series model. — getResponse","text":"getResponse generic function extracting historical data time series model (including Arima, ets, ar, fracdiff), linear model class lm, forecast object. function invokes particular methods depend class first argument.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get response variable from time series model. — getResponse","text":"","code":"getResponse(object, ...) # S3 method for default getResponse(object, ...) # S3 method for lm getResponse(object, ...) # S3 method for Arima getResponse(object, ...) # S3 method for fracdiff getResponse(object, ...) # S3 method for ar getResponse(object, ...) # S3 method for tbats getResponse(object, ...) # S3 method for bats getResponse(object, ...) # S3 method for mforecast getResponse(object, ...) # S3 method for baggedModel getResponse(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get response variable from time series model. — getResponse","text":"object time series model forecast object. ... Additional arguments ignored.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get response variable from time series model. — getResponse","text":"numerical vector time series object class ts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/getResponse.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get response variable from time series model. — getResponse","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Histogram with optional normal and kernel density functions — gghistogram","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"Plots histogram density estimates using ggplot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"","code":"gghistogram( x, add.normal = FALSE, add.kde = FALSE, add.rug = TRUE, bins, boundary = 0 )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"x numerical vector. add.normal Add normal density function comparison add.kde Add kernel density estimate comparison add.rug Add rug plot horizontal axis bins number bins use histogram. Selected default using Friedman-Diaconis rule given nclass.FD boundary boundary two bins.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"None.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gghistogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Histogram with optional normal and kernel density functions — gghistogram","text":"","code":"gghistogram(lynx, add.kde=TRUE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Time series lag ggplots — gglagplot","title":"Time series lag ggplots — gglagplot","text":"Plots lag plot using ggplot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time series lag ggplots — gglagplot","text":"","code":"gglagplot( x, lags = ifelse(frequency(x) > 9, 16, 9), set.lags = 1:lags, diag = TRUE, diag.col = \"gray\", do.lines = TRUE, colour = TRUE, continuous = frequency(x) > 12, labels = FALSE, seasonal = TRUE, ... ) gglagchull( x, lags = ifelse(frequency(x) > 1, min(12, frequency(x)), 4), set.lags = 1:lags, diag = TRUE, diag.col = \"gray\", ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time series lag ggplots — gglagplot","text":"x time series object (type ts). lags number lag plots desired, see arg set.lags. set.lags vector positive integers specifying lags use. diag logical indicating x=y diagonal drawn. diag.col color used diagonal (diag). .lines TRUE, lines drawn, otherwise points drawn. colour logical indicating lines coloured. continuous colour scheme years continuous discrete? labels logical indicating labels used. seasonal line colour based seasonal characteristics (TRUE), sequential (FALSE). ... used (consistency lag.plot)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time series lag ggplots — gglagplot","text":"None.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time series lag ggplots — gglagplot","text":"“gglagplot” plot time series lagged versions . Helps visualising 'auto-dependence' even auto-correlations vanish. “gglagchull” layer convex hulls lags, layered single plot. helps visualise change 'auto-dependence' lags increase.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time series lag ggplots — gglagplot","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gglagplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time series lag ggplots — gglagplot","text":"","code":"gglagplot(woolyrnq) gglagplot(woolyrnq,seasonal=FALSE) lungDeaths <- cbind(mdeaths, fdeaths) gglagplot(lungDeaths, lags=2) gglagchull(lungDeaths, lags=6) gglagchull(woolyrnq)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a seasonal subseries ggplot — ggmonthplot","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"Plots subseries plot using ggplot. season plotted separate mini time series. blue lines represent mean observations within season.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"","code":"ggmonthplot(x, labels = NULL, times = time(x), phase = cycle(x), ...) ggsubseriesplot(x, labels = NULL, times = time(x), phase = cycle(x), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"x time series object (type ts). labels vector labels use 'season' times vector times observation phase vector seasonal components ... used (consistency monthplot)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"Returns object class ggplot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"ggmonthplot function simply wrapper ggsubseriesplot convenience users familiar monthplot.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ggmonthplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a seasonal subseries ggplot — ggmonthplot","text":"","code":"ggsubseriesplot(AirPassengers) ggsubseriesplot(woolyrnq)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gold.html","id":null,"dir":"Reference","previous_headings":"","what":"Daily morning gold prices — gold","title":"Daily morning gold prices — gold","text":"Daily morning gold prices US dollars. 1 January 1985 -- 31 March 1989.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gold.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Daily morning gold prices — gold","text":"","code":"gold"},{"path":"https://pkg.robjhyndman.com/forecast/reference/gold.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Daily morning gold prices — gold","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/gold.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Daily morning gold prices — gold","text":"","code":"tsdisplay(gold)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.constant.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object constant? — is.constant","title":"Is an object constant? — is.constant","text":"Returns true object's numerical values vary.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.constant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object constant? — is.constant","text":"","code":"is.constant(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.constant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object constant? — is.constant","text":"x object tested","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a particular model type? — is.acf","title":"Is an object a particular model type? — is.acf","text":"Returns true model object particular type","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a particular model type? — is.acf","text":"","code":"is.acf(x) is.Arima(x) is.baggedModel(x) is.bats(x) is.ets(x) is.modelAR(x) is.stlm(x) is.nnetar(x) is.nnetarmodels(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a particular model type? — is.acf","text":"x object tested","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Is an object a particular forecast type? — is.forecast","title":"Is an object a particular forecast type? — is.forecast","text":"Returns true forecast object particular type","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Is an object a particular forecast type? — is.forecast","text":"","code":"is.forecast(x) is.mforecast(x) is.splineforecast(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/is.forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Is an object a particular forecast type? — is.forecast","text":"x object tested","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":null,"dir":"Reference","previous_headings":"","what":"Moving-average smoothing — ma","title":"Moving-average smoothing — ma","text":"ma computes simple moving average smoother given time series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Moving-average smoothing — ma","text":"","code":"ma(x, order, centre = TRUE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Moving-average smoothing — ma","text":"x Univariate time series order Order moving average smoother centre TRUE, moving average centred even orders.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Moving-average smoothing — ma","text":"Numerical time series object containing simple moving average smoothed values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Moving-average smoothing — ma","text":"moving average smoother averages nearest order periods observation. neighbouring observations time series likely similar value, averaging eliminates randomness data, leaving smooth trend-cycle component. $$\\hat{T}_{t} = \\frac{1}{m} \\sum_{j=-k}^k y_{t+j}$$ \\(k=\\frac{m-1}{2}\\) even order specified, observations averaged include one observation future past (k rounded ). centre TRUE, value two moving averages (k rounded respectively) averaged, centering moving average.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Moving-average smoothing — ma","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ma.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Moving-average smoothing — ma","text":"","code":"plot(wineind) sm <- ma(wineind,order=12) lines(sm,col=\"red\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":null,"dir":"Reference","previous_headings":"","what":"Mean Forecast — meanf","title":"Mean Forecast — meanf","text":"Returns forecasts prediction intervals iid model applied y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mean Forecast — meanf","text":"","code":"meanf( y, h = 10, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, bootstrap = FALSE, npaths = 5000, x = y )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mean Forecast — meanf","text":"y numeric vector time series class ts h Number periods forecasting level Confidence levels prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. bootstrap TRUE, use bootstrap method compute prediction intervals. Otherwise, assume normal distribution. npaths Number bootstrapped sample paths use bootstrap==TRUE. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mean Forecast — meanf","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned meanf. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Mean Forecast — meanf","text":"iid model $$Y_t=\\mu + Z_t$$ \\(Z_t\\) normal iid error. Forecasts given $$Y_n(h)=\\mu$$ \\(\\mu\\) estimated sample mean.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Mean Forecast — meanf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/meanf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mean Forecast — meanf","text":"","code":"nile.fcast <- meanf(Nile, h=10) plot(nile.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":null,"dir":"Reference","previous_headings":"","what":"Time Series Forecasts with a user-defined model — modelAR","title":"Time Series Forecasts with a user-defined model — modelAR","text":"Experimental function forecast univariate time series user-defined model","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time Series Forecasts with a user-defined model — modelAR","text":"","code":"modelAR( y, p, P = 1, FUN, predict.FUN, xreg = NULL, lambda = NULL, model = NULL, subset = NULL, scale.inputs = FALSE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time Series Forecasts with a user-defined model — modelAR","text":"y numeric vector time series class ts. p Embedding dimension non-seasonal time series. Number non-seasonal lags used inputs. non-seasonal time series, default optimal number lags (according AIC) linear AR(p) model. seasonal time series, method used applied seasonally adjusted data (stl decomposition). P Number seasonal lags used inputs. FUN Function used model fitting. Must accept argument x y predictors response, respectively (formula object currently supported). predict.FUN Prediction function used apply FUN new data. Must accept object class FUN first argument, data frame matrix new data second argument. Additionally, return fitted values new data omitted. xreg Optionally, vector matrix external regressors, must number rows y. Must numeric. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. model Output previous call nnetar. model passed, model fitted y without re-estimating parameters. subset Optional vector specifying subset observations used fit. Can integer index vector logical vector length y. observations used default. scale.inputs TRUE, inputs scaled subtracting column means dividing respective standard deviations. lambda NULL, scaling applied Box-Cox transformation. x Deprecated. Included backwards compatibility. ... arguments passed FUN modelAR.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time Series Forecasts with a user-defined model — modelAR","text":"Returns object class \"modelAR\". function summary used obtain print summary results. generic accessor functions fitted.values residuals extract useful features value returned nnetar. model list containing information fitted model method name forecasting method character string x original time series. xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) ... arguments","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time Series Forecasts with a user-defined model — modelAR","text":"experimental function recommended advanced users. selected model fitted lagged values y inputs. inputs lags 1 p, lags m mP m=frequency(y). xreg provided, columns also used inputs. missing values y xreg, corresponding rows (others depend lags) omitted fit. model trained one-step forecasting. Multi-step forecasts computed recursively.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modelAR.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time Series Forecasts with a user-defined model — modelAR","text":"Rob J Hyndman Gabriel Caceres","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modeldf.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute model degrees of freedom — modeldf","title":"Compute model degrees of freedom — modeldf","text":"Compute model degrees freedom","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/modeldf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute model degrees of freedom — modeldf","text":"","code":"modeldf(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/modeldf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute model degrees of freedom — modeldf","text":"object time series model ... arguments currently ignored","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":null,"dir":"Reference","previous_headings":"","what":"Number of days in each season — monthdays","title":"Number of days in each season — monthdays","text":"Returns number days month quarter observed time period.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number of days in each season — monthdays","text":"","code":"monthdays(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number of days in each season — monthdays","text":"x time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number of days in each season — monthdays","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Number of days in each season — monthdays","text":"Useful month length adjustments","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Number of days in each season — monthdays","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/monthdays.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number of days in each season — monthdays","text":"","code":"par(mfrow=c(2,1)) plot(ldeaths,xlab=\"Year\",ylab=\"pounds\", main=\"Monthly deaths from lung disease (UK)\") ldeaths.adj <- ldeaths/monthdays(ldeaths)*365.25/12 plot(ldeaths.adj,xlab=\"Year\",ylab=\"pounds\", main=\"Adjusted monthly deaths from lung disease (UK)\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/mstl.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiple seasonal decomposition — mstl","title":"Multiple seasonal decomposition — mstl","text":"Decompose time series seasonal, trend remainder components. Seasonal components estimated iteratively using STL. Multiple seasonal periods allowed. trend component computed last iteration STL. Non-seasonal time series decomposed trend remainder . case, supsmu used estimate trend. Optionally, time series may Box-Cox transformed decomposition. Unlike stl, mstl completely automated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/mstl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiple seasonal decomposition — mstl","text":"","code":"mstl(x, lambda = NULL, iterate = 2, s.window = 7 + 4 * seq(6), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/mstl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiple seasonal decomposition — mstl","text":"x Univariate time series class msts ts. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. iterate Number iterations use refine seasonal component. s.window Seasonal windows used decompositions. scalar, value used seasonal components. Otherwise, vector length number seasonal components (longer). ... arguments passed stl.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/mstl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multiple seasonal decomposition — mstl","text":"","code":"library(ggplot2) mstl(taylor) %>% autoplot() mstl(AirPassengers, lambda = \"auto\") %>% autoplot()"},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":null,"dir":"Reference","previous_headings":"","what":"Multi-Seasonal Time Series — msts","title":"Multi-Seasonal Time Series — msts","text":"msts S3 class multi seasonal time series objects, intended used models support multiple seasonal periods. msts class inherits ts class additional \"msts\" attribute contains vector seasonal periods. methods work ts class, also work msts class.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multi-Seasonal Time Series — msts","text":"","code":"msts(data, seasonal.periods, ts.frequency = floor(max(seasonal.periods)), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multi-Seasonal Time Series — msts","text":"data numeric vector, ts object, matrix data frame. intended time series data univariate, otherwise treated ts(). seasonal.periods vector seasonal periods msts. ts.frequency seasonal period used frequency underlying ts object. default value max(seasonal.periods). ... Arguments passed underlying call ts(). example start=c(1987,5).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multi-Seasonal Time Series — msts","text":"object class c(\"msts\", \"ts\"). one seasonal period (.e., length(seasonal.periods)==1), object class \"ts\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multi-Seasonal Time Series — msts","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/msts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multi-Seasonal Time Series — msts","text":"","code":"x <- msts(taylor, seasonal.periods=c(2*24,2*24*7,2*24*365), start=2000+22/52) y <- msts(USAccDeaths, seasonal.periods=12, start=1949)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":null,"dir":"Reference","previous_headings":"","what":"Interpolate missing values in a time series — na.interp","title":"Interpolate missing values in a time series — na.interp","text":"default, uses linear interpolation non-seasonal series. seasonal series, robust STL decomposition first computed. linear interpolation applied seasonally adjusted data, seasonal component added back.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Interpolate missing values in a time series — na.interp","text":"","code":"na.interp( x, lambda = NULL, linear = (frequency(x) <= 1 | sum(!is.na(x)) <= 2 * frequency(x)) )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Interpolate missing values in a time series — na.interp","text":"x time series lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. linear linear interpolation used.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Interpolate missing values in a time series — na.interp","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Interpolate missing values in a time series — na.interp","text":"general flexible approach available using na.approx zoo package.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Interpolate missing values in a time series — na.interp","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/na.interp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Interpolate missing values in a time series — na.interp","text":"","code":"data(gold) plot(na.interp(gold))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":null,"dir":"Reference","previous_headings":"","what":"Naive and Random Walk Forecasts — rwf","title":"Naive and Random Walk Forecasts — rwf","text":"rwf() returns forecasts prediction intervals random walk drift model applied y. equivalent ARIMA(0,1,0) model optional drift coefficient. naive() simply wrapper rwf() simplicity. snaive() returns forecasts prediction intervals ARIMA(0,0,0)(0,1,0)m model m seasonal period.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Naive and Random Walk Forecasts — rwf","text":"","code":"rwf( y, h = 10, drift = FALSE, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, ..., x = y ) naive( y, h = 10, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, ..., x = y ) snaive( y, h = 2 * frequency(x), level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, ..., x = y )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Naive and Random Walk Forecasts — rwf","text":"y numeric vector time series class ts h Number periods forecasting drift Logical flag. TRUE, fits random walk drift model. level Confidence levels prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... Additional arguments affecting forecasts produced. model=NULL, forecast.ts passes ets stlf depending frequency time series. model NULL, arguments passed relevant modelling function. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Naive and Random Walk Forecasts — rwf","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned naive snaive. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Naive and Random Walk Forecasts — rwf","text":"random walk drift model $$Y_t=c + Y_{t-1} + Z_t$$ \\(Z_t\\) normal iid error. Forecasts given $$Y_n(h)=ch+Y_n$$. drift (naive), drift parameter c=0. Forecast standard errors allow uncertainty estimating drift parameter (unlike corresponding forecasts obtained fitting ARIMA model directly). seasonal naive model $$Y_t= Y_{t-m} + Z_t$$ \\(Z_t\\) normal iid error.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Naive and Random Walk Forecasts — rwf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/naive.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Naive and Random Walk Forecasts — rwf","text":"","code":"gold.fcast <- rwf(gold[1:60], h=50) plot(gold.fcast) plot(naive(gold,h=50),include=200) plot(snaive(wineind))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":null,"dir":"Reference","previous_headings":"","what":"Number of differences required for a stationary series — ndiffs","title":"Number of differences required for a stationary series — ndiffs","text":"Functions estimate number differences required make given time series stationary. ndiffs estimates number first differences necessary.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number of differences required for a stationary series — ndiffs","text":"","code":"ndiffs( x, alpha = 0.05, test = c(\"kpss\", \"adf\", \"pp\"), type = c(\"level\", \"trend\"), max.d = 2, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number of differences required for a stationary series — ndiffs","text":"x univariate time series alpha Level test, possible values range 0.01 0.1. test Type unit root test use type Specification deterministic component regression max.d Maximum number non-seasonal differences allowed ... Additional arguments passed unit root test","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number of differences required for a stationary series — ndiffs","text":"integer indicating number differences required stationarity.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Number of differences required for a stationary series — ndiffs","text":"ndiffs uses unit root test determine number differences required time series x made stationary. test=\"kpss\", KPSS test used null hypothesis x stationary root unit-root alternative. test returns least number differences required pass test level alpha. test=\"adf\", Augmented Dickey-Fuller test used test=\"pp\" Phillips-Perron test used. cases, null hypothesis x unit root stationary root alternative. test returns least number differences required fail test level alpha.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Number of differences required for a stationary series — ndiffs","text":"Dickey DA Fuller WA (1979), \"Distribution Estimators Autoregressive Time Series Unit Root\", Journal American Statistical Association 74:427-431. Kwiatkowski D, Phillips PCB, Schmidt P Shin Y (1992) \"Testing Null Hypothesis Stationarity Alternative Unit Root\", Journal Econometrics 54:159-178. Osborn, D.R. (1990) \"survey seasonality UK macroeconomic variables\", International Journal Forecasting, 6:327-336. Phillips, P.C.B. Perron, P. (1988) \"Testing unit root time series regression\", Biometrika, 72(2), 335-346. Said E Dickey DA (1984), \"Testing Unit Roots Autoregressive Moving Average Models Unknown Order\", Biometrika 71:599-607.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Number of differences required for a stationary series — ndiffs","text":"Rob J Hyndman, Slava Razbash & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ndiffs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number of differences required for a stationary series — ndiffs","text":"","code":"ndiffs(WWWusage) #> [1] 1 ndiffs(diff(log(AirPassengers), 12)) #> [1] 1"},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":null,"dir":"Reference","previous_headings":"","what":"Neural Network Time Series Forecasts — nnetar","title":"Neural Network Time Series Forecasts — nnetar","text":"Feed-forward neural networks single hidden layer lagged inputs forecasting univariate time series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Neural Network Time Series Forecasts — nnetar","text":"","code":"nnetar( y, p, P = 1, size, repeats = 20, xreg = NULL, lambda = NULL, model = NULL, subset = NULL, scale.inputs = TRUE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Neural Network Time Series Forecasts — nnetar","text":"y numeric vector time series class ts. p Embedding dimension non-seasonal time series. Number non-seasonal lags used inputs. non-seasonal time series, default optimal number lags (according AIC) linear AR(p) model. seasonal time series, method used applied seasonally adjusted data (stl decomposition). set zero indicate non-seasonal lags included, P must least 1 model seasonal lags fit. P Number seasonal lags used inputs. size Number nodes hidden layer. Default half number input nodes (including external regressors, given) plus 1. repeats Number networks fit different random starting weights. averaged producing forecasts. xreg Optionally, vector matrix external regressors, must number rows y. Must numeric. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. model Output previous call nnetar. model passed, model fitted y without re-estimating parameters. subset Optional vector specifying subset observations used fit. Can integer index vector logical vector length y. observations used default. scale.inputs TRUE, inputs scaled subtracting column means dividing respective standard deviations. lambda NULL, scaling applied Box-Cox transformation. x Deprecated. Included backwards compatibility. ... arguments passed nnet nnetar.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Neural Network Time Series Forecasts — nnetar","text":"Returns object class \"nnetar\". function summary used obtain print summary results. generic accessor functions fitted.values residuals extract useful features value returned nnetar. model list containing information fitted model method name forecasting method character string x original time series. xreg external regressors used fitting (given). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts) ... arguments","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Neural Network Time Series Forecasts — nnetar","text":"feed-forward neural network fitted lagged values y inputs single hidden layer size nodes. inputs lags 1 p, lags m mP m=frequency(y). xreg provided, columns also used inputs. missing values y xreg, corresponding rows (others depend lags) omitted fit. total repeats networks fitted, random starting weights. averaged computing forecasts. network trained one-step forecasting. Multi-step forecasts computed recursively. non-seasonal data, fitted model denoted NNAR(p,k) model, k number hidden nodes. analogous AR(p) model nonlinear functions. seasonal data, fitted model called NNAR(p,P,k)[m] model, analogous ARIMA(p,0,0)(P,0,0)[m] model nonlinear functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Neural Network Time Series Forecasts — nnetar","text":"Rob J Hyndman Gabriel Caceres","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nnetar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Neural Network Time Series Forecasts — nnetar","text":"","code":"fit <- nnetar(lynx) fcast <- forecast(fit) plot(fcast) ## Arguments can be passed to nnet() fit <- nnetar(lynx, decay=0.5, maxit=150) plot(forecast(fit)) lines(lynx) ## Fit model to first 100 years of lynx data fit <- nnetar(window(lynx,end=1920), decay=0.5, maxit=150) plot(forecast(fit,h=14)) lines(lynx) ## Apply fitted model to later data, including all optional arguments fit2 <- nnetar(window(lynx,start=1921), model=fit)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":null,"dir":"Reference","previous_headings":"","what":"Number of differences required for a seasonally stationary series — nsdiffs","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"Functions estimate number differences required make given time series stationary. nsdiffs estimates number seasonal differences necessary.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"","code":"nsdiffs( x, alpha = 0.05, m = frequency(x), test = c(\"seas\", \"ocsb\", \"hegy\", \"ch\"), max.D = 1, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"x univariate time series alpha Level test, possible values range 0.01 0.1. m Deprecated. Length seasonal period test Type unit root test use max.D Maximum number seasonal differences allowed ... Additional arguments passed unit root test","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"integer indicating number differences required stationarity.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"nsdiffs uses seasonal unit root tests determine number seasonal differences required time series x made stationary (possibly lag-one differencing well). Several different tests available: test=\"seas\" (default), measure seasonal strength used, differencing selected seasonal strength (Wang, Smith & Hyndman, 2006) exceeds 0.64 (based minimizing MASE forecasting using auto.arima M3 M4 data). test=\"ch\", Canova-Hansen (1995) test used (null hypothesis deterministic seasonality) test=\"hegy\", Hylleberg, Engle, Granger & Yoo (1990) test used. test=\"ocsb\", Osborn-Chui-Smith-Birchenhall (1988) test used (null hypothesis seasonal unit root exists).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"Wang, X, Smith, KA, Hyndman, RJ (2006) \"Characteristic-based clustering time series data\", Data Mining Knowledge Discovery, 13(3), 335-364. Osborn DR, Chui APL, Smith J, Birchenhall CR (1988) \"Seasonality order integration consumption\", Oxford Bulletin Economics Statistics 50(4):361-377. Canova F Hansen (1995) \"Seasonal Patterns Constant Time? Test Seasonal Stability\", Journal Business Economic Statistics 13(3):237-252. Hylleberg S, Engle R, Granger C Yoo B (1990) \"Seasonal integration cointegration.\", Journal Econometrics 44(1), pp. 215-238.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"Rob J Hyndman, Slava Razbash Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/nsdiffs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Number of differences required for a seasonally stationary series — nsdiffs","text":"","code":"nsdiffs(AirPassengers) #> [1] 1"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"implementation Osborn, Chui, Smith, Birchenhall (OCSB) test.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"","code":"ocsb.test(x, lag.method = c(\"fixed\", \"AIC\", \"BIC\", \"AICc\"), maxlag = 0)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"x univariate seasonal time series. lag.method character specifying lag order selection method. maxlag maximum lag order considered lag.method.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"ocsb.test returns list class \"OCSBtest\" following components: * statistics value test statistics. * pvalues p-values test statistics. * method character string describing type test. * data.name character string giving name data. * fitted.model\tfitted regression model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"regression equation may include lags dependent variable. lag.method = \"fixed\", lag order fixed maxlag; otherwise, maxlag maximum number lags considered lag selection procedure minimises lag.method criterion, can AIC BIC corrected AIC, AICc, obtained AIC + (2k(k+1))/(n-k-1), k number parameters n number available observations model. Critical values test based simulations, smoothed produce critical values seasonal periods.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"Osborn DR, Chui APL, Smith J, Birchenhall CR (1988) \"Seasonality order integration consumption\", Oxford Bulletin Economics Statistics 50(4):361-377.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ocsb.test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Osborn, Chui, Smith, and Birchenhall Test for Seasonal Unit Roots — ocsb.test","text":"","code":"ocsb.test(AirPassengers) #> #> \tOCSB test #> #> data: AirPassengers #> #> Test statistic: 1.5188, 5% critical value: -1.803 #> alternative hypothesis: stationary #> #> Lag order 0 was selected using fixed"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot characteristic roots from ARIMA model — plot.Arima","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"Produces plot inverse AR MA roots ARIMA model. Inverse roots outside unit circle shown red.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"","code":"# S3 method for Arima plot( x, type = c(\"both\", \"ar\", \"ma\"), main, xlab = \"Real\", ylab = \"Imaginary\", ... ) # S3 method for ar plot(x, main, xlab = \"Real\", ylab = \"Imaginary\", ...) # S3 method for Arima autoplot(object, type = c(\"both\", \"ar\", \"ma\"), ...) # S3 method for ar autoplot(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"x Object class “Arima” “ar”. type Determines AR MA roots plotted, just one set plotted. main Main title. Default \"Inverse AR roots\" \"Inverse MA roots\". xlab X-axis label. ylab Y-axis label. ... plotting parameters passed par. object Object class “Arima” “ar”. Used ggplot graphics (S3 method consistency).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"None. Function produces plot","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"autoplot produce equivalent plot ggplot object.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.Arima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot characteristic roots from ARIMA model — plot.Arima","text":"","code":"library(ggplot2) fit <- Arima(WWWusage, order = c(3, 1, 0)) plot(fit) autoplot(fit) fit <- Arima(woolyrnq, order = c(2, 0, 0), seasonal = c(2, 1, 1)) plot(fit) autoplot(fit) plot(ar.ols(gold[1:61])) autoplot(ar.ols(gold[1:61]))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot components from BATS model — plot.bats","title":"Plot components from BATS model — plot.bats","text":"Produces plot level, slope seasonal components BATS TBATS model. plotted components Box-Cox transformed using estimated transformation parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot components from BATS model — plot.bats","text":"","code":"# S3 method for bats plot(x, main = \"Decomposition by BATS model\", ...) # S3 method for tbats autoplot(object, range.bars = FALSE, ...) # S3 method for bats autoplot(object, range.bars = FALSE, ...) # S3 method for tbats plot(x, main = \"Decomposition by TBATS model\", ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot components from BATS model — plot.bats","text":"x Object class “bats/tbats”. main Main title plot. ... plotting parameters passed par. object Object class “bats/tbats”. range.bars Logical indicating plot bar right side representing relative size. NULL, automatic selection takes place.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot components from BATS model — plot.bats","text":"None. Function produces plot","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot components from BATS model — plot.bats","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.bats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot components from BATS model — plot.bats","text":"","code":"if (FALSE) { fit <- tbats(USAccDeaths) plot(fit) autoplot(fit, range.bars = TRUE)}"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot components from ETS model — plot.ets","title":"Plot components from ETS model — plot.ets","text":"Produces plot level, slope seasonal components ETS model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot components from ETS model — plot.ets","text":"","code":"# S3 method for ets plot(x, ...) # S3 method for ets autoplot(object, range.bars = NULL, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot components from ETS model — plot.ets","text":"x Object class “ets”. ... plotting parameters affect plot. object Object class “ets”. Used ggplot graphics (S3 method consistency). range.bars Logical indicating plot bar right side representing relative size. NULL, automatic selection takes place.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot components from ETS model — plot.ets","text":"None. Function produces plot","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot components from ETS model — plot.ets","text":"autoplot produce equivalent plot ggplot object.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot components from ETS model — plot.ets","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.ets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot components from ETS model — plot.ets","text":"","code":"fit <- ets(USAccDeaths) plot(fit) plot(fit,plot.type=\"single\",ylab=\"\",col=1:3) library(ggplot2) autoplot(fit)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast plot — plot.forecast","title":"Forecast plot — plot.forecast","text":"Plots historical data forecasts prediction intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast plot — plot.forecast","text":"","code":"# S3 method for forecast plot( x, include, PI = TRUE, showgap = TRUE, shaded = TRUE, shadebars = (length(x$mean) < 5), shadecols = NULL, col = 1, fcol = 4, pi.col = 1, pi.lty = 2, ylim = NULL, main = NULL, xlab = \"\", ylab = \"\", type = \"l\", flty = 1, flwd = 2, ... ) # S3 method for forecast autoplot( object, include, PI = TRUE, shadecols = c(\"#596DD5\", \"#D5DBFF\"), fcol = \"#0000AA\", flwd = 0.5, ... ) # S3 method for splineforecast autoplot(object, PI = TRUE, ...) # S3 method for forecast autolayer(object, series = NULL, PI = TRUE, showgap = TRUE, ...) # S3 method for splineforecast plot(x, fitcol = 2, type = \"o\", pch = 19, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast plot — plot.forecast","text":"x Forecast object produced forecast. include number values time series include plot. Default values. PI Logical flag indicating whether plot prediction intervals. showgap showgap=FALSE, gap historical observations forecasts removed. shaded Logical flag indicating whether prediction intervals shaded (TRUE) lines (FALSE) shadebars Logical flag indicating prediction intervals plotted shaded bars (TRUE) shaded polygon (FALSE). Ignored shaded=FALSE. Bars plotted default fewer five forecast horizons. shadecols Colors shaded prediction intervals. get default colors used prior v3.26, set shadecols=\"oldstyle\". col Colour data line. fcol Colour forecast line. pi.col shaded=FALSE PI=TRUE, prediction intervals plotted colour. pi.lty shaded=FALSE PI=TRUE, prediction intervals plotted using line type. ylim Limits y-axis. main Main title. xlab X-axis label. ylab Y-axis label. type 1-character string giving type plot desired. plot.default. flty Line type forecast line. flwd Line width forecast line. ... plotting parameters affect plot. object Forecast object produced forecast. Used ggplot graphics (S3 method consistency). series Matches unidentified forecast layer coloured object plot. fitcol Line colour fitted values. pch Plotting character (type==\"p\" type==\"o\").","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast plot — plot.forecast","text":"None.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast plot — plot.forecast","text":"autoplot produce ggplot object. plot.splineforecast autoplot.splineforecast","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Forecast plot — plot.forecast","text":"Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast plot — plot.forecast","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast plot — plot.forecast","text":"","code":"library(ggplot2) wine.fit <- hw(wineind,h=48) plot(wine.fit) autoplot(wine.fit) fit <- tslm(wineind ~ fourier(wineind,4)) fcast <- forecast(fit, newdata=data.frame(fourier(wineind,4,20))) autoplot(fcast) fcast <- splinef(airmiles,h=5) plot(fcast) autoplot(fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Multivariate forecast plot — autoplot.mforecast","title":"Multivariate forecast plot — autoplot.mforecast","text":"Plots historical data multivariate forecasts prediction intervals.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multivariate forecast plot — autoplot.mforecast","text":"","code":"# S3 method for mforecast autoplot(object, PI = TRUE, facets = TRUE, colour = FALSE, ...) # S3 method for mforecast autolayer(object, series = NULL, PI = TRUE, ...) # S3 method for mforecast plot(x, main = paste(\"Forecasts from\", unique(x$method)), xlab = \"time\", ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multivariate forecast plot — autoplot.mforecast","text":"object Multivariate forecast object class mforecast. Used ggplot graphics (S3 method consistency). PI FALSE, confidence intervals plotted, giving forecast line. facets TRUE, multiple time series faceted. FALSE, series assigned colour. colour TRUE, time series assigned colour aesthetic ... additional arguments individual plot. series Matches unidentified forecast layer coloured object plot. x Multivariate forecast object class mforecast. main Main title. Default forecast method. autoplot, specify vector titles plot. xlab X-axis label. autoplot, specify vector labels plot.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multivariate forecast plot — autoplot.mforecast","text":"autoplot produce equivalent plot ggplot object.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Multivariate forecast plot — autoplot.mforecast","text":"Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multivariate forecast plot — autoplot.mforecast","text":"Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/plot.mforecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multivariate forecast plot — autoplot.mforecast","text":"","code":"library(ggplot2) lungDeaths <- cbind(mdeaths, fdeaths) fit <- tslm(lungDeaths ~ trend + season) fcast <- forecast(fit, h=10) plot(fcast) autoplot(fcast) carPower <- as.matrix(mtcars[,c(\"qsec\",\"hp\")]) carmpg <- mtcars[,\"mpg\"] fit <- lm(carPower ~ carmpg) fcast <- forecast(fit, newdata=data.frame(carmpg=30)) plot(fcast, xlab=\"Year\") autoplot(fcast, xlab=rep(\"Year\",2))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. generics accuracy, forecast ggplot2 autoplot magrittr %>%","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Residuals for various time series models — residuals.forecast","title":"Residuals for various time series models — residuals.forecast","text":"Returns time series residuals fitted model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Residuals for various time series models — residuals.forecast","text":"","code":"# S3 method for forecast residuals(object, type = c(\"innovation\", \"response\"), ...) # S3 method for ar residuals(object, type = c(\"innovation\", \"response\"), ...) # S3 method for Arima residuals(object, type = c(\"innovation\", \"response\", \"regression\"), h = 1, ...) # S3 method for bats residuals(object, type = c(\"innovation\", \"response\"), h = 1, ...) # S3 method for tbats residuals(object, type = c(\"innovation\", \"response\"), h = 1, ...) # S3 method for ets residuals(object, type = c(\"innovation\", \"response\"), h = 1, ...) # S3 method for ARFIMA residuals(object, type = c(\"innovation\", \"response\"), ...) # S3 method for nnetar residuals(object, type = c(\"innovation\", \"response\"), h = 1, ...) # S3 method for stlm residuals(object, type = c(\"innovation\", \"response\"), ...) # S3 method for tslm residuals(object, type = c(\"innovation\", \"response\", \"deviance\"), ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Residuals for various time series models — residuals.forecast","text":"object object containing time series model class ar, Arima, bats, ets, arfima, nnetar stlm. object class forecast, function return object$residuals exists, otherwise returns differences observations fitted values. type Type residual. ... arguments used. h type='response', fitted values computed h-step forecasts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Residuals for various time series models — residuals.forecast","text":"ts object.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Residuals for various time series models — residuals.forecast","text":"Innovation residuals correspond white noise process drives evolution time series model. Response residuals difference observations fitted values (equivalent h-step forecasts). functions h argument, h=1. homoscedastic models, innovation residuals response residuals h=1 identical. Regression residuals available regression models ARIMA errors, equal original data minus effect regression variables. regression variables, errors identical original series (possibly adjusted zero mean). arima.errors deprecated function identical residuals.Arima(object, type=\"regression\"). nnetar objects, type=\"innovations\" lambda used, matrix time-series consisting residuals fitted neural networks returned.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Residuals for various time series models — residuals.forecast","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/residuals.forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Residuals for various time series models — residuals.forecast","text":"","code":"fit <- Arima(lynx,order=c(4,0,0), lambda=0.5) plot(residuals(fit)) plot(residuals(fit, type='response'))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":null,"dir":"Reference","previous_headings":"","what":"Seasonal adjustment — seasadj","title":"Seasonal adjustment — seasadj","text":"Returns seasonally adjusted data constructed removing seasonal component.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Seasonal adjustment — seasadj","text":"","code":"seasadj(object, ...) # S3 method for stl seasadj(object, ...) # S3 method for mstl seasadj(object, ...) # S3 method for decomposed.ts seasadj(object, ...) # S3 method for tbats seasadj(object, ...) # S3 method for seas seasadj(object, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Seasonal adjustment — seasadj","text":"object Object created decompose, stl tbats. ... arguments currently used.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Seasonal adjustment — seasadj","text":"Univariate time series.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Seasonal adjustment — seasadj","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasadj.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Seasonal adjustment — seasadj","text":"","code":"plot(AirPassengers) lines(seasadj(decompose(AirPassengers,\"multiplicative\")),col=4)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract components from a time series decomposition — seasonal","title":"Extract components from a time series decomposition — seasonal","text":"Returns univariate time series equal either seasonal component, trend-cycle component remainder component time series decomposition.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract components from a time series decomposition — seasonal","text":"","code":"seasonal(object) trendcycle(object) remainder(object)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract components from a time series decomposition — seasonal","text":"object Object created decompose, stl tbats.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract components from a time series decomposition — seasonal","text":"Univariate time series.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract components from a time series decomposition — seasonal","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract components from a time series decomposition — seasonal","text":"","code":"plot(USAccDeaths) fit <- stl(USAccDeaths, s.window=\"periodic\") lines(trendcycle(fit),col=\"red\") library(ggplot2) autoplot(cbind( Data=USAccDeaths, Seasonal=seasonal(fit), Trend=trendcycle(fit), Remainder=remainder(fit)), facets=TRUE) + ylab(\"\") + xlab(\"Year\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":null,"dir":"Reference","previous_headings":"","what":"Seasonal dummy variables — seasonaldummy","title":"Seasonal dummy variables — seasonaldummy","text":"seasonaldummy returns matrix dummy variables suitable use Arima, auto.arima tslm. last season omitted used control.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Seasonal dummy variables — seasonaldummy","text":"","code":"seasonaldummy(x, h = NULL) seasonaldummyf(x, h)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Seasonal dummy variables — seasonaldummy","text":"x Seasonal time series: ts msts object h Number periods ahead forecast (optional)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Seasonal dummy variables — seasonaldummy","text":"Numerical matrix.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Seasonal dummy variables — seasonaldummy","text":"seasonaldummyf deprecated, instead use h argument seasonaldummy. number dummy variables determined time series characteristics x. h missing, length x also determines number rows matrix returned seasonaldummy. value h determines number rows matrix returned seasonaldummy, typically used forecasting. values within x used.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Seasonal dummy variables — seasonaldummy","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonaldummy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Seasonal dummy variables — seasonaldummy","text":"","code":"plot(ldeaths) # Using seasonal dummy variables month <- seasonaldummy(ldeaths) deaths.lm <- tslm(ldeaths ~ month) tsdisplay(residuals(deaths.lm)) ldeaths.fcast <- forecast(deaths.lm, data.frame(month=I(seasonaldummy(ldeaths,36)))) plot(ldeaths.fcast) # A simpler approach to seasonal dummy variables deaths.lm <- tslm(ldeaths ~ season) ldeaths.fcast <- forecast(deaths.lm, h=36) plot(ldeaths.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":null,"dir":"Reference","previous_headings":"","what":"Seasonal plot — ggseasonplot","title":"Seasonal plot — ggseasonplot","text":"Plots seasonal plot described Hyndman Athanasopoulos (2014, chapter 2). like time plot except data plotted seasons separate years.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Seasonal plot — ggseasonplot","text":"","code":"ggseasonplot( x, season.labels = NULL, year.labels = FALSE, year.labels.left = FALSE, type = NULL, col = NULL, continuous = FALSE, polar = FALSE, labelgap = 0.04, ... ) seasonplot( x, s, season.labels = NULL, year.labels = FALSE, year.labels.left = FALSE, type = \"o\", main, xlab = NULL, ylab = \"\", col = 1, labelgap = 0.1, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Seasonal plot — ggseasonplot","text":"x numeric vector time series class ts. season.labels Labels season \"year\" year.labels Logical flag indicating whether labels year data plotted right. year.labels.left Logical flag indicating whether labels year data plotted left. type plot type (plot). yet supported ggseasonplot. col Colour continuous colour scheme years continuous discrete? polar Plot graph seasonal coordinates labelgap Distance year labels plotted lines ... additional arguments plot. s seasonal frequency x main Main title. xlab X-axis label. ylab Y-axis label.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Seasonal plot — ggseasonplot","text":"None.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Seasonal plot — ggseasonplot","text":"Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Seasonal plot — ggseasonplot","text":"Rob J Hyndman & Mitchell O'Hara-Wild","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/seasonplot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Seasonal plot — ggseasonplot","text":"","code":"ggseasonplot(AirPassengers, col=rainbow(12), year.labels=TRUE) ggseasonplot(AirPassengers, year.labels=TRUE, continuous=TRUE) seasonplot(AirPassengers, col=rainbow(12), year.labels=TRUE)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":null,"dir":"Reference","previous_headings":"","what":"Exponential smoothing forecasts — ses","title":"Exponential smoothing forecasts — ses","text":"Returns forecasts information exponential smoothing forecasts applied y.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Exponential smoothing forecasts — ses","text":"","code":"ses( y, h = 10, level = c(80, 95), fan = FALSE, initial = c(\"optimal\", \"simple\"), alpha = NULL, lambda = NULL, biasadj = FALSE, x = y, ... ) holt( y, h = 10, damped = FALSE, level = c(80, 95), fan = FALSE, initial = c(\"optimal\", \"simple\"), exponential = FALSE, alpha = NULL, beta = NULL, phi = NULL, lambda = NULL, biasadj = FALSE, x = y, ... ) hw( y, h = 2 * frequency(x), seasonal = c(\"additive\", \"multiplicative\"), damped = FALSE, level = c(80, 95), fan = FALSE, initial = c(\"optimal\", \"simple\"), exponential = FALSE, alpha = NULL, beta = NULL, gamma = NULL, phi = NULL, lambda = NULL, biasadj = FALSE, x = y, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Exponential smoothing forecasts — ses","text":"y numeric vector time series class ts h Number periods forecasting. level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. initial Method used selecting initial state values. optimal, initial values optimized along smoothing parameters using ets. simple, initial values set values obtained using simple calculations first observations. See Hyndman & Athanasopoulos (2014) details. alpha Value smoothing parameter level. NULL, estimated. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. x Deprecated. Included backwards compatibility. ... arguments passed forecast.ets. damped TRUE, use damped trend. exponential TRUE, exponential trend fitted. Otherwise, trend (locally) linear. beta Value smoothing parameter trend. NULL, estimated. phi Value damping parameter damped=TRUE. NULL, estimated. seasonal Type seasonality hw model. \"additive\" \"multiplicative\" gamma Value smoothing parameter seasonal component. NULL, estimated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Exponential smoothing forecasts — ses","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned ets associated functions. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Exponential smoothing forecasts — ses","text":"ses, holt hw simply convenient wrapper functions forecast(ets(...)).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Exponential smoothing forecasts — ses","text":"Hyndman, R.J., Koehler, .B., Ord, J.K., Snyder, R.D. (2008) Forecasting exponential smoothing: state space approach, Springer-Verlag: New York. http://www.exponentialsmoothing.net. Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Exponential smoothing forecasts — ses","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/ses.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Exponential smoothing forecasts — ses","text":"","code":"fcast <- holt(airmiles) plot(fcast) deaths.fcast <- hw(USAccDeaths,h=48) plot(deaths.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulation from a time series model — simulate.ets","title":"Simulation from a time series model — simulate.ets","text":"Returns time series based model object object.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulation from a time series model — simulate.ets","text":"","code":"# S3 method for ets simulate( object, nsim = length(object$x), seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, ... ) # S3 method for Arima simulate( object, nsim = length(object$x), seed = NULL, xreg = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, lambda = object$lambda, ... ) # S3 method for ar simulate( object, nsim = object$n.used, seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, ... ) # S3 method for lagwalk simulate( object, nsim = length(object$x), seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, lambda = object$lambda, ... ) # S3 method for fracdiff simulate( object, nsim = object$n, seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, ... ) # S3 method for nnetar simulate( object, nsim = length(object$x), seed = NULL, xreg = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, lambda = object$lambda, ... ) # S3 method for modelAR simulate( object, nsim = length(object$x), seed = NULL, xreg = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, lambda = object$lambda, ... ) # S3 method for tbats simulate( object, nsim = length(object$y), seed = NULL, future = TRUE, bootstrap = FALSE, innov = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulation from a time series model — simulate.ets","text":"object object class \"ets\", \"Arima\", \"ar\" \"nnetar\". nsim Number periods simulated series. Ignored either xreg innov NULL. Otherwise default length series used train model (100 data found). seed Either NULL integer used call set.seed simulating time series. default, NULL, change random generator state. future Produce sample paths future conditional data object. Otherwise simulate unconditionally. bootstrap simulation using resampled errors rather normally distributed errors errors provided innov. innov vector innovations use error series. Ignored bootstrap==TRUE. NULL, value nsim set length innov. ... arguments, currently used. xreg New values xreg used forecasting. value nsim set number rows xreg NULL. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulation from a time series model — simulate.ets","text":"object class \"ts\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Simulation from a time series model — simulate.ets","text":"simulate.Arima(), object produced Arima auto.arima, rather arima. default, error series assumed normally distributed generated using rnorm. innov present, used instead. bootstrap=TRUE innov=NULL, residuals resampled instead. future=TRUE, sample paths conditional data. future=FALSE model stationary, sample paths depend data . future=FALSE model non-stationary, location sample paths arbitrary, start value first observation.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Simulation from a time series model — simulate.ets","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/simulate.ets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Simulation from a time series model — simulate.ets","text":"","code":"fit <- ets(USAccDeaths) plot(USAccDeaths, xlim = c(1973, 1982)) lines(simulate(fit, 36), col = \"red\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast seasonal index — sindexf","title":"Forecast seasonal index — sindexf","text":"Returns vector containing seasonal index h future periods. seasonal index non-periodic, uses last values index.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast seasonal index — sindexf","text":"","code":"sindexf(object, h)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast seasonal index — sindexf","text":"object Output decompose stl. h Number periods ahead forecast","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast seasonal index — sindexf","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Forecast seasonal index — sindexf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/sindexf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Forecast seasonal index — sindexf","text":"","code":"uk.stl <- stl(UKDriverDeaths,\"periodic\") uk.sa <- seasadj(uk.stl) uk.fcast <- holt(uk.sa,36) seasf <- sindexf(uk.stl,36) uk.fcast$mean <- uk.fcast$mean + seasf uk.fcast$lower <- uk.fcast$lower + cbind(seasf,seasf) uk.fcast$upper <- uk.fcast$upper + cbind(seasf,seasf) uk.fcast$x <- UKDriverDeaths plot(uk.fcast,main=\"Forecasts from Holt's method with seasonal adjustment\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":null,"dir":"Reference","previous_headings":"","what":"Cubic Spline Forecast — splinef","title":"Cubic Spline Forecast — splinef","text":"Returns local linear forecasts prediction intervals using cubic smoothing splines.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Cubic Spline Forecast — splinef","text":"","code":"splinef( y, h = 10, level = c(80, 95), fan = FALSE, lambda = NULL, biasadj = FALSE, method = c(\"gcv\", \"mle\"), x = y )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Cubic Spline Forecast — splinef","text":"y numeric vector time series class ts h Number periods forecasting level Confidence level prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. method Method selecting smoothing parameter. method=\"gcv\", generalized cross-validation method smooth.spline used. method=\"mle\", maximum likelihood method Hyndman et al (2002) used. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Cubic Spline Forecast — splinef","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned splinef. object class \"forecast\" containing following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). onestepf One-step forecasts fitted model. fitted Smooth estimates fitted trend using data. residuals Residuals fitted model. x minus one-step forecasts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Cubic Spline Forecast — splinef","text":"cubic smoothing spline model equivalent ARIMA(0,2,2) model restricted parameter space. advantage spline model full ARIMA model provides smooth historical trend well linear forecast function. Hyndman, King, Pitrun, Billah (2002) show forecast performance method hardly affected restricted parameter space.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Cubic Spline Forecast — splinef","text":"Hyndman, King, Pitrun Billah (2005) Local linear forecasts using cubic smoothing splines. Australian New Zealand Journal Statistics, 47(1), 87-99. https://robjhyndman.com/publications/splinefcast/.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Cubic Spline Forecast — splinef","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/splinef.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Cubic Spline Forecast — splinef","text":"","code":"fcast <- splinef(uspop,h=5) plot(fcast) summary(fcast) #> #> Forecast method: Cubic Smoothing Spline #> #> Model Information: #> $beta #> [1] 0.0006859 #> #> $call #> splinef(y = uspop, h = 5) #> #> #> Error measures: #> ME RMSE MAE MPE MAPE MASE #> Training set 0.7704553 4.572546 3.165298 -0.6110405 8.174722 0.04536795 #> ACF1 #> Training set -0.4363661 #> #> Forecasts: #> Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 #> 1980 225.6937 219.8454 231.5419 216.7496 234.6378 #> 1990 248.1814 233.7246 262.6382 226.0717 270.2912 #> 2000 270.6692 245.5023 295.8361 232.1798 309.1586 #> 2010 293.1569 255.5241 330.7897 235.6025 350.7113 #> 2020 315.6447 264.0068 367.2826 236.6713 394.6181"},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":null,"dir":"Reference","previous_headings":"","what":"Subsetting a time series — subset.ts","title":"Subsetting a time series — subset.ts","text":"Various types subsetting time series. Allows subsetting index values (unlike window). Also allows extraction values specific season subset seasons year. example, extract values month May time series.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subsetting a time series — subset.ts","text":"","code":"# S3 method for ts subset( x, subset = NULL, month = NULL, quarter = NULL, season = NULL, start = NULL, end = NULL, ... ) # S3 method for msts subset(x, subset = NULL, start = NULL, end = NULL, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subsetting a time series — subset.ts","text":"x univariate time series subsetted subset optional logical expression indicating elements keep; missing values taken false. subset must length x. month Numeric character vector months retain. Partial matching month names used. quarter Numeric character vector quarters retain. season Numeric vector seasons retain. start Index start contiguous subset. end Index end contiguous subset. ... arguments, unused.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subsetting a time series — subset.ts","text":"subset used, numeric vector returned ts attributes. start /end used, ts object returned consisting x[start:end], appropriate time series attributes retained. Otherwise, ts object returned frequency equal length month, quarter season.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Subsetting a time series — subset.ts","text":"character values months used, either upper lower case may used, partial unambiguous names acceptable. Possible character values quarters \"Q1\", \"Q2\", \"Q3\", \"Q4\".","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Subsetting a time series — subset.ts","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/subset.ts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subsetting a time series — subset.ts","text":"","code":"plot(subset(gas,month=\"November\")) subset(woolyrnq,quarter=3) #> Time Series: #> Start = 1965.5 #> End = 1994.5 #> Frequency = 1 #> [1] 6633 6730 6946 6915 7190 7105 6840 7819 7045 5540 5906 5505 5318 5466 5696 #> [16] 5341 5464 5129 5524 6080 6540 6339 6590 6077 5146 5127 5222 4954 5309 6396 subset(USAccDeaths, start=49) #> Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec #> 1977 7792 6957 7726 8106 8890 9299 10625 9302 8314 8850 8265 8796 #> 1978 7836 6892 7791 8192 9115 9434 10484 9827 9110 9070 8633 9240"},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":null,"dir":"Reference","previous_headings":"","what":"Half-hourly electricity demand — taylor","title":"Half-hourly electricity demand — taylor","text":"Half-hourly electricity demand England Wales Monday 5 June 2000 Sunday 27 August 2000. Discussed Taylor (2003), kindly provided James W Taylor. Units: Megawatts","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Half-hourly electricity demand — taylor","text":"","code":"taylor"},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Half-hourly electricity demand — taylor","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Half-hourly electricity demand — taylor","text":"James W Taylor","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Half-hourly electricity demand — taylor","text":"Taylor, J.W. (2003) Short-term electricity demand forecasting using double seasonal exponential smoothing. Journal Operational Research Society, 54, 799-805.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/taylor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Half-hourly electricity demand — taylor","text":"","code":"plot(taylor)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract components of a TBATS model — tbats.components","title":"Extract components of a TBATS model — tbats.components","text":"Extract level, slope seasonal components TBATS model. extracted components Box-Cox transformed using estimated transformation parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract components of a TBATS model — tbats.components","text":"","code":"tbats.components(x)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract components of a TBATS model — tbats.components","text":"x tbats object created tbats.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract components of a TBATS model — tbats.components","text":"multiple time series (mts) object. first series observed time series. second series trend component fitted model. Series three onwards seasonal components fitted model one time series seasonal components. components transformed using estimated Box-Cox parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Extract components of a TBATS model — tbats.components","text":"De Livera, .M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series complex seasonal patterns using exponential smoothing, Journal American Statistical Association, 106(496), 1513-1527.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract components of a TBATS model — tbats.components","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.components.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract components of a TBATS model — tbats.components","text":"","code":"if (FALSE) { fit <- tbats(USAccDeaths, use.parallel=FALSE) components <- tbats.components(fit) plot(components)}"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":null,"dir":"Reference","previous_headings":"","what":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"Fits TBATS model applied y, described De Livera, Hyndman & Snyder (2011). Parallel processing used default speed computations.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"","code":"tbats( y, use.box.cox = NULL, use.trend = NULL, use.damped.trend = NULL, seasonal.periods = NULL, use.arma.errors = TRUE, use.parallel = length(y) > 1000, num.cores = 2, bc.lower = 0, bc.upper = 1, biasadj = FALSE, model = NULL, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"y time series forecast. Can numeric, msts ts. univariate time series supported. use.box.cox TRUE/FALSE indicates whether use Box-Cox transformation . NULL tried best fit selected AIC. use.trend TRUE/FALSE indicates whether include trend . NULL tried best fit selected AIC. use.damped.trend TRUE/FALSE indicates whether include damping parameter trend . NULL tried best fit selected AIC. seasonal.periods y numeric seasonal periods can specified parameter. use.arma.errors TRUE/FALSE indicates whether include ARMA errors . TRUE best fit selected AIC. FALSE selection algorithm consider ARMA errors. use.parallel TRUE/FALSE indicates whether use parallel processing. num.cores number parallel processes used using parallel processing. NULL number logical cores detected available cores used. bc.lower lower limit (inclusive) Box-Cox transformation. bc.upper upper limit (inclusive) Box-Cox transformation. biasadj Use adjusted back-transformed mean Box-Cox transformations. TRUE, point forecasts fitted values mean forecast. Otherwise, points can considered median forecast densities. model Output previous call tbats. model passed, model fitted y without re-estimating parameters. ... Additional arguments passed auto.arima choose ARMA(p, q) model errors. (Note xreg ignored, arguments concerning seasonality differencing, arguments controlling values p q used.)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"object class c(\"tbats\", \"bats\"). generic accessor functions fitted.values residuals extract useful features value returned bats associated functions. fitted model designated TBATS(omega, p,q, phi, ,...,) omega Box-Cox parameter phi damping parameter; error modelled ARMA(p,q) process m1,...,mJ list seasonal periods used model k1,...,kJ corresponding number Fourier terms used seasonality.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"De Livera, .M., Hyndman, R.J., & Snyder, R. D. (2011), Forecasting time series complex seasonal patterns using exponential smoothing, Journal American Statistical Association, 106(496), 1513-1527.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"Slava Razbash Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tbats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"TBATS model (Exponential smoothing state space model with Box-Cox\ntransformation, ARMA errors, Trend and Seasonal components) — tbats","text":"","code":"if (FALSE) { fit <- tbats(USAccDeaths) plot(forecast(fit)) taylor.fit <- tbats(taylor) plot(forecast(taylor.fit))}"},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":null,"dir":"Reference","previous_headings":"","what":"Theta method forecast — thetaf","title":"Theta method forecast — thetaf","text":"Returns forecasts prediction intervals theta method forecast.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Theta method forecast — thetaf","text":"","code":"thetaf( y, h = ifelse(frequency(y) > 1, 2 * frequency(y), 10), level = c(80, 95), fan = FALSE, x = y )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Theta method forecast — thetaf","text":"y numeric vector time series class ts h Number periods forecasting level Confidence levels prediction intervals. fan TRUE, level set seq(51,99,=3). suitable fan plots. x Deprecated. Included backwards compatibility.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Theta method forecast — thetaf","text":"object class \"forecast\". function summary used obtain print summary results, function plot produces plot forecasts prediction intervals. generic accessor functions fitted.values residuals extract useful features value returned rwf. object class \"forecast\" list containing least following elements: model list containing information fitted model method name forecasting method character string mean Point forecasts time series lower Lower limits prediction intervals upper Upper limits prediction intervals level confidence values associated prediction intervals x original time series (either object time series used create model stored object). residuals Residuals fitted model. x minus fitted values. fitted Fitted values (one-step forecasts)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Theta method forecast — thetaf","text":"theta method Assimakopoulos Nikolopoulos (2000) equivalent simple exponential smoothing drift. demonstrated Hyndman Billah (2003). series tested seasonality using test outlined &N. deemed seasonal, series seasonally adjusted using classical multiplicative decomposition applying theta method. resulting forecasts reseasonalized. Prediction intervals computed using underlying state space model. general theta methods available forecTheta package.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Theta method forecast — thetaf","text":"Assimakopoulos, V. Nikolopoulos, K. (2000). theta model: decomposition approach forecasting. International Journal Forecasting 16, 521-530. Hyndman, R.J., Billah, B. (2003) Unmasking Theta method. International J. Forecasting, 19, 287-290.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Theta method forecast — thetaf","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/thetaf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Theta method forecast — thetaf","text":"","code":"nile.fcast <- thetaf(Nile) plot(nile.fcast)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":null,"dir":"Reference","previous_headings":"","what":"Time series cross-validation — tsCV","title":"Time series cross-validation — tsCV","text":"tsCV computes forecast errors obtained applying forecastfunction subsets time series y using rolling forecast origin.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time series cross-validation — tsCV","text":"","code":"tsCV(y, forecastfunction, h = 1, window = NULL, xreg = NULL, initial = 0, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time series cross-validation — tsCV","text":"y Univariate time series forecastfunction Function return object class forecast. first argument must univariate time series, must argument h forecast horizon. exogenous predictors used, must also xreg newxreg arguments corresponding training test periods. h Forecast horizon window Length rolling window, NULL, rolling window used. xreg Exogeneous predictor variables passed forecast function required. initial Initial period time series cross-validation performed. ... arguments passed forecastfunction.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time series cross-validation — tsCV","text":"Numerical time series object containing forecast errors vector (h=1) matrix otherwise. time index corresponds last period training data. columns correspond forecast horizons.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time series cross-validation — tsCV","text":"Let y contain time series \\(y_1,\\dots,y_T\\). forecastfunction applied successively time series \\(y_1,\\dots,y_t\\), \\(t=1,\\dots,T-h\\), making predictions \\(\\hat{y}_{t+h|t}\\). errors given \\(e_{t+h} = y_{t+h}-\\hat{y}_{t+h|t}\\). h=1, returned vector, \\(e_1,\\dots,e_T\\). h>1, returned matrix hth column containing errors forecast horizon h. first errors may missing may possible apply forecastfunction short time series.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time series cross-validation — tsCV","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsCV.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time series cross-validation — tsCV","text":"","code":"#Fit an AR(2) model to each rolling origin subset far2 <- function(x, h){forecast(Arima(x, order=c(2,0,0)), h=h)} e <- tsCV(lynx, far2, h=1) #Fit the same model with a rolling window of length 30 e <- tsCV(lynx, far2, h=1, window=30) #Example with exogenous predictors far2_xreg <- function(x, h, xreg, newxreg) { forecast(Arima(x, order=c(2,0,0), xreg=xreg), xreg=newxreg) } y <- ts(rnorm(50)) xreg <- matrix(rnorm(100),ncol=2) e <- tsCV(y, far2_xreg, h=3, xreg=xreg)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify and replace outliers and missing values in a time series — tsclean","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"Uses supsmu non-seasonal series robust STL decomposition seasonal series. estimate missing values outlier replacements, linear interpolation used (possibly seasonally adjusted) series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"","code":"tsclean(x, replace.missing = TRUE, iterate = 2, lambda = NULL)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"x time series replace.missing TRUE, replaces outliers, also interpolates missing values iterate number iterations required lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"Time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"Hyndman (2021) \"Detecting time series outliers\" https://robjhyndman.com/hyndsight/tsoutliers/.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsclean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify and replace outliers and missing values in a time series — tsclean","text":"","code":"cleangold <- tsclean(gold)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":null,"dir":"Reference","previous_headings":"","what":"Time series display — ggtsdisplay","title":"Time series display — ggtsdisplay","text":"Plots time series along acf either pacf, lagged scatterplot spectrum.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Time series display — ggtsdisplay","text":"","code":"ggtsdisplay( x, plot.type = c(\"partial\", \"histogram\", \"scatter\", \"spectrum\"), points = TRUE, smooth = FALSE, lag.max, na.action = na.contiguous, theme = NULL, ... ) tsdisplay( x, plot.type = c(\"partial\", \"histogram\", \"scatter\", \"spectrum\"), points = TRUE, ci.type = c(\"white\", \"ma\"), lag.max, na.action = na.contiguous, main = NULL, xlab = \"\", ylab = \"\", pch = 1, cex = 0.5, ... )"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Time series display — ggtsdisplay","text":"x numeric vector time series class ts. plot.type type plot include lower right corner. points logical flag indicating whether show individual points time plot. smooth logical flag indicating whether show smooth loess curve superimposed time plot. lag.max maximum lag plot acf pacf. suitable value selected default argument missing. na.action function handle missing values acf, pacf spectrum calculations. default na.contiguous. Useful alternatives na.pass na.interp. theme Adds ggplot element plot, typically theme. ... additional arguments acf. ci.type type confidence limits ACF passed acf. confidence limits assume white noise input lag \\(k\\) MA(\\(k-1\\)) input? main Main title. xlab X-axis label. ylab Y-axis label. pch Plotting character. cex Character size.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Time series display — ggtsdisplay","text":"None.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Time series display — ggtsdisplay","text":"ggtsdisplay produce equivalent plot using ggplot graphics.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Time series display — ggtsdisplay","text":"Hyndman Athanasopoulos (2018) Forecasting: principles practice, 2nd edition, OTexts: Melbourne, Australia. https://otexts.com/fpp2/","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Time series display — ggtsdisplay","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsdisplay.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Time series display — ggtsdisplay","text":"","code":"library(ggplot2) ggtsdisplay(USAccDeaths, plot.type=\"scatter\", theme=theme_bw()) tsdisplay(diff(WWWusage)) ggtsdisplay(USAccDeaths, plot.type=\"scatter\")"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit a linear model with time series components — tslm","title":"Fit a linear model with time series components — tslm","text":"tslm used fit linear models time series including trend seasonality components.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit a linear model with time series components — tslm","text":"","code":"tslm(formula, data, subset, lambda = NULL, biasadj = FALSE, ...)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit a linear model with time series components — tslm","text":"formula object class \"formula\" (one can coerced class): symbolic description model fitted. data optional data frame, list environment (object coercible .data.frame data frame) containing variables model. found data, variables taken environment(formula), typically environment lm called. subset optional subset containing rows data keep. best results, pass logical vector rows keep. Also supports subset() functions. lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated. biasadj Use adjusted back-transformed mean Box-Cox transformations. transformed data used produce forecasts fitted values, regular back transformation result median forecasts. biasadj TRUE, adjustment made produce mean forecasts fitted values. ... arguments passed lm()","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit a linear model with time series components — tslm","text":"Returns object class \"lm\".","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fit a linear model with time series components — tslm","text":"tslm largely wrapper lm() except allows variables \"trend\" \"season\" created fly time series characteristics data. variable \"trend\" simple time trend \"season\" factor indicating season (e.g., month quarter depending frequency data).","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fit a linear model with time series components — tslm","text":"Mitchell O'Hara-Wild Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tslm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit a linear model with time series components — tslm","text":"","code":"y <- ts(rnorm(120,0,3) + 1:120 + 20*sin(2*pi*(1:120)/12), frequency=12) fit <- tslm(y ~ trend + season) plot(forecast(fit, h=20))"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify and replace outliers in a time series — tsoutliers","title":"Identify and replace outliers in a time series — tsoutliers","text":"Uses supsmu non-seasonal series periodic stl decomposition seasonal series identify outliers estimate replacements.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify and replace outliers in a time series — tsoutliers","text":"","code":"tsoutliers(x, iterate = 2, lambda = NULL)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify and replace outliers in a time series — tsoutliers","text":"x time series iterate number iterations required lambda Box-Cox transformation parameter. lambda=\"auto\", transformation automatically selected using BoxCox.lambda. transformation ignored NULL. Otherwise, data transformed model estimated.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify and replace outliers in a time series — tsoutliers","text":"index Indicating index outlier(s) replacement Suggested numeric values replace identified outliers","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Identify and replace outliers in a time series — tsoutliers","text":"Hyndman (2021) \"Detecting time series outliers\" https://robjhyndman.com/hyndsight/tsoutliers/.","code":""},{"path":[]},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify and replace outliers in a time series — tsoutliers","text":"Rob J Hyndman","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/tsoutliers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify and replace outliers in a time series — tsoutliers","text":"","code":"data(gold) tsoutliers(gold) #> $index #> [1] 770 #> #> $replacements #> [1] 494.9 #>"},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":null,"dir":"Reference","previous_headings":"","what":"Australian total wine sales — wineind","title":"Australian total wine sales — wineind","text":"Australian total wine sales wine makers bottles <= 1 litre. Jan 1980 -- Aug 1994.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Australian total wine sales — wineind","text":"","code":"wineind"},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Australian total wine sales — wineind","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Australian total wine sales — wineind","text":"Time Series Data Library. https://pkg.yangzhuoranyang.com/tsdl/","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/wineind.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Australian total wine sales — wineind","text":"","code":"tsdisplay(wineind)"},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":null,"dir":"Reference","previous_headings":"","what":"Quarterly production of woollen yarn in Australia — woolyrnq","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"Quarterly production woollen yarn Australia: tonnes. Mar 1965 -- Sep 1994.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"","code":"woolyrnq"},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"Time series data","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"Time Series Data Library. https://pkg.yangzhuoranyang.com/tsdl/","code":""},{"path":"https://pkg.robjhyndman.com/forecast/reference/woolyrnq.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quarterly production of woollen yarn in Australia — woolyrnq","text":"","code":"tsdisplay(woolyrnq)"},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-8220","dir":"Changelog","previous_headings":"","what":"forecast 8.22.0","title":"forecast 8.22.0","text":"CRAN release: 2024-03-04 hfitted now much faster ARIMA models (danigiro, #949) hfitted now much faster ETS models, produces fitted values initial states (#950)","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-8211","dir":"Changelog","previous_headings":"","what":"forecast 8.21.1","title":"forecast 8.21.1","text":"CRAN release: 2023-08-31 nnetar now allows p P 0 Bug fixes improved docs","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-821","dir":"Changelog","previous_headings":"","what":"forecast 8.21","title":"forecast 8.21","text":"CRAN release: 2023-02-27 Fixed df calculation Ljung-Box tests checkresiduals Fixed broken tests","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-820","dir":"Changelog","previous_headings":"","what":"forecast 8.20","title":"forecast 8.20","text":"CRAN release: 2023-01-06 Improvements unit tests, migrate testthat 3e Prevent failure C23 mode","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-819","dir":"Changelog","previous_headings":"","what":"forecast 8.19","title":"forecast 8.19","text":"CRAN release: 2022-11-20 Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-818","dir":"Changelog","previous_headings":"","what":"forecast 8.18","title":"forecast 8.18","text":"CRAN release: 2022-10-02 Updated RW forecasts use unbiased estimate sigma2 Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-8170","dir":"Changelog","previous_headings":"","what":"forecast 8.17.0","title":"forecast 8.17.0","text":"CRAN release: 2022-07-25 Updated dm.test() add alternative variance estimators. (#898) Added simulate.tbats() simulating TBATS models. Added dependency generics accuracy() forecast() (#902) Bux fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-816","dir":"Changelog","previous_headings":"","what":"forecast 8.16","title":"forecast 8.16","text":"CRAN release: 2022-01-10 Fixed tslm() incorrectly applying Box-Cox transformations mts provided data argument (#886). Set D=0 auto.arima applied series 2m observations fewer. Improved performance parallel search ARIMA models (jonlachmann, #891). Fixed scoping functions used ggAcf() (#896). Fixed checks xreg simulate.Arima() (#818) Improved docs bug fixes.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-815","dir":"Changelog","previous_headings":"","what":"forecast 8.15","title":"forecast 8.15","text":"CRAN release: 2021-06-01 Changed summary() methods defer console output print() Changed default s.window values mstl(), stlf() stlm(). new defaults based extensive empirical testing.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-814","dir":"Changelog","previous_headings":"","what":"forecast 8.14","title":"forecast 8.14","text":"CRAN release: 2021-03-11 Changed default BoxCox(lambda = \"auto\") lower bound -0.9. Use better variance estimates ets() bias adjustments. Improved robustness autoplot.seas() non-seasonal decomposition. Fixed scoping parameters auto.arima(parallel = TRUE) (#874). Fixed handling xreg tsCV().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-813","dir":"Changelog","previous_headings":"","what":"forecast 8.13","title":"forecast 8.13","text":"CRAN release: 2020-09-12 Fixed forecasts Arima drift initial NAs. Fixed season colours gglagplot() match y-axis (original data). Fixed facet order classical decomposition autoplot() Fixed summary() erroring tslm() models containing NA values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-812","dir":"Changelog","previous_headings":"","what":"forecast 8.12","title":"forecast 8.12","text":"CRAN release: 2020-03-31 Fixed bias adjusted forecast mean ARIMA forecasts. Improved naming accuracy() generic formals. Fix seasonal periods taylor dataset.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-811","dir":"Changelog","previous_headings":"","what":"forecast 8.11","title":"forecast 8.11","text":"CRAN release: 2020-02-09 axis gglagplot() reversed consistency stats::lag.plot().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-810","dir":"Changelog","previous_headings":"","what":"forecast 8.10","title":"forecast 8.10","text":"CRAN release: 2019-12-05 Updates remove new CRAN errors Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-89","dir":"Changelog","previous_headings":"","what":"forecast 8.9","title":"forecast 8.9","text":"CRAN release: 2019-08-22 Updates CRAN policies Suggests packages Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-88","dir":"Changelog","previous_headings":"","what":"forecast 8.8","title":"forecast 8.8","text":"CRAN release: 2019-08-02 Updates compatibility fable Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-87","dir":"Changelog","previous_headings":"","what":"forecast 8.7","title":"forecast 8.7","text":"CRAN release: 2019-04-29 Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-86","dir":"Changelog","previous_headings":"","what":"forecast 8.6","title":"forecast 8.6","text":"CRAN release: 2019-04-16 Reduced conflicts tidy forecasting packages Forecast autoplots now use colour shading autolayer() geom_forecast Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-85","dir":"Changelog","previous_headings":"","what":"forecast 8.5","title":"forecast 8.5","text":"CRAN release: 2019-01-18 Updated tsCV() handle exogenous regressors Reimplemented lagwalk methods (naive, snaive, rwf) speed improvements Added support passing arguments auto.arima() unit root tests Improved auto.arima() stepwise search algorithm Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-84","dir":"Changelog","previous_headings":"","what":"forecast 8.4","title":"forecast 8.4","text":"CRAN release: 2018-06-21 Added modelAR(), generalising nnetar() support user-defined functions Added na.action argument ets Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-83","dir":"Changelog","previous_headings":"","what":"forecast 8.3","title":"forecast 8.3","text":"CRAN release: 2018-04-11 Added mstl() handle multiple seasonal decomposition stlf(), stlm(), tsoutliers() tsclean() now use mstl(). Updated tsCV() handle multiple horizons Switched unit root tests ndiffs() use urca package Added ocsb.test Changed method choosing D auto.arima() measure seasonal strength. Added baggedModel() function generalize baggedETS Added bootstrapped PI functions Allowed lambda=‘auto’ functions lambda argument. Updated author list include major contributors Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-82","dir":"Changelog","previous_headings":"","what":"forecast 8.2","title":"forecast 8.2","text":"CRAN release: 2017-09-25 Added pkgdown site Added rolling window option tsCV Improved robustness short time series missing values Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-81","dir":"Changelog","previous_headings":"","what":"forecast 8.1","title":"forecast 8.1","text":"CRAN release: 2017-06-17 Added .character.ets, .character.bats, .character.tbats Made gghistogram() checkresiduals() robust missing values documentation now generated using roxygen Improved documentation many functions Added autoplot.msts() autolayer.msts Added .character methods many models generate model names Added .ts.forecast autoplot method bats/tbats models Better ARIMA trace output Made accuracy S3 method Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-80","dir":"Changelog","previous_headings":"","what":"forecast 8.0","title":"forecast 8.0","text":"CRAN release: 2017-02-23 Added tips start message Added pipe operator Added tsCV() CVar() functions Added baggedETS Added head.ts() tail.ts(), head tail now work properly ts objects. Added gghistogram() checkresiduals Added ggseasonplot polar coordinates Modified defaults gglagplot Added autolayer.ts Added type argument residuals() different types residuals Added support seas objects seasonal package Component extraction seasonal decomposition methods Range bars decomposition autoplots Added autoplot.StructTS Added vignette based 2008 JSS article Hyndman Khandakar Improved ggplot functions mforecast objects re-structured Added .data.frame.mforecast autoplot functions now exported Refit support arfima() stlm Better bias adjustment support Box-Cox transformation print.ARIMA better labelling constants Bug fixes Removed fortify method forecast objects","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-73","dir":"Changelog","previous_headings":"","what":"forecast 7.3","title":"forecast 7.3","text":"CRAN release: 2016-10-13 Added prediction intervals simulation nnetar(). Documentation improvement Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-72","dir":"Changelog","previous_headings":"","what":"forecast 7.2","title":"forecast 7.2","text":"CRAN release: 2016-09-09 Faceting autoplot.mts Box-Cox support ses, holt, hw ets() now works tiny time series Added h-step fitted values fitted() function. seasonal adjustment added thetaf y now standard first argument modelling functions Added truncate argument auto.arima seasadj() now S3 method series frequency < 1 non-integer seasonality now handled better ggplot2 theme support Added gglagplot, gglagchull Arima() auto.arima() now allow argument passed stats::arima(). Bug fixes speed improvements","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-71","dir":"Changelog","previous_headings":"","what":"forecast 7.1","title":"forecast 7.1","text":"CRAN release: 2016-04-14 Fixed bug auto.arima Box-Cox transformation sometimes applied twice Improved axes ggseasonalplot Improved tslm() avoid problems finding data nnetar() updated allow subsets Modified initial values ets Improved unit tests avoid deprecated functions avoid data fpp Removed fpp Suggests list","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-70","dir":"Changelog","previous_headings":"","what":"forecast 7.0","title":"forecast 7.0","text":"CRAN release: 2016-04-04 Added ggplot2 graphics Bias adjustment option added functions allow Box-Cox transformations Added Ccf function, rewrote Acf handle multivariate series. tslm() completely rewritten robust handle fourier terms easily Support multivariate linear models added subset.ts() robust, captures errors. Added xreg argument nnetar Improved labels seasonplot unit tests added Documentation improvements Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-62","dir":"Changelog","previous_headings":"","what":"forecast 6.2","title":"forecast 6.2","text":"CRAN release: 2015-10-20 Many unit tests added using testthat. Fixed bug ets short seasonal series passed data frame. Fixed bug nnetar initial predictor vector reversed. Corrected model name returned nnetar(). Fixed bug accuracy() non-integer seasonality used. Made auto.arima() robust non-integer seasonality. Fixed bug auto.arima allowmean ignored stepwise=FALSE. Improved robustness forecast.ets() explosive models multiplicative trends. Exogenous variables now passed VAR forecasts Increased maximum nmse ets() 30. Made tsoutliers() robust weak seasonality Changed tsoutliers() use supsmu non-seasonal seasonally adjusted data. Fixed bug tbats() seasonal period 1 small multiple seasonal period 2. bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-61","dir":"Changelog","previous_headings":"","what":"forecast 6.1","title":"forecast 6.1","text":"CRAN release: 2015-05-12 Made auto.arima robust","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-60","dir":"Changelog","previous_headings":"","what":"forecast 6.0","title":"forecast 6.0","text":"CRAN release: 2015-05-09 Modified dm.test give error variance zero Corrected help file splinef(). Fixed typo accuracy help file regarding RMSE Fixed bug accuracy() occurred Arima ets objects. Fixed arima.errors() handle Box-Cox transformed models. Modified auto.arima() stricter near-unit-roots. Added allowmean argument auto.arima(). Improved handling constant series Arima() forecast.Arima(). Added plot.Arima() plot.ar() functions. Added .character.Arima Captured problem bats/tbats data constant. Modified TBATS BATS estimation avoid occasional instabilities. Fixed bug forecasts bats labelled TBATS. Added allow.multiplicative.trend argument ets(). Set allow.multiplictive.trend=FALSE stlf(), stlm() forecast.ts(). Simplified arguments stlf(). Added taperedacf taperedpacf functions Added functions bootstrapping time series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-59","dir":"Changelog","previous_headings":"","what":"forecast 5.9","title":"forecast 5.9","text":"CRAN release: 2015-02-26 Improved documentation accuracy() function. Fixed occasional bug accuracy() test set single observation. Improved Acf() give better handling horizontal axis seasonal data … passed. Removed print.Arima predict.Arima added print.ARIMA method argument now passed re-fitting ARIMA model. Fixed error CH test applied short series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-58","dir":"Changelog","previous_headings":"","what":"forecast 5.8","title":"forecast 5.8","text":"CRAN release: 2015-01-06 Fixed bug versions R 3.10 using fourier fourierf. Made BoxCox.lambda() robust missing values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-57","dir":"Changelog","previous_headings":"","what":"forecast 5.7","title":"forecast 5.7","text":"CRAN release: 2014-12-17 Fixed bug tbats/bats optional arguments passed auto.arima(). Revised fourier() fourierf() avoid large orders, avoid zero columns. Improved accuracy fourier() fourierf(), simplifying code. Removed duplicate columns returned fourier/fourierf multiple seasonal periods. Corrected bugs simulate.Arima models involving xreg. Centred simulations simulate.Arima non-stationary models conditioning first observation. Added findfrequency() function. Fixed error computed residuals forecast.stl(). Improved handling short series auto.arima(). Fixed error forecasting additive damped models. Damping previously applied second forecast horizon. Fixed misuse abs() two places C code. Added na.action argument Acf() fixed na.action argument tsdisplay().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-56","dir":"Changelog","previous_headings":"","what":"forecast 5.6","title":"forecast 5.6","text":"CRAN release: 2014-09-24 Improved tbats bats ensuring ARMA coefficients close boundary invertibility stationarity. Improved nsdiffs() handling degenerate series (e.g., zeros). Improved forecast.ar() function buried within functions. Improved handling degenerate ARIMA models xreg used. robust ets() initialization. Fixed problem na.interp() seasonal data frequency <= 5. Removed undocumented option use Rmalschains optimization ets().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-55","dir":"Changelog","previous_headings":"","what":"forecast 5.5","title":"forecast 5.5","text":"CRAN release: 2014-08-12 Improved documentation croston Added stlm() forecast.stlm() functions, added forecastfunction argument way specifying forecast method stlf() forecast.stl(). Improved forecast.ar() likely work ar() forecast.ar() embedded within functions. Improved handling ARIMA models seasonality greater 48 Improved handling degenerate regression models nsdiffs Update fourier() fourierf() work msts object. Added new argument find.frequency forecast.ts(). Added new arguments d D accuracy() MASE. Corrected bugs accuracy(). Better handling regression models perfect fit auto.arima(). Fixed bug tbats.components() seasonal components.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-54","dir":"Changelog","previous_headings":"","what":"forecast 5.4","title":"forecast 5.4","text":"CRAN release: 2014-05-08 Fixed bug forecast.tbats() forecast.bats() ts.frequency match seasonal.periods. Fixed bug getResponse.lm() ’s logged dependent variable. Modified ets() avoid problems data contains large numbers. Modified ets() produce forecasts data constant. Improved arima.errors() find xreg often, return error can’t found.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-53","dir":"Changelog","previous_headings":"","what":"forecast 5.3","title":"forecast 5.3","text":"CRAN release: 2014-03-24 Unit tests added Fixed bug zzhw() reversed sign residuals. Updated help file CV() specify leave-one-. Fixed guer.cv() allow non-integer periods without warning. Added use.initial.values argument ets(). Added arimaorder() function. Modified warnings suppression using suppressWarnings() throughout.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-52","dir":"Changelog","previous_headings":"","what":"forecast 5.2","title":"forecast 5.2","text":"CRAN release: 2014-02-24 Changed default number cores 2 functions use parallel processing. Removed remaining call bats() examples run.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-51","dir":"Changelog","previous_headings":"","what":"forecast 5.1","title":"forecast 5.1","text":"CRAN release: 2014-02-08 Fixed bug tsoutliers() tsclean() short seasonal series. Fixed bug Arima() seasonal order specified numerically instead via list. Removed dimension attribution output arima.errors Improved handling “test” accuracy Changed parallel processing parLapply auto.arima Added timeDate dependency avoid errors easter() link Rcpp >= 0.11.0.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-50","dir":"Changelog","previous_headings":"","what":"forecast 5.0","title":"forecast 5.0","text":"CRAN release: 2014-01-17 Added argument model dshw(). Added bizdays() easter() calendar variables. Added arguments max.D max.d auto.arima(), ndiffs() nsdiffs(). Made several functions robust zoo objects. Corrected error calculation AICc using CV(). Made minimum default p nnetar equal 1. Added tsoutliers() tsclean() identifying replacing outliers Improved na.interp() handle seasonality added argument lambda na.interp Added robust option forecast.ts() allow outliers missing values Improved output snaive() naive() better reflect user expectations Allowed Acf() handle missing values using na.contiguous Changed default information criterion ets() AICc. Removed drift term Arima() d+D>1. Added bootstrap option forecast.Arima","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-48","dir":"Changelog","previous_headings":"","what":"forecast 4.8","title":"forecast 4.8","text":"CRAN release: 2013-09-30 Fixed bug rwf() introduced v4.7","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-47","dir":"Changelog","previous_headings":"","what":"forecast 4.7","title":"forecast 4.7","text":"CRAN release: 2013-09-27 Added forecast.forecast() simply return object passed. Removed leading zero package number. .e., 4.7 instead 4.07. better handling nearly constant time series, nearly linear time series improved handling missing values rwf corrected fitted values residuals meanf() time series data bats() tbats() now handle missing values way ets(). .e., using longest contiguous portion. better handling short time series initial states ets() modified short time series (less 3 years). nsdiffs CH test now handles degenerate cases without returning error. nnetar now handles missing values Fixed bug forecast.varest() residuals fitted values computed correctly. Added accuracy() calculation VAR models Fixed bug simulate.fracdiff() future=TRUE. Sometimes future argument ignored.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-406","dir":"Changelog","previous_headings":"","what":"forecast 4.06","title":"forecast 4.06","text":"CRAN release: 2013-06-30 accuracy() returning mape mpe 100 times large -sample errors.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-405","dir":"Changelog","previous_headings":"","what":"forecast 4.05","title":"forecast 4.05","text":"CRAN release: 2013-06-19 Fixed bug hw() works initial=“simple” Allowed bats() tbats() take non-positive values. ets() now calls optim direct via c code making ets() run much faster. Added Rmalschains possible optimizer ets(). documented. Modified forecast.lm likely original data stored returned object. Corrected bug forecast.Arima occurred Box-Cox transformation used bootstrap=TRUE. accuracy() updated gives information, returns matrix test training measures. Corrected training error measures splinef() forecasts.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-404","dir":"Changelog","previous_headings":"","what":"forecast 4.04","title":"forecast 4.04","text":"CRAN release: 2013-04-22 Added ylim argument Acf Avoided clash signal package using auto.arima(). Fixed problem plot.forecast() historical data NA available historical data. forecast.Arima() now little robust zoo object passed instead ts object. CV() now handles missing values residuals. Fixed bug holt() hw() printed model longer contains missing values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-403","dir":"Changelog","previous_headings":"","what":"forecast 4.03","title":"forecast 4.03","text":"CRAN release: 2013-03-17 forecast.lm now guesses variable name one predictor variable. Removed error trap forecast.lm xreg variables passed catching legitimate calls.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-402","dir":"Changelog","previous_headings":"","what":"forecast 4.02","title":"forecast 4.02","text":"CRAN release: 2013-03-06 Fixed error prediction intervals returned forecast.ets() simulation used Box-Cox transformation specified. Fixed bug accuracy() numerical f vector passed. Fixed man file Diebold-Mariano test. Corrected references nsdiffs() help page. Added warning nsdiffs series short seasonal differencing. Fixed problem getResponse.Arima Arima object created stats::arima() within function. Added tbats.components() extended seasadj() allow tbats objects. Added undocumented functions forecasting, printing plotting output vars::VAR.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-401","dir":"Changelog","previous_headings":"","what":"forecast 4.01","title":"forecast 4.01","text":"CRAN release: 2013-01-22 Error now trapped newxreg variables passed forecast.lm Corrected help file dshw() remove references prediction intervals. Improved help file dm.test() give information alternative hypotheses. Improved dm.test() performance small samples using t-distribution instead normal. Modified bats() tbats() examples follow CRAN policies parallel processing. Moved packages Depends Imports. Added getResponse() function return historical time series various time series model objects. Modified accuracy() use getResponse(). Allowed user-generated innovations simulate.ets(), simulate.Arima(), etc. Allowed xreg argument forecast.stl() stlf() ARIMA model used. Removed reliance caret, associated fitted residuals functions.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-400","dir":"Changelog","previous_headings":"","what":"forecast 4.00","title":"forecast 4.00","text":"CRAN release: 2012-11-27 robust handling degenerate ARIMA models. New defaults shaded colors used prediction intervals plots. auto.arima() now remembers name series Box-Cox transformation used. New function nnetar() automatic neural network forecasting time series. arfima() now tries harder ensure ARMA part stationary. ts control added forecast linear models forecast.lm(). Fixed bug bats() caused error use.box.cox=FALSE use.trend=FALSE. Added residuals fitted methods train avNNet objects caret package. accuracy() can now figure overlapping times x f. rwf() now handles missing values. Revised ses(), holt() hw() can optionally use traditional initialization.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-325","dir":"Changelog","previous_headings":"","what":"forecast 3.25","title":"forecast 3.25","text":"CRAN release: 2012-09-11 Fixed bug simulate.Arima. Improved handling short seasonal time series auto.arima(). Added seasonal argument auto.arima(). Fixed bug splinef() added gcv method estimating smoothing parameter.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-324-23-july-2012","dir":"Changelog","previous_headings":"","what":"forecast 3.24 (23 July 2012","title":"forecast 3.24 (23 July 2012","text":"CRAN release: 2012-07-23 Fixed bug auto.arima() introduced v3.23 meant ARIMA(0,0,0) model returned half time.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-323","dir":"Changelog","previous_headings":"","what":"forecast 3.23","title":"forecast 3.23","text":"CRAN release: 2012-07-18 Fixed bug arfima() meant drange argument ignored. Extended auto.arima() returns something sensible data constant.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-322","dir":"Changelog","previous_headings":"","what":"forecast 3.22","title":"forecast 3.22","text":"CRAN release: 2012-06-07 Increased maximum forecast horizon ets models 2000 unlimited. Corrected bug Arima(). Previously include.constant=FALSE ignored. corrections bats tbats. Modified parallel implementation auto.arima Windows.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-321","dir":"Changelog","previous_headings":"","what":"forecast 3.21","title":"forecast 3.21","text":"CRAN release: 2012-04-30 Fixed bug auto.arima() lambda non-zero stepwise FALSE. Fixed bug auto.arima() selecting d D>0. Fixed bug ets() seasonal period less 1. Turned warnings auto.arima() ets() seasonal period less 1. Added plotting methods bats tbats objects. Changed default forecast horizons bats tbats objects. Modified bats tbats now use seasonal.periods ts msts objects modelled.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-320","dir":"Changelog","previous_headings":"","what":"forecast 3.20","title":"forecast 3.20","text":"CRAN release: 2012-04-02 Fixed bugs forecast.lm(). Improved handling newdata forecast.lm() provide meaningful error messages. Fixed bug dm.test() occurred errors small.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-319","dir":"Changelog","previous_headings":"","what":"forecast 3.19","title":"forecast 3.19","text":"CRAN release: 2012-02-22 Improved plotting forecast objects lm models Added MASE lm forecasts using insample mean forecasts scaling. Modified definition MASE seasonal time series use seasonal naive insample scaling. Modified meanf() allow used cross-sectional data. Updated accuracy() allow used cross-sectional data, lm forecasts lm objects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-318","dir":"Changelog","previous_headings":"","what":"forecast 3.18","title":"forecast 3.18","text":"CRAN release: 2012-02-17 Added method plotting non-time-series forecasts plot.forecast(). Removed partial arg matching. Cleaned code, removing commented sections, etc. Added robust option stlf(). Added naive rwdrift options stlf() forecast.stl(). Improved handling msts objects BoxCox.lambda Fixed minor bugs tbats() bats Improved speed bats() tbats().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-317","dir":"Changelog","previous_headings":"","what":"forecast 3.17","title":"forecast 3.17","text":"CRAN release: 2012-02-02 Improved forecast.lm() likely find original data lm object. Parallel processing now available auto.arima() stepwise=FALSE Default model selection auto.arima() changed AICc rather AIC. may affect model selection short time series. max orders auto.arima() now restricted less 1/3 length data.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-316","dir":"Changelog","previous_headings":"","what":"forecast 3.16","title":"forecast 3.16","text":"CRAN release: 2011-12-24 Corrected problem AIC computation bats tbats Fixed handling non-seasonal data bats Changed dependency >= R 2.14.0 order ensure parallel package available.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-315","dir":"Changelog","previous_headings":"","what":"forecast 3.15","title":"forecast 3.15","text":"CRAN release: 2011-12-22 New functions tbats() forecast.tbats() multiple seasonal time series modelling. bats() tbats() use parallel processing possible. Minor improvements bats() forecast.bats(). decompose() removed function stats package now fixed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-314","dir":"Changelog","previous_headings":"","what":"forecast 3.14","title":"forecast 3.14","text":"CRAN release: 2011-12-09 Improved documentation forecast.ts Corrected bug dshw() applied non-ts object. Added error message dshw() applied data containing zeros negative values Added checks dshw() applied time series non-nested periods. Added msts object class multiple seasonal time series Made taylor data set msts object. Added bats() function multiple seasonal time series modelling Added forecast.bats() function forecasting BATS models Byte compiling turned Depending Rcpp RcppArmadillo speed code .","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-313","dir":"Changelog","previous_headings":"","what":"forecast 3.13","title":"forecast 3.13","text":"CRAN release: 2011-11-20 Bug fix forecast.StructTS() due changes StructTS object. default h set 0. Thanks Tarmo Leinonen reporting problem. Bug fix forecast.stl() h longer one seasonal period sometimes returned missing forecasts. Thanks Kevin Burton reporting problem. forecast.stl() longer allows seasonal ETS model specified. Thanks Stefano Birmani suggestion.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-312","dir":"Changelog","previous_headings":"","what":"forecast 3.12","title":"forecast 3.12","text":"CRAN release: 2011-11-16 Added option control ets model stlf() forecast.stl(). Thanks Stefano Birmani suggestion. Reordered arguments forecast.lm() stlf() consistent forecast functions. Modified tslm() likely find relevant data passed argument. Fixed bug forecast.ets returned zero forecasts models seasonal period > 24.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-311","dir":"Changelog","previous_headings":"","what":"forecast 3.11","title":"forecast 3.11","text":"CRAN release: 2011-11-02 Fixed bug dshw() smallest period odd","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-310","dir":"Changelog","previous_headings":"","what":"forecast 3.10","title":"forecast 3.10","text":"CRAN release: 2011-10-27 Added lambda argument naive() snaive(). Fixed bug ets() high frequency data. Fixed bug rwf() incorrect fitted values residuals sometimes returned. Modified number lags displayed default tsdisplay().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-309","dir":"Changelog","previous_headings":"","what":"forecast 3.09","title":"forecast 3.09","text":"CRAN release: 2011-10-18 Fixed bug causing occasional problems simulate.Arima() MA order greater 2 future=TRUE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-308","dir":"Changelog","previous_headings":"","what":"forecast 3.08","title":"forecast 3.08","text":"CRAN release: 2011-10-15 Bug fix forecast.stl() occurred forecast horizon less seasonal period. Added lambda argument forecast.stl().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-307","dir":"Changelog","previous_headings":"","what":"forecast 3.07","title":"forecast 3.07","text":"CRAN release: 2011-10-11 Bug fix ets() concerning non-seasonal models high-frequency data. sometimes returned forecasts equal zero.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-306","dir":"Changelog","previous_headings":"","what":"forecast 3.06","title":"forecast 3.06","text":"CRAN release: 2011-10-04 Switched useDynLib preparation Rv2.14.0.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-305","dir":"Changelog","previous_headings":"","what":"forecast 3.05","title":"forecast 3.05","text":"CRAN release: 2011-10-03 Fixed bug ets() prevent non-seasonal models fitted high frequency data.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-304","dir":"Changelog","previous_headings":"","what":"forecast 3.04","title":"forecast 3.04","text":"CRAN release: 2011-09-23 Fixed bug drift xreg used together auto.arima() Arima().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-303","dir":"Changelog","previous_headings":"","what":"forecast 3.03","title":"forecast 3.03","text":"CRAN release: 2011-09-02 Bug fix dshw() using slightly incorrect seasonal estimates forecasts Bug fix forecast.StructTS due change structure StructTS object. Better error capture tslm seasonal dummies specified non-seasonal data. Re-formatted help files prevent viewing problems pdf manual.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-302","dir":"Changelog","previous_headings":"","what":"forecast 3.02","title":"forecast 3.02","text":"CRAN release: 2011-08-25 Bug fixes","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-300","dir":"Changelog","previous_headings":"","what":"forecast 3.00","title":"forecast 3.00","text":"CRAN release: 2011-08-24 Added Box-Cox parameter argument Arima(), ets(), arfima(), stlf(), rwf(), meanf(), splinef Added Box-Cox parameter argument forecast.Arima(), forecast.ets(), forecast.fracdiff(), forecast.ar(), forecast.StructTS, forecast.HoltWinters(). Removed lambda argument plot.forecast() accuracy(). Added BoxCox.lambda() function allow automatic choice Box-Cox parameter using Guerrero’s method profile log likelihood method. Modified BoxCox InvBoxCox return missing values lambda < 0 data < 0. Add nsdiffs() function selecting number seasonal differences. Modified selection seasonal differencing auto.arima(). Better error message seasonal factor used tslm() non-seasonal data. Added PI argument forecast.ets() allow point forecasts computed. Added include.constant argument Arima(). Added subset.ts() function. Upgraded seasonplot() function allow colors fix bugs. Fixed fitted values returned forecast.HoltWinters Modified simulate.Arima() undocumented changes filter() function stats package. Changed residuals returned splinef() ordinary residuals. standardized residuals now returned standardizedresiduals. Added dshw() function double-seasonal Holt-Winters method based Taylor (2003). Fixed bugs decompose() function caused results incorrect odd frequencies.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-219","dir":"Changelog","previous_headings":"","what":"forecast 2.19","title":"forecast 2.19","text":"CRAN release: 2011-06-04 Added xreg information object returned auto.arima(). Added Acf(), Pacf(), ma() CV() functions. Fixed bugs re-fitting ARIMA models new data.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-218-2011-05-19","dir":"Changelog","previous_headings":"","what":"forecast 2.18 (2011-05-19)","title":"forecast 2.18 (2011-05-19)","text":"Fixed bug seasonplot() year labels sometimes incorrect.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-217","dir":"Changelog","previous_headings":"","what":"forecast 2.17","title":"forecast 2.17","text":"CRAN release: 2011-04-06 Modified simulate.Arima() handle seasonal ARIMA models. Modified ets() handle missing values. largest continuous section data now modelled. Improved plot.forecast() handle missing values end observed series. Added replacement decompose() avoid truncation seasonal term seasonally adjusted series. Fixed bug seasadj() handle multiplicative decomposition, avoid missing values ends.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-216","dir":"Changelog","previous_headings":"","what":"forecast 2.16","title":"forecast 2.16","text":"CRAN release: 2011-03-07 Changed way missing values handled tslm","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-215","dir":"Changelog","previous_headings":"","what":"forecast 2.15","title":"forecast 2.15","text":"CRAN release: 2011-03-05 Added fourier(), fourierf(), tslm Improved forecast.lm() allow trend seasonal terms.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-214","dir":"Changelog","previous_headings":"","what":"forecast 2.14","title":"forecast 2.14","text":"CRAN release: 2011-03-04 Added forecast.lm Modified accuracy() print.forecast() allow non time series forecasts. Fixed visibility stlf().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-213","dir":"Changelog","previous_headings":"","what":"forecast 2.13","title":"forecast 2.13","text":"CRAN release: 2011-02-16 Fixed bug accuracy() 1 forecast specified. Added forecast.stl() stlf() functions Modified forecast.ts() use stlf() frequency > 12. Made BoxCox() InvBoxCox() robust negative values Fixed bug simulate.Arima() future=TRUE. bias sample paths.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-212","dir":"Changelog","previous_headings":"","what":"forecast 2.12","title":"forecast 2.12","text":"CRAN release: 2011-01-19 Added naive() snaive() functions. Improved handling seasonal data frequency < 1. Added lambda argument accuracy().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-211","dir":"Changelog","previous_headings":"","what":"forecast 2.11","title":"forecast 2.11","text":"CRAN release: 2010-11-04 MLE arfima() fails (usually series non-stationary), LS estimate now returned.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-210","dir":"Changelog","previous_headings":"","what":"forecast 2.10","title":"forecast 2.10","text":"Fixed bug arfima() MA parameters wrong sign estim=“mle” chosen. arfima() now allowed sequence missing values start series end series","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-209","dir":"Changelog","previous_headings":"","what":"forecast 2.09","title":"forecast 2.09","text":"CRAN release: 2010-10-15 Fixed bug forecast.fracdiff() caused error h=1. Added shadebars plot.forecast(). Fixed bug plot.forecast() allow plotting h=1.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-208","dir":"Changelog","previous_headings":"","what":"forecast 2.08","title":"forecast 2.08","text":"CRAN release: 2010-09-22 Added pp test option auto.arima() ndiffs(). Fixed bug simulate.ets() causing problems forecasting ETS models including ETS(M,M,N).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-207","dir":"Changelog","previous_headings":"","what":"forecast 2.07","title":"forecast 2.07","text":"CRAN release: 2010-09-09 Fixed bug simulate.Arima(). Previous sample paths d=2 future=TRUE incorrect. Changed way color implemented plot.forecast() avoid colour changes graphics window refreshed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-206","dir":"Changelog","previous_headings":"","what":"forecast 2.06","title":"forecast 2.06","text":"CRAN release: 2010-07-29 Added MLE option arfima(). Added simulate.Arima(), simulate.ar() simulate.fracdiff","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-205","dir":"Changelog","previous_headings":"","what":"forecast 2.05","title":"forecast 2.05","text":"CRAN release: 2010-05-11 Added arfima() forecast method handle ARFIMA models arfima() fracdiff(). Added residuals fitted methods fracdiff objects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-204","dir":"Changelog","previous_headings":"","what":"forecast 2.04","title":"forecast 2.04","text":"CRAN release: 2010-04-16 Fixed bug auto.arima() occurred rarely.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-203","dir":"Changelog","previous_headings":"","what":"forecast 2.03","title":"forecast 2.03","text":"CRAN release: 2009-12-24 Added option auto.arima() allow drift terms excluded models considered.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-202","dir":"Changelog","previous_headings":"","what":"forecast 2.02","title":"forecast 2.02","text":"CRAN release: 2009-12-23 Fixed bug auto.arima() occurred xreg drift, approximation=TRUE stepwise=FALSE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-201","dir":"Changelog","previous_headings":"","what":"forecast 2.01","title":"forecast 2.01","text":"CRAN release: 2009-09-18 Fixed bug time index croston() output. Added explanation models croston() help file.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-200","dir":"Changelog","previous_headings":"","what":"forecast 2.00","title":"forecast 2.00","text":"CRAN release: 2009-09-07 Package removed forecasting bundle","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-126-29-august-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.26 (29 August 2009)","title":"forecast 1.26 (29 August 2009)","text":"Added .data.frame.forecast(). allows write.table() work forecast objects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-125-22-july-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.25 (22 July 2009)","title":"forecast 1.25 (22 July 2009)","text":"Added argument auto.arima() ndiffs() allow ADF test used instead KPSS test selecting number differences. Added argument plot.forecast() allow different colors line types plotting prediction intervals. Modified forecast.ts() give sensible results time series containing fewer four observations.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-124-9-april-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.24 (9 April 2009)","title":"forecast 1.24 (9 April 2009)","text":"Fixed bug dm.test() avoid errors missing values residuals. informative error messages auto.arima() fails find suitable model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-123-22-february-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.23 (22 February 2009)","title":"forecast 1.23 (22 February 2009)","text":"Fixed bugs meant xreg terms auto.arima() sometimes caused errors stepwise=FALSE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-122-30-january-2009","dir":"Changelog","previous_headings":"","what":"forecast 1.22 (30 January 2009)","title":"forecast 1.22 (30 January 2009)","text":"Fixed bug meant regressor variables used seasonal time series auto.arima().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-121-16-december-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.21 (16 December 2008)","title":"forecast 1.21 (16 December 2008)","text":"Fixed bugs introduced v1.20.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-120-14-december-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.20 (14 December 2008)","title":"forecast 1.20 (14 December 2008)","text":"Updated auto.arima() allow regression variables. Fixed bug print.Arima() caused problems data inside data.frame. forecast.Arima(), argument h now set length xreg argument null.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-119-7-november-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.19 (7 November 2008)","title":"forecast 1.19 (7 November 2008)","text":"Updated Arima() allow regression variables refitting existing model new data.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-118-6-november-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.18 (6 November 2008)","title":"forecast 1.18 (6 November 2008)","text":"Bug fix ets(): models frequency less 1 cause R hang. Bug fix ets(): models frequency greater 12 fit due parameters range. Default lower upper bounds parameters , ets() changed 0.0001 0.9999 (instead 0.01 0.99).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-117-10-october-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.17 (10 October 2008)","title":"forecast 1.17 (10 October 2008)","text":"Calculation BIC account reduction length series due differencing. Now fixed auto.arima() print.Arima(). tsdiag() now works ets objects.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-116-29-september-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.16 (29 September 2008)","title":"forecast 1.16 (29 September 2008)","text":"Another bug fix auto.arima(). Occasionally root checking cause error. condition now trapped.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-115-16-september-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.15 (16 September 2008)","title":"forecast 1.15 (16 September 2008)","text":"Bug fix auto.arima(). series wasn’t always stored part return object stepwise=FALSE.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-114-1-august-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.14 (1 August 2008)","title":"forecast 1.14 (1 August 2008)","text":"time series stored M3 Mcomp package contain components listed help file. problem now fixed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-113-16-june-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.13 (16 June 2008)","title":"forecast 1.13 (16 June 2008)","text":"Bug plot.ets() fixed plots non-seasonal models seasonal data now work. Warning added ets() time series contains large numbers (can cause numerical problems). Anything 1,000,000 ok, larger best scale series first. Fixed problem forecast.HoltWinters() lower upper limits interchanged.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-112-22-april-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.12 (22 April 2008)","title":"forecast 1.12 (22 April 2008)","text":"Objects now coerced class ts ets(). allows work zoo objects. new function dm.test() added. implements Diebold-Mariano test predictive accuracy. Yet bug-fixes auto.arima().","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-111-8-february-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.11 (8 February 2008)","title":"forecast 1.11 (8 February 2008)","text":"Modifications auto.arima() case ML estimation work chosen model. Previously return model. Now returns model estimated using CSS. AIC values reported auto.arima() trace=TRUE approximation=TRUE now comparable final AIC values. Addition expsmooth package.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-110-21-january-2008","dir":"Changelog","previous_headings":"","what":"forecast 1.10 (21 January 2008)","title":"forecast 1.10 (21 January 2008)","text":"Fixed bug seasadj() allows multiple seasonality Fixed another bug print.Arima() Bug fixes auto.arima(). sometimes returning non-optimal model, occasionally model . Also, additional stationarity invertibility testing now done.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-109-11-december-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.09 (11 December 2007)","title":"forecast 1.09 (11 December 2007)","text":"new argument ‘restrict’ added ets() default TRUE. set FALSE, unstable ETS models also allowed. bug print.Arima() function fixed.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-108-21-november-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.08 (21 November 2007)","title":"forecast 1.08 (21 November 2007)","text":"AICc BIC corrected. Previously taken account sigma^2 parameter computing number parameters. arima() function changed Arima() avoid clash arima() function stats package. auto.arima now uses approximation likelihood selecting model series 100 observations seasonal period greater 12. behaviour can -ridden via approximation argument. new function plot.ets() provides decomposition plot ETS model. predict() now alias forecast() wherever existing predict() method. argument conf changed level forecasting methods consistent R functions. functions gof() forecasterrors() replaced accuracy() handles -sample --sample forecast accuracy. initialization method used non-seasonal ETS model applied seasonal data changed slightly. following methods ets objects added: summary, coef logLik. following methods Arima objects added: summary.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-107-25-july-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.07 (25 July 2007)","title":"forecast 1.07 (25 July 2007)","text":"Bug fix summary -sample errors. ets models multiplicative errors, reported -sample values MSE, MAPE, MASE, etc., summary() gof() incorrect. ARIMA models frequency greater 49 now allowed. unit-root testing frequency 50 , careful! Improvements documentation.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-106-15-june-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.06 (15 June 2007)","title":"forecast 1.06 (15 June 2007)","text":"Bug fix auto.arima(). always respect stated values max.p, max.q, max.P max.Q. tseries package now installed automatically along forecasting bundle, whereas previously suggested.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-105-28-may-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.05 (28 May 2007)","title":"forecast 1.05 (28 May 2007)","text":"Introduced auto.arima() provide stepwise approach ARIMA modelling. much faster old best.arima(). old grid-search method used best.arima() still available using stepwise=FALSE calling auto.arima(). Automated choice seasonal differences introduced auto.arima(). small changes starting values ets() models. Fixed bug applying ets() new data using previously fitted model.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-104-30-january-2007","dir":"Changelog","previous_headings":"","what":"forecast 1.04 (30 January 2007)","title":"forecast 1.04 (30 January 2007)","text":"Added include.drift arima() Fixed bug seasonal forecasting ets()","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-103-20-october-2006","dir":"Changelog","previous_headings":"","what":"forecast 1.03 (20 October 2006)","title":"forecast 1.03 (20 October 2006)","text":"Fixed DOS line feed problems bothering unix users.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-102-12-october-2006","dir":"Changelog","previous_headings":"","what":"forecast 1.02 (12 October 2006)","title":"forecast 1.02 (12 October 2006)","text":"Added AICc option ets() best.arima(). Corrected bug calculation fitted values ets models multiplicative errors.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-101-25-september-2006","dir":"Changelog","previous_headings":"","what":"forecast 1.01 (25 September 2006)","title":"forecast 1.01 (25 September 2006)","text":"Modified ndiffs() maximum number differences allowed 2.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-10-31-august-2006","dir":"Changelog","previous_headings":"","what":"forecast 1.0 (31 August 2006)","title":"forecast 1.0 (31 August 2006)","text":"Added MASE gof(). croston() now returns fitted values residuals. arima() longer allows linear trend + ARMA errors default. Also, drift non-stationary models can turned . version first uploaded CRAN.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-099992-8-august-2006","dir":"Changelog","previous_headings":"","what":"forecast 0.99992 (8 August 2006)","title":"forecast 0.99992 (8 August 2006)","text":"Corrections help files. changes functionality.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-099991-2-august-2006","dir":"Changelog","previous_headings":"","what":"forecast 0.99991 (2 August 2006)","title":"forecast 0.99991 (2 August 2006)","text":"bug fixes. ets now converges good model often.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-09999-1-august-2006","dir":"Changelog","previous_headings":"","what":"forecast 0.9999 (1 August 2006)","title":"forecast 0.9999 (1 August 2006)","text":"Mostly bug fixes. data sets moved fma forecast used book. ets now considerably slower gives better results. Full optimization now option (slows ). many problems poor models partial optimization used. ’ll work speeding sometime, high priority. fast enough use. really need forecast 1000 series, run overnight. ets, ’ve experimented new starting conditions optimization seems fairly robust now. Multiplicative error models can longer applied series containing zeros negative values. However, forecasts models constrained positive.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0999-27-july-2006","dir":"Changelog","previous_headings":"","what":"forecast 0.999 (27 July 2006)","title":"forecast 0.999 (27 July 2006)","text":"package turned three packages forming bundle. functions datasets still forecast package. data Makridakis, Wheelwright Hyndman (1998) now fma package. M-competition data now Mcomp package. fma Mcomp automatically load forecast. first version available operating systems (just Windows). pegels replaced ets. ets fits model; doesn’t produce forecasts. get forecasts, apply forecast function ets object. ets completely rewritten makes slower, much easier maintain. Different boundary conditions used different optimizer used, don’t expect results identical done old pegels function. get something like results old pegels function, use forecast(ets()). simulate.ets() added simulate ets model. Changed name cars auto avoid clash cars data datasets package. arima2 functionality now handled arima() pegels2 functionality now handled ets. best.arima now allows option BIC used model selection. Croston’s method added function croston(). ts.display renamed tsdisplay mean.f changed meanf, theta.f changed thetaf, rw.f changed rwf, seasonaldummy.f seasonaldummyf, sindex.f sindexf, spline.f splinef. changes avoid potential problems anyone introduces ‘f’ class.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0994-4-october-2004","dir":"Changelog","previous_headings":"","what":"forecast 0.994 (4 October 2004)","title":"forecast 0.994 (4 October 2004)","text":"Fixed bug arima caused predict() sometimes fail xreg term. bug fixes handling regression terms arima models. New print.Arima function informative output.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0993-20-july-2004","dir":"Changelog","previous_headings":"","what":"forecast 0.993 (20 July 2004)","title":"forecast 0.993 (20 July 2004)","text":"Added forecast function structural time series models obtained using StructTS(). Changed default parameter space pegels() force admissibility. Added option pegels() allow restriction models finite forecast variance. restriction imposed default. Fixed bug arima.errors(). Changes made arima() meant arima.errors() often returning error message. Added namespace package making fewer functions visible user.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-099-21-may-2004","dir":"Changelog","previous_headings":"","what":"forecast 0.99 (21 May 2004)","title":"forecast 0.99 (21 May 2004)","text":"Added automatic selection order differencing best.arima. Added possibility linear trend arima models. pegels(), option added allow parameters exponential smoothing model ‘admissible’ (invertible) region rather within usual (0,1) region. Fixed bugs pegels. Included M1 M3 data functions subset plot . Note: package work R1.9 later.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-098-23-august-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.98 (23 August 2003)","title":"forecast 0.98 (23 August 2003)","text":"Added facilities pegels. o now possible specify particular values smoothing parameters rather always use optimized values. none specified, optimal values still estimated . o also possible specify upper lower bounds parameter separately. New function: theta.f. implements Theta method well M3 competition. minor problems pegels fixed bug forecast.plot meant didn’t work series contained missing values.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0972-11-july-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.972 (11 July 2003)","title":"forecast 0.972 (11 July 2003)","text":"Small bug fix: pegels return correct model model partially specified.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-0971-10-july-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.971 (10 July 2003)","title":"forecast 0.971 (10 July 2003)","text":"Minor fixes make sure package work R v1.6.x. changes functionality.","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-097-9-july-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.97 (9 July 2003)","title":"forecast 0.97 (9 July 2003)","text":"Fully automatic forecasting based state space approach exponential smoothing now added. technical details, see Hyndman, Koehler, Snyder Grose (2002). Local linear forecasting using cubic smoothing splines added. technical details, see Hyndman, King, Pitrun Billah (2002).","code":""},{"path":"https://pkg.robjhyndman.com/forecast/news/index.html","id":"forecast-096-15-may-2003","dir":"Changelog","previous_headings":"","what":"forecast 0.96 (15 May 2003)","title":"forecast 0.96 (15 May 2003)","text":"Many functions rewritten make use methods classes. Consequently several functions names changed many arguments altered. Please see help files details. Added functions forecast.Arima forecat.ar Added functions gof seasadj Fixed bug plot.forecast. starting date plot sometimes incorrect. Added residuals components rw.f mean.f. Made several changes ensure compatibility Rv1.7.0. Removed work-around fix bug monthplot command present R v<=1.6.2. Fixed motel data set (columns swapped)","code":""}]