Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 20 Dec 2011 14:06:42 -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/2011/Dec/20/t1324408097qwzo8rtgdenhjwo.htm/, Retrieved Mon, 06 May 2024 05:43:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=158165, Retrieved Mon, 06 May 2024 05:43:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact100
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecasting with ...] [2011-12-20 19:06:42] [2fa2d22b72a9c62ab85a23406d5dc0a0] [Current]
Feedback Forum

Post a new message
Dataseries X:
9911
8915
9452
9112
8472
8230
8384
8625
8221
8649
8625
10443
10357
8586
8892
8329
8101
7922
8120
7838
7735
8406
8209
9451
10041
9411
10405
8467
8464
8102
7627
7513
7510
8291
8064
9383
9706
8579
9474
8318
8213
8059
9111
7708
7680
8014
8007
8718
9486
9113
9025
8476
7952
7759
7835
7600
7651
8319
8812
8630





Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.

\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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
R Framework error message & 
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=158165&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[ROW][C]R Framework error message[/C][C]
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=158165&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158165&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 time1 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.







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[48])
369383-------
379706-------
388579-------
399474-------
408318-------
418213-------
428059-------
439111-------
447708-------
457680-------
468014-------
478007-------
488718-------
4994869552.73798642.143310463.33260.44290.96380.37070.9638
5091138808.72117831.38819786.05420.27090.08720.67750.5722
5190259638.10078660.767610615.43370.10940.85380.6290.9675
5284768407.82317430.499385.15620.44560.10790.57150.267
5379528279.53017302.1979256.86310.25560.34680.55310.1896
5477598065.19337087.86029042.52630.26960.58980.5050.0952
5578358581.57097604.23789558.90390.06720.95050.14420.3922
5676007733.70056756.36748711.03360.39430.41950.52060.0242
5776517679.00986701.67678656.34280.47760.56290.49920.0186
5883198168.76117191.4289146.09410.38160.85040.62190.1353
5988128084.25387106.92089061.58690.07220.31890.56160.1019
6086309075.43158098.148410052.71460.18580.70140.76330.7633

