Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Module--
Title produced by softwareARIMA Forecasting
Date of computationWed, 04 Dec 2013 12:58:47 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2013/Dec/04/t1386179949439d4ft2g66fo7q.htm/, Retrieved Thu, 28 Mar 2024 17:11:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=230730, Retrieved Thu, 28 Mar 2024 17:11:45 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact72
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2013-12-04 13:29:58] [9bd698ecfffbb3f270ebcac6c258c074]
- RM      [ARIMA Forecasting] [] [2013-12-04 17:58:47] [a019c4d19e3b627f52e0deb3ae5aac0f] [Current]
Feedback Forum

Post a new message
Dataseries X:
9700
9081
9084
9743
8587
9731
9563
9998
9437
10038
9918
9252
9737
9035
9133
9487
8700
9627
8947
9283
8829
9947
9628
9318
9605
8640
9214
9567
8547
9185
9470
9123
9278
10170
9434
9655
9429
8739
9552
9687
9019
9672
9206
9069
9788
10312
10105
9863
9656
9295
9946
9701
9049
10190
9706
9765
9893
9994
10433
10073
10112
9266
9820
10097
9115
10411
9678
10408
10153
10368
10581
10597
10680
9738
9556




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 5 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230730&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230730&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230730&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net







Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[63])
519946-------
529701-------
539049-------
5410190-------
559706-------
569765-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979916.36249356.979310475.74550.26340.63220.77480.6322
6591159189.27538619.29929759.25150.39929e-040.68520.015
661041110135.17529555.535910714.81460.17550.99970.42650.8567
6796789731.22699142.756610319.69710.42960.01180.53350.3837
68104089714.85439118.300910311.40770.01140.54820.43460.3649
69101539933.81349329.851210537.77560.23840.06190.55270.6441
701036810285.95229675.19110896.71350.39620.66520.82560.9326
711058110373.82449756.81710990.83180.25520.50740.42540.9607
721059710093.39939470.648210716.15040.05650.06240.52560.8052
731068010061.45919433.438610689.47960.02680.04730.43730.7744
7497389346.02898713.13859978.91930.112400.59790.0711
7595569929.39479292.015510566.7740.12540.72190.63170.6317

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
time & Y[t] & F[t] & 95% LB & 95% UB & p-value(H0: Y[t] = F[t]) & P(F[t]>Y[t-1]) & P(F[t]>Y[t-s]) & P(F[t]>Y[63]) \tabularnewline
51 & 9946 & - & - & - & - & - & - & - \tabularnewline
52 & 9701 & - & - & - & - & - & - & - \tabularnewline
53 & 9049 & - & - & - & - & - & - & - \tabularnewline
54 & 10190 & - & - & - & - & - & - & - \tabularnewline
55 & 9706 & - & - & - & - & - & - & - \tabularnewline
56 & 9765 & - & - & - & - & - & - & - \tabularnewline
57 & 9893 & - & - & - & - & - & - & - \tabularnewline
58 & 9994 & - & - & - & - & - & - & - \tabularnewline
59 & 10433 & - & - & - & - & - & - & - \tabularnewline
60 & 10073 & - & - & - & - & - & - & - \tabularnewline
61 & 10112 & - & - & - & - & - & - & - \tabularnewline
62 & 9266 & - & - & - & - & - & - & - \tabularnewline
63 & 9820 & - & - & - & - & - & - & - \tabularnewline
64 & 10097 & 9916.3624 & 9356.9793 & 10475.7455 & 0.2634 & 0.6322 & 0.7748 & 0.6322 \tabularnewline
65 & 9115 & 9189.2753 & 8619.2992 & 9759.2515 & 0.3992 & 9e-04 & 0.6852 & 0.015 \tabularnewline
66 & 10411 & 10135.1752 & 9555.5359 & 10714.8146 & 0.1755 & 0.9997 & 0.4265 & 0.8567 \tabularnewline
67 & 9678 & 9731.2269 & 9142.7566 & 10319.6971 & 0.4296 & 0.0118 & 0.5335 & 0.3837 \tabularnewline
68 & 10408 & 9714.8543 & 9118.3009 & 10311.4077 & 0.0114 & 0.5482 & 0.4346 & 0.3649 \tabularnewline
69 & 10153 & 9933.8134 & 9329.8512 & 10537.7756 & 0.2384 & 0.0619 & 0.5527 & 0.6441 \tabularnewline
70 & 10368 & 10285.9522 & 9675.191 & 10896.7135 & 0.3962 & 0.6652 & 0.8256 & 0.9326 \tabularnewline
71 & 10581 & 10373.8244 & 9756.817 & 10990.8318 & 0.2552 & 0.5074 & 0.4254 & 0.9607 \tabularnewline
72 & 10597 & 10093.3993 & 9470.6482 & 10716.1504 & 0.0565 & 0.0624 & 0.5256 & 0.8052 \tabularnewline
73 & 10680 & 10061.4591 & 9433.4386 & 10689.4796 & 0.0268 & 0.0473 & 0.4373 & 0.7744 \tabularnewline
74 & 9738 & 9346.0289 & 8713.1385 & 9978.9193 & 0.1124 & 0 & 0.5979 & 0.0711 \tabularnewline
75 & 9556 & 9929.3947 & 9292.0155 & 10566.774 & 0.1254 & 0.7219 & 0.6317 & 0.6317 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230730&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[63])[/C][/ROW]
[ROW][C]51[/C][C]9946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]9701[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]9049[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]10190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]9706[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]9765[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]9893[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]9994[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]10433[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]10073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]10112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]9266[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]9820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]10097[/C][C]9916.3624[/C][C]9356.9793[/C][C]10475.7455[/C][C]0.2634[/C][C]0.6322[/C][C]0.7748[/C][C]0.6322[/C][/ROW]
[ROW][C]65[/C][C]9115[/C][C]9189.2753[/C][C]8619.2992[/C][C]9759.2515[/C][C]0.3992[/C][C]9e-04[/C][C]0.6852[/C][C]0.015[/C][/ROW]
[ROW][C]66[/C][C]10411[/C][C]10135.1752[/C][C]9555.5359[/C][C]10714.8146[/C][C]0.1755[/C][C]0.9997[/C][C]0.4265[/C][C]0.8567[/C][/ROW]
[ROW][C]67[/C][C]9678[/C][C]9731.2269[/C][C]9142.7566[/C][C]10319.6971[/C][C]0.4296[/C][C]0.0118[/C][C]0.5335[/C][C]0.3837[/C][/ROW]
[ROW][C]68[/C][C]10408[/C][C]9714.8543[/C][C]9118.3009[/C][C]10311.4077[/C][C]0.0114[/C][C]0.5482[/C][C]0.4346[/C][C]0.3649[/C][/ROW]
[ROW][C]69[/C][C]10153[/C][C]9933.8134[/C][C]9329.8512[/C][C]10537.7756[/C][C]0.2384[/C][C]0.0619[/C][C]0.5527[/C][C]0.6441[/C][/ROW]
[ROW][C]70[/C][C]10368[/C][C]10285.9522[/C][C]9675.191[/C][C]10896.7135[/C][C]0.3962[/C][C]0.6652[/C][C]0.8256[/C][C]0.9326[/C][/ROW]
[ROW][C]71[/C][C]10581[/C][C]10373.8244[/C][C]9756.817[/C][C]10990.8318[/C][C]0.2552[/C][C]0.5074[/C][C]0.4254[/C][C]0.9607[/C][/ROW]
[ROW][C]72[/C][C]10597[/C][C]10093.3993[/C][C]9470.6482[/C][C]10716.1504[/C][C]0.0565[/C][C]0.0624[/C][C]0.5256[/C][C]0.8052[/C][/ROW]
[ROW][C]73[/C][C]10680[/C][C]10061.4591[/C][C]9433.4386[/C][C]10689.4796[/C][C]0.0268[/C][C]0.0473[/C][C]0.4373[/C][C]0.7744[/C][/ROW]
[ROW][C]74[/C][C]9738[/C][C]9346.0289[/C][C]8713.1385[/C][C]9978.9193[/C][C]0.1124[/C][C]0[/C][C]0.5979[/C][C]0.0711[/C][/ROW]
[ROW][C]75[/C][C]9556[/C][C]9929.3947[/C][C]9292.0155[/C][C]10566.774[/C][C]0.1254[/C][C]0.7219[/C][C]0.6317[/C][C]0.6317[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230730&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230730&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[63])
519946-------
529701-------
539049-------
5410190-------
559706-------
569765-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979916.36249356.979310475.74550.26340.63220.77480.6322
6591159189.27538619.29929759.25150.39929e-040.68520.015
661041110135.17529555.535910714.81460.17550.99970.42650.8567
6796789731.22699142.756610319.69710.42960.01180.53350.3837
68104089714.85439118.300910311.40770.01140.54820.43460.3649
69101539933.81349329.851210537.77560.23840.06190.55270.6441
701036810285.95229675.19110896.71350.39620.66520.82560.9326
711058110373.82449756.81710990.83180.25520.50740.42540.9607
721059710093.39939470.648210716.15040.05650.06240.52560.8052
731068010061.45919433.438610689.47960.02680.04730.43730.7744
7497389346.02898713.13859978.91930.112400.59790.0711
7595569929.39479292.015510566.7740.12540.72190.63170.6317







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
640.02880.01790.01790.018132629.9344000.35190.3519
650.0316-0.00810.0130.01315516.825919073.3802138.1064-0.14470.2483
660.02920.02650.01750.017776079.300238075.3535195.12910.53730.3446
670.0309-0.00550.01450.01462833.098229264.7897171.0695-0.10370.2844
680.03130.06660.02490.0255480450.952119502.0222345.69061.35020.4975
690.0310.02160.02440.024948042.7849107592.1493328.01240.4270.4858
700.03030.00790.0220.02256731.839393183.5336305.25980.15980.4392
710.03030.01960.02170.022142921.728386900.8079294.78940.40360.4348
720.03150.04750.02460.0251253613.6486105424.4569324.69130.9810.4955
730.03180.05790.02790.0285382592.819133141.2931364.88531.20490.5664
740.03450.04030.0290.0297153641.3107135004.9311367.43020.76350.5843
750.0328-0.03910.02990.0304139423.631135373.1561367.9309-0.72730.5962

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
64 & 0.0288 & 0.0179 & 0.0179 & 0.0181 & 32629.9344 & 0 & 0 & 0.3519 & 0.3519 \tabularnewline
65 & 0.0316 & -0.0081 & 0.013 & 0.0131 & 5516.8259 & 19073.3802 & 138.1064 & -0.1447 & 0.2483 \tabularnewline
66 & 0.0292 & 0.0265 & 0.0175 & 0.0177 & 76079.3002 & 38075.3535 & 195.1291 & 0.5373 & 0.3446 \tabularnewline
67 & 0.0309 & -0.0055 & 0.0145 & 0.0146 & 2833.0982 & 29264.7897 & 171.0695 & -0.1037 & 0.2844 \tabularnewline
68 & 0.0313 & 0.0666 & 0.0249 & 0.0255 & 480450.952 & 119502.0222 & 345.6906 & 1.3502 & 0.4975 \tabularnewline
69 & 0.031 & 0.0216 & 0.0244 & 0.0249 & 48042.7849 & 107592.1493 & 328.0124 & 0.427 & 0.4858 \tabularnewline
70 & 0.0303 & 0.0079 & 0.022 & 0.0225 & 6731.8393 & 93183.5336 & 305.2598 & 0.1598 & 0.4392 \tabularnewline
71 & 0.0303 & 0.0196 & 0.0217 & 0.0221 & 42921.7283 & 86900.8079 & 294.7894 & 0.4036 & 0.4348 \tabularnewline
72 & 0.0315 & 0.0475 & 0.0246 & 0.0251 & 253613.6486 & 105424.4569 & 324.6913 & 0.981 & 0.4955 \tabularnewline
73 & 0.0318 & 0.0579 & 0.0279 & 0.0285 & 382592.819 & 133141.2931 & 364.8853 & 1.2049 & 0.5664 \tabularnewline
74 & 0.0345 & 0.0403 & 0.029 & 0.0297 & 153641.3107 & 135004.9311 & 367.4302 & 0.7635 & 0.5843 \tabularnewline
75 & 0.0328 & -0.0391 & 0.0299 & 0.0304 & 139423.631 & 135373.1561 & 367.9309 & -0.7273 & 0.5962 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230730&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]64[/C][C]0.0288[/C][C]0.0179[/C][C]0.0179[/C][C]0.0181[/C][C]32629.9344[/C][C]0[/C][C]0[/C][C]0.3519[/C][C]0.3519[/C][/ROW]
[ROW][C]65[/C][C]0.0316[/C][C]-0.0081[/C][C]0.013[/C][C]0.0131[/C][C]5516.8259[/C][C]19073.3802[/C][C]138.1064[/C][C]-0.1447[/C][C]0.2483[/C][/ROW]
[ROW][C]66[/C][C]0.0292[/C][C]0.0265[/C][C]0.0175[/C][C]0.0177[/C][C]76079.3002[/C][C]38075.3535[/C][C]195.1291[/C][C]0.5373[/C][C]0.3446[/C][/ROW]
[ROW][C]67[/C][C]0.0309[/C][C]-0.0055[/C][C]0.0145[/C][C]0.0146[/C][C]2833.0982[/C][C]29264.7897[/C][C]171.0695[/C][C]-0.1037[/C][C]0.2844[/C][/ROW]
[ROW][C]68[/C][C]0.0313[/C][C]0.0666[/C][C]0.0249[/C][C]0.0255[/C][C]480450.952[/C][C]119502.0222[/C][C]345.6906[/C][C]1.3502[/C][C]0.4975[/C][/ROW]
[ROW][C]69[/C][C]0.031[/C][C]0.0216[/C][C]0.0244[/C][C]0.0249[/C][C]48042.7849[/C][C]107592.1493[/C][C]328.0124[/C][C]0.427[/C][C]0.4858[/C][/ROW]
[ROW][C]70[/C][C]0.0303[/C][C]0.0079[/C][C]0.022[/C][C]0.0225[/C][C]6731.8393[/C][C]93183.5336[/C][C]305.2598[/C][C]0.1598[/C][C]0.4392[/C][/ROW]
[ROW][C]71[/C][C]0.0303[/C][C]0.0196[/C][C]0.0217[/C][C]0.0221[/C][C]42921.7283[/C][C]86900.8079[/C][C]294.7894[/C][C]0.4036[/C][C]0.4348[/C][/ROW]
[ROW][C]72[/C][C]0.0315[/C][C]0.0475[/C][C]0.0246[/C][C]0.0251[/C][C]253613.6486[/C][C]105424.4569[/C][C]324.6913[/C][C]0.981[/C][C]0.4955[/C][/ROW]
[ROW][C]73[/C][C]0.0318[/C][C]0.0579[/C][C]0.0279[/C][C]0.0285[/C][C]382592.819[/C][C]133141.2931[/C][C]364.8853[/C][C]1.2049[/C][C]0.5664[/C][/ROW]
[ROW][C]74[/C][C]0.0345[/C][C]0.0403[/C][C]0.029[/C][C]0.0297[/C][C]153641.3107[/C][C]135004.9311[/C][C]367.4302[/C][C]0.7635[/C][C]0.5843[/C][/ROW]
[ROW][C]75[/C][C]0.0328[/C][C]-0.0391[/C][C]0.0299[/C][C]0.0304[/C][C]139423.631[/C][C]135373.1561[/C][C]367.9309[/C][C]-0.7273[/C][C]0.5962[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230730&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230730&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
640.02880.01790.01790.018132629.9344000.35190.3519
650.0316-0.00810.0130.01315516.825919073.3802138.1064-0.14470.2483
660.02920.02650.01750.017776079.300238075.3535195.12910.53730.3446
670.0309-0.00550.01450.01462833.098229264.7897171.0695-0.10370.2844
680.03130.06660.02490.0255480450.952119502.0222345.69061.35020.4975
690.0310.02160.02440.024948042.7849107592.1493328.01240.4270.4858
700.03030.00790.0220.02256731.839393183.5336305.25980.15980.4392
710.03030.01960.02170.022142921.728386900.8079294.78940.40360.4348
720.03150.04750.02460.0251253613.6486105424.4569324.69130.9810.4955
730.03180.05790.02790.0285382592.819133141.2931364.88531.20490.5664
740.03450.04030.0290.0297153641.3107135004.9311367.43020.76350.5843
750.0328-0.03910.02990.0304139423.631135373.1561367.9309-0.72730.5962



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,par1))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- array(0,dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+i] + forecast$pred[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape[1] = abs(perf.pe[1])
perf.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[1]
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[i] / i
}
perf.rmse = sqrt(perf.mse1)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:par1] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',10,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'sMAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape1[i],4))
a<-table.element(a,round(perf.smape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')