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 computationFri, 03 Dec 2010 14:57:24 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/03/t12913881304uynx9ln6ddz5o9.htm/, Retrieved Tue, 07 May 2024 22:54:12 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=104848, Retrieved Tue, 07 May 2024 22:54:12 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact142
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [Univariate Data Series] [Identifying Integ...] [2009-11-22 12:08:06] [b98453cac15ba1066b407e146608df68]
- RMP         [Standard Deviation-Mean Plot] [Births] [2010-11-29 10:52:49] [b98453cac15ba1066b407e146608df68]
- RMP           [ARIMA Forecasting] [Births] [2010-11-29 20:53:49] [b98453cac15ba1066b407e146608df68]
-   PD              [ARIMA Forecasting] [workshop 9 - tuto...] [2010-12-03 14:57:24] [42b216fecf560ef45cc692f6de9f34dc] [Current]
Feedback Forum

Post a new message
Dataseries X:
9769
9321
9939
9336
10195
9464
10010
10213
9563
9890
9305
9391
9928
8686
9843
9627
10074
9503
10119
10000
9313
9866
9172
9241
9659
8904
9755
9080
9435
8971
10063
9793
9454
9759
8820
9403
9676
8642
9402
9610
9294
9448
10319
9548
9801
9596
8923
9746
9829
9125
9782
9441
9162
9915
10444
10209
9985
9842
9429
10132
9849
9172
10313
9819
9955
10048
10082
10541
10208
10233
9439
9963
10158
9225
10474
9757
10490
10281
10444
10640
10695
10786
9832
9747
10411
9511
10402
9701
10540
10112
10915
11183
10384
10834
9886
10216




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 3 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=104848&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=104848&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=104848&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 time3 seconds
R Server'George Udny Yule' @ 72.249.76.132







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[84])
729963-------
7310158-------
749225-------
7510474-------
769757-------
7710490-------
7810281-------
7910444-------
8010640-------
8110695-------
8210786-------
839832-------
849747-------
851041110347.42979790.027710964.680.420.97170.72620.9717
8695119428.07658949.41759954.87530.37881e-040.7750.1177
871040210554.46449964.01911211.01990.32450.99910.59490.992
8897019946.47879408.946110541.93240.20950.06690.73360.7443
891054010500.23559902.954211165.64390.45340.99070.5120.9867
901011210279.70719698.783810926.41060.30560.21510.49840.9468
911091510663.003610037.781311361.99560.23990.93880.73040.9949
921118310732.549910094.627511446.89520.10820.30830.60020.9966
931038410579.36459952.179611281.46760.29270.0460.37340.9899
941083410711.313710065.236311436.07510.370.8120.420.9954
9598869834.56529274.320610458.81790.43599e-040.50320.6083
96102169974.21129395.74510620.10040.23160.60550.75470.7547