\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[48]) \tabularnewline
36 & 9383 & - & - & - & - & - & - & - \tabularnewline
37 & 9706 & - & - & - & - & - & - & - \tabularnewline
38 & 8579 & - & - & - & - & - & - & - \tabularnewline
39 & 9474 & - & - & - & - & - & - & - \tabularnewline
40 & 8318 & - & - & - & - & - & - & - \tabularnewline
41 & 8213 & - & - & - & - & - & - & - \tabularnewline
42 & 8059 & - & - & - & - & - & - & - \tabularnewline
43 & 9111 & - & - & - & - & - & - & - \tabularnewline
44 & 7708 & - & - & - & - & - & - & - \tabularnewline
45 & 7680 & - & - & - & - & - & - & - \tabularnewline
46 & 8014 & - & - & - & - & - & - & - \tabularnewline
47 & 8007 & - & - & - & - & - & - & - \tabularnewline
48 & 8718 & - & - & - & - & - & - & - \tabularnewline
49 & 9486 & 9552.7379 & 8642.1433 & 10463.3326 & 0.4429 & 0.9638 & 0.3707 & 0.9638 \tabularnewline
50 & 9113 & 8808.7211 & 7831.3881 & 9786.0542 & 0.2709 & 0.0872 & 0.6775 & 0.5722 \tabularnewline
51 & 9025 & 9638.1007 & 8660.7676 & 10615.4337 & 0.1094 & 0.8538 & 0.629 & 0.9675 \tabularnewline
52 & 8476 & 8407.8231 & 7430.49 & 9385.1562 & 0.4456 & 0.1079 & 0.5715 & 0.267 \tabularnewline
53 & 7952 & 8279.5301 & 7302.197 & 9256.8631 & 0.2556 & 0.3468 & 0.5531 & 0.1896 \tabularnewline
54 & 7759 & 8065.1933 & 7087.8602 & 9042.5263 & 0.2696 & 0.5898 & 0.505 & 0.0952 \tabularnewline
55 & 7835 & 8581.5709 & 7604.2378 & 9558.9039 & 0.0672 & 0.9505 & 0.1442 & 0.3922 \tabularnewline
56 & 7600 & 7733.7005 & 6756.3674 & 8711.0336 & 0.3943 & 0.4195 & 0.5206 & 0.0242 \tabularnewline
57 & 7651 & 7679.0098 & 6701.6767 & 8656.3428 & 0.4776 & 0.5629 & 0.4992 & 0.0186 \tabularnewline
58 & 8319 & 8168.7611 & 7191.428 & 9146.0941 & 0.3816 & 0.8504 & 0.6219 & 0.1353 \tabularnewline
59 & 8812 & 8084.2538 & 7106.9208 & 9061.5869 & 0.0722 & 0.3189 & 0.5616 & 0.1019 \tabularnewline
60 & 8630 & 9075.4315 & 8098.1484 & 10052.7146 & 0.1858 & 0.7014 & 0.7633 & 0.7633 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158165&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[48])[/C][/ROW]
[ROW][C]36[/C][C]9383[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]9706[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]8579[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]9474[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]8318[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]8213[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]8059[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]9111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]7708[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]7680[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]8014[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]8007[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]8718[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]9486[/C][C]9552.7379[/C][C]8642.1433[/C][C]10463.3326[/C][C]0.4429[/C][C]0.9638[/C][C]0.3707[/C][C]0.9638[/C][/ROW]
[ROW][C]50[/C][C]9113[/C][C]8808.7211[/C][C]7831.3881[/C][C]9786.0542[/C][C]0.2709[/C][C]0.0872[/C][C]0.6775[/C][C]0.5722[/C][/ROW]
[ROW][C]51[/C][C]9025[/C][C]9638.1007[/C][C]8660.7676[/C][C]10615.4337[/C][C]0.1094[/C][C]0.8538[/C][C]0.629[/C][C]0.9675[/C][/ROW]
[ROW][C]52[/C][C]8476[/C][C]8407.8231[/C][C]7430.49[/C][C]9385.1562[/C][C]0.4456[/C][C]0.1079[/C][C]0.5715[/C][C]0.267[/C][/ROW]
[ROW][C]53[/C][C]7952[/C][C]8279.5301[/C][C]7302.197[/C][C]9256.8631[/C][C]0.2556[/C][C]0.3468[/C][C]0.5531[/C][C]0.1896[/C][/ROW]
[ROW][C]54[/C][C]7759[/C][C]8065.1933[/C][C]7087.8602[/C][C]9042.5263[/C][C]0.2696[/C][C]0.5898[/C][C]0.505[/C][C]0.0952[/C][/ROW]
[ROW][C]55[/C][C]7835[/C][C]8581.5709[/C][C]7604.2378[/C][C]9558.9039[/C][C]0.0672[/C][C]0.9505[/C][C]0.1442[/C][C]0.3922[/C][/ROW]
[ROW][C]56[/C][C]7600[/C][C]7733.7005[/C][C]6756.3674[/C][C]8711.0336[/C][C]0.3943[/C][C]0.4195[/C][C]0.5206[/C][C]0.0242[/C][/ROW]
[ROW][C]57[/C][C]7651[/C][C]7679.0098[/C][C]6701.6767[/C][C]8656.3428[/C][C]0.4776[/C][C]0.5629[/C][C]0.4992[/C][C]0.0186[/C][/ROW]
[ROW][C]58[/C][C]8319[/C][C]8168.7611[/C][C]7191.428[/C][C]9146.0941[/C][C]0.3816[/C][C]0.8504[/C][C]0.6219[/C][C]0.1353[/C][/ROW]
[ROW][C]59[/C][C]8812[/C][C]8084.2538[/C][C]7106.9208[/C][C]9061.5869[/C][C]0.0722[/C][C]0.3189[/C][C]0.5616[/C][C]0.1019[/C][/ROW]
[ROW][C]60[/C][C]8630[/C][C]9075.4315[/C][C]8098.1484[/C][C]10052.7146[/C][C]0.1858[/C][C]0.7014[/C][C]0.7633[/C][C]0.7633[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158165&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158165&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[48])
369383-------
379706-------
388579-------
399474-------
408318-------
418213-------
428059-------
439111-------
447708-------
457680-------
468014-------
478007-------
488718-------
4994869552.73798642.143310463.33260.44290.96380.37070.9638
5091138808.72117831.38819786.05420.27090.08720.67750.5722
5190259638.10078660.767610615.43370.10940.85380.6290.9675
5284768407.82317430.499385.15620.44560.10790.57150.267
5379528279.53017302.1979256.86310.25560.34680.55310.1896
5477598065.19337087.86029042.52630.26960.58980.5050.0952
5578358581.57097604.23789558.90390.06720.95050.14420.3922
5676007733.70056756.36748711.03360.39430.41950.52060.0242
5776517679.00986701.67678656.34280.47760.56290.49920.0186
5883198168.76117191.4289146.09410.38160.85040.62190.1353
5988128084.25387106.92089061.58690.07220.31890.56160.1019
6086309075.43158098.148410052.71460.18580.70140.76330.7633







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0486-0.00704453.95200
500.05660.03450.020892585.630248519.7911220.2721
510.0517-0.06360.035375892.4389157644.007397.0441
520.05930.00810.02834648.0882119395.0273345.5359
530.0602-0.03960.0306107275.9502116971.2119342.0105
540.0618-0.0380.031893754.3269113101.7311336.306
550.0581-0.0870.0397557368.0763176568.3518420.2004
560.0645-0.01730.036917875.8264156731.7861395.8937
570.0649-0.00360.0332784.5462139404.315373.3689
580.0610.01840.031722571.7403127721.0576357.3808
590.06170.090.037529614.4872164256.8239405.2861
600.0549-0.04910.038198409.2562167102.8599408.7822

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0486 & -0.007 & 0 & 4453.952 & 0 & 0 \tabularnewline
50 & 0.0566 & 0.0345 & 0.0208 & 92585.6302 & 48519.7911 & 220.2721 \tabularnewline
51 & 0.0517 & -0.0636 & 0.035 & 375892.4389 & 157644.007 & 397.0441 \tabularnewline
52 & 0.0593 & 0.0081 & 0.0283 & 4648.0882 & 119395.0273 & 345.5359 \tabularnewline
53 & 0.0602 & -0.0396 & 0.0306 & 107275.9502 & 116971.2119 & 342.0105 \tabularnewline
54 & 0.0618 & -0.038 & 0.0318 & 93754.3269 & 113101.7311 & 336.306 \tabularnewline
55 & 0.0581 & -0.087 & 0.0397 & 557368.0763 & 176568.3518 & 420.2004 \tabularnewline
56 & 0.0645 & -0.0173 & 0.0369 & 17875.8264 & 156731.7861 & 395.8937 \tabularnewline
57 & 0.0649 & -0.0036 & 0.0332 & 784.5462 & 139404.315 & 373.3689 \tabularnewline
58 & 0.061 & 0.0184 & 0.0317 & 22571.7403 & 127721.0576 & 357.3808 \tabularnewline
59 & 0.0617 & 0.09 & 0.037 & 529614.4872 & 164256.8239 & 405.2861 \tabularnewline
60 & 0.0549 & -0.0491 & 0.038 & 198409.2562 & 167102.8599 & 408.7822 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158165&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]49[/C][C]0.0486[/C][C]-0.007[/C][C]0[/C][C]4453.952[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0566[/C][C]0.0345[/C][C]0.0208[/C][C]92585.6302[/C][C]48519.7911[/C][C]220.2721[/C][/ROW]
[ROW][C]51[/C][C]0.0517[/C][C]-0.0636[/C][C]0.035[/C][C]375892.4389[/C][C]157644.007[/C][C]397.0441[/C][/ROW]
[ROW][C]52[/C][C]0.0593[/C][C]0.0081[/C][C]0.0283[/C][C]4648.0882[/C][C]119395.0273[/C][C]345.5359[/C][/ROW]
[ROW][C]53[/C][C]0.0602[/C][C]-0.0396[/C][C]0.0306[/C][C]107275.9502[/C][C]116971.2119[/C][C]342.0105[/C][/ROW]
[ROW][C]54[/C][C]0.0618[/C][C]-0.038[/C][C]0.0318[/C][C]93754.3269[/C][C]113101.7311[/C][C]336.306[/C][/ROW]
[ROW][C]55[/C][C]0.0581[/C][C]-0.087[/C][C]0.0397[/C][C]557368.0763[/C][C]176568.3518[/C][C]420.2004[/C][/ROW]
[ROW][C]56[/C][C]0.0645[/C][C]-0.0173[/C][C]0.0369[/C][C]17875.8264[/C][C]156731.7861[/C][C]395.8937[/C][/ROW]
[ROW][C]57[/C][C]0.0649[/C][C]-0.0036[/C][C]0.0332[/C][C]784.5462[/C][C]139404.315[/C][C]373.3689[/C][/ROW]
[ROW][C]58[/C][C]0.061[/C][C]0.0184[/C][C]0.0317[/C][C]22571.7403[/C][C]127721.0576[/C][C]357.3808[/C][/ROW]
[ROW][C]59[/C][C]0.0617[/C][C]0.09[/C][C]0.037[/C][C]529614.4872[/C][C]164256.8239[/C][C]405.2861[/C][/ROW]
[ROW][C]60[/C][C]0.0549[/C][C]-0.0491[/C][C]0.038[/C][C]198409.2562[/C][C]167102.8599[/C][C]408.7822[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158165&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158165&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.PEMAPESq.EMSERMSE
490.0486-0.00704453.95200
500.05660.03450.020892585.630248519.7911220.2721
510.0517-0.06360.035375892.4389157644.007397.0441
520.05930.00810.02834648.0882119395.0273345.5359
530.0602-0.03960.0306107275.9502116971.2119342.0105
540.0618-0.0380.031893754.3269113101.7311336.306
550.0581-0.0870.0397557368.0763176568.3518420.2004
560.0645-0.01730.036917875.8264156731.7861395.8937
570.0649-0.00360.0332784.5462139404.315373.3689
580.0610.01840.031722571.7403127721.0576357.3808
590.06170.090.037529614.4872164256.8239405.2861
600.0549-0.04910.038198409.2562167102.8599408.7822



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
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.mape <- array(0, dim=fx)
perf.mape1 <- 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)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')