\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[84]) \tabularnewline
72 & 9963 & - & - & - & - & - & - & - \tabularnewline
73 & 10158 & - & - & - & - & - & - & - \tabularnewline
74 & 9225 & - & - & - & - & - & - & - \tabularnewline
75 & 10474 & - & - & - & - & - & - & - \tabularnewline
76 & 9757 & - & - & - & - & - & - & - \tabularnewline
77 & 10490 & - & - & - & - & - & - & - \tabularnewline
78 & 10281 & - & - & - & - & - & - & - \tabularnewline
79 & 10444 & - & - & - & - & - & - & - \tabularnewline
80 & 10640 & - & - & - & - & - & - & - \tabularnewline
81 & 10695 & - & - & - & - & - & - & - \tabularnewline
82 & 10786 & - & - & - & - & - & - & - \tabularnewline
83 & 9832 & - & - & - & - & - & - & - \tabularnewline
84 & 9747 & - & - & - & - & - & - & - \tabularnewline
85 & 10411 & 10347.4297 & 9790.0277 & 10964.68 & 0.42 & 0.9717 & 0.7262 & 0.9717 \tabularnewline
86 & 9511 & 9428.0765 & 8949.4175 & 9954.8753 & 0.3788 & 1e-04 & 0.775 & 0.1177 \tabularnewline
87 & 10402 & 10554.4644 & 9964.019 & 11211.0199 & 0.3245 & 0.9991 & 0.5949 & 0.992 \tabularnewline
88 & 9701 & 9946.4787 & 9408.9461 & 10541.9324 & 0.2095 & 0.0669 & 0.7336 & 0.7443 \tabularnewline
89 & 10540 & 10500.2355 & 9902.9542 & 11165.6439 & 0.4534 & 0.9907 & 0.512 & 0.9867 \tabularnewline
90 & 10112 & 10279.7071 & 9698.7838 & 10926.4106 & 0.3056 & 0.2151 & 0.4984 & 0.9468 \tabularnewline
91 & 10915 & 10663.0036 & 10037.7813 & 11361.9956 & 0.2399 & 0.9388 & 0.7304 & 0.9949 \tabularnewline
92 & 11183 & 10732.5499 & 10094.6275 & 11446.8952 & 0.1082 & 0.3083 & 0.6002 & 0.9966 \tabularnewline
93 & 10384 & 10579.3645 & 9952.1796 & 11281.4676 & 0.2927 & 0.046 & 0.3734 & 0.9899 \tabularnewline
94 & 10834 & 10711.3137 & 10065.2363 & 11436.0751 & 0.37 & 0.812 & 0.42 & 0.9954 \tabularnewline
95 & 9886 & 9834.5652 & 9274.3206 & 10458.8179 & 0.4359 & 9e-04 & 0.5032 & 0.6083 \tabularnewline
96 & 10216 & 9974.2112 & 9395.745 & 10620.1004 & 0.2316 & 0.6055 & 0.7547 & 0.7547 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=104848&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[84])[/C][/ROW]
[ROW][C]72[/C][C]9963[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]10158[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]9225[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]10474[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]9757[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]10490[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]10281[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]10444[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]10640[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]10695[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]10786[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]9832[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]9747[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]10411[/C][C]10347.4297[/C][C]9790.0277[/C][C]10964.68[/C][C]0.42[/C][C]0.9717[/C][C]0.7262[/C][C]0.9717[/C][/ROW]
[ROW][C]86[/C][C]9511[/C][C]9428.0765[/C][C]8949.4175[/C][C]9954.8753[/C][C]0.3788[/C][C]1e-04[/C][C]0.775[/C][C]0.1177[/C][/ROW]
[ROW][C]87[/C][C]10402[/C][C]10554.4644[/C][C]9964.019[/C][C]11211.0199[/C][C]0.3245[/C][C]0.9991[/C][C]0.5949[/C][C]0.992[/C][/ROW]
[ROW][C]88[/C][C]9701[/C][C]9946.4787[/C][C]9408.9461[/C][C]10541.9324[/C][C]0.2095[/C][C]0.0669[/C][C]0.7336[/C][C]0.7443[/C][/ROW]
[ROW][C]89[/C][C]10540[/C][C]10500.2355[/C][C]9902.9542[/C][C]11165.6439[/C][C]0.4534[/C][C]0.9907[/C][C]0.512[/C][C]0.9867[/C][/ROW]
[ROW][C]90[/C][C]10112[/C][C]10279.7071[/C][C]9698.7838[/C][C]10926.4106[/C][C]0.3056[/C][C]0.2151[/C][C]0.4984[/C][C]0.9468[/C][/ROW]
[ROW][C]91[/C][C]10915[/C][C]10663.0036[/C][C]10037.7813[/C][C]11361.9956[/C][C]0.2399[/C][C]0.9388[/C][C]0.7304[/C][C]0.9949[/C][/ROW]
[ROW][C]92[/C][C]11183[/C][C]10732.5499[/C][C]10094.6275[/C][C]11446.8952[/C][C]0.1082[/C][C]0.3083[/C][C]0.6002[/C][C]0.9966[/C][/ROW]
[ROW][C]93[/C][C]10384[/C][C]10579.3645[/C][C]9952.1796[/C][C]11281.4676[/C][C]0.2927[/C][C]0.046[/C][C]0.3734[/C][C]0.9899[/C][/ROW]
[ROW][C]94[/C][C]10834[/C][C]10711.3137[/C][C]10065.2363[/C][C]11436.0751[/C][C]0.37[/C][C]0.812[/C][C]0.42[/C][C]0.9954[/C][/ROW]
[ROW][C]95[/C][C]9886[/C][C]9834.5652[/C][C]9274.3206[/C][C]10458.8179[/C][C]0.4359[/C][C]9e-04[/C][C]0.5032[/C][C]0.6083[/C][/ROW]
[ROW][C]96[/C][C]10216[/C][C]9974.2112[/C][C]9395.745[/C][C]10620.1004[/C][C]0.2316[/C][C]0.6055[/C][C]0.7547[/C][C]0.7547[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=104848&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=104848&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[84])
729963-------
7310158-------
749225-------
7510474-------
769757-------
7710490-------
7810281-------
7910444-------
8010640-------
8110695-------
8210786-------
839832-------
849747-------
851041110347.42979790.027710964.680.420.97170.72620.9717
8695119428.07658949.41759954.87530.37881e-040.7750.1177
871040210554.46449964.01911211.01990.32450.99910.59490.992
8897019946.47879408.946110541.93240.20950.06690.73360.7443
891054010500.23559902.954211165.64390.45340.99070.5120.9867
901011210279.70719698.783810926.41060.30560.21510.49840.9468
911091510663.003610037.781311361.99560.23990.93880.73040.9949
921118310732.549910094.627511446.89520.10820.30830.60020.9966
931038410579.36459952.179611281.46760.29270.0460.37340.9899
941083410711.313710065.236311436.07510.370.8120.420.9954
9598869834.56529274.320610458.81790.43599e-040.50320.6083
96102169974.21129395.74510620.10040.23160.60550.75470.7547







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
850.03040.006104041.179500
860.02850.00880.00756876.30825458.743973.8833
870.0317-0.01440.009823245.407311387.6317106.7128
880.0305-0.02470.013560259.783923605.6697153.6414
890.03230.00380.01161581.216919200.7792138.5669
900.0321-0.01630.012428125.669920688.261143.8341
910.03340.02360.01463502.1726804.5337163.7209
920.0340.0420.0175202905.247848817.1229220.946
930.0339-0.01850.017638167.304247633.8097218.2517
940.03450.01150.01715051.921944375.621210.6552
950.03240.00520.01592645.535140581.9768201.4497
960.0330.02420.016658461.835142071.965205.1145

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
85 & 0.0304 & 0.0061 & 0 & 4041.1795 & 0 & 0 \tabularnewline
86 & 0.0285 & 0.0088 & 0.0075 & 6876.3082 & 5458.7439 & 73.8833 \tabularnewline
87 & 0.0317 & -0.0144 & 0.0098 & 23245.4073 & 11387.6317 & 106.7128 \tabularnewline
88 & 0.0305 & -0.0247 & 0.0135 & 60259.7839 & 23605.6697 & 153.6414 \tabularnewline
89 & 0.0323 & 0.0038 & 0.0116 & 1581.2169 & 19200.7792 & 138.5669 \tabularnewline
90 & 0.0321 & -0.0163 & 0.0124 & 28125.6699 & 20688.261 & 143.8341 \tabularnewline
91 & 0.0334 & 0.0236 & 0.014 & 63502.17 & 26804.5337 & 163.7209 \tabularnewline
92 & 0.034 & 0.042 & 0.0175 & 202905.2478 & 48817.1229 & 220.946 \tabularnewline
93 & 0.0339 & -0.0185 & 0.0176 & 38167.3042 & 47633.8097 & 218.2517 \tabularnewline
94 & 0.0345 & 0.0115 & 0.017 & 15051.9219 & 44375.621 & 210.6552 \tabularnewline
95 & 0.0324 & 0.0052 & 0.0159 & 2645.5351 & 40581.9768 & 201.4497 \tabularnewline
96 & 0.033 & 0.0242 & 0.0166 & 58461.8351 & 42071.965 & 205.1145 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=104848&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]85[/C][C]0.0304[/C][C]0.0061[/C][C]0[/C][C]4041.1795[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]86[/C][C]0.0285[/C][C]0.0088[/C][C]0.0075[/C][C]6876.3082[/C][C]5458.7439[/C][C]73.8833[/C][/ROW]
[ROW][C]87[/C][C]0.0317[/C][C]-0.0144[/C][C]0.0098[/C][C]23245.4073[/C][C]11387.6317[/C][C]106.7128[/C][/ROW]
[ROW][C]88[/C][C]0.0305[/C][C]-0.0247[/C][C]0.0135[/C][C]60259.7839[/C][C]23605.6697[/C][C]153.6414[/C][/ROW]
[ROW][C]89[/C][C]0.0323[/C][C]0.0038[/C][C]0.0116[/C][C]1581.2169[/C][C]19200.7792[/C][C]138.5669[/C][/ROW]
[ROW][C]90[/C][C]0.0321[/C][C]-0.0163[/C][C]0.0124[/C][C]28125.6699[/C][C]20688.261[/C][C]143.8341[/C][/ROW]
[ROW][C]91[/C][C]0.0334[/C][C]0.0236[/C][C]0.014[/C][C]63502.17[/C][C]26804.5337[/C][C]163.7209[/C][/ROW]
[ROW][C]92[/C][C]0.034[/C][C]0.042[/C][C]0.0175[/C][C]202905.2478[/C][C]48817.1229[/C][C]220.946[/C][/ROW]
[ROW][C]93[/C][C]0.0339[/C][C]-0.0185[/C][C]0.0176[/C][C]38167.3042[/C][C]47633.8097[/C][C]218.2517[/C][/ROW]
[ROW][C]94[/C][C]0.0345[/C][C]0.0115[/C][C]0.017[/C][C]15051.9219[/C][C]44375.621[/C][C]210.6552[/C][/ROW]
[ROW][C]95[/C][C]0.0324[/C][C]0.0052[/C][C]0.0159[/C][C]2645.5351[/C][C]40581.9768[/C][C]201.4497[/C][/ROW]
[ROW][C]96[/C][C]0.033[/C][C]0.0242[/C][C]0.0166[/C][C]58461.8351[/C][C]42071.965[/C][C]205.1145[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=104848&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=104848&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
850.03040.006104041.179500
860.02850.00880.00756876.30825458.743973.8833
870.0317-0.01440.009823245.407311387.6317106.7128
880.0305-0.02470.013560259.783923605.6697153.6414
890.03230.00380.01161581.216919200.7792138.5669
900.0321-0.01630.012428125.669920688.261143.8341
910.03340.02360.01463502.1726804.5337163.7209
920.0340.0420.0175202905.247848817.1229220.946
930.0339-0.01850.017638167.304247633.8097218.2517
940.03450.01150.01715051.921944375.621210.6552
950.03240.00520.01592645.535140581.9768201.4497
960.0330.02420.016658461.835142071.965205.1145



Parameters (Session):
par1 = 48 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = White Noise ; par7 = 0.95 ;
Parameters (R input):
par1 = 12 ; par2 = -0.8 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; 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')