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, 16 Dec 2011 07:54:24 -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/16/t1324040120md17wxebti6lvy7.htm/, Retrieved Sun, 05 May 2024 15:33:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=155879, Retrieved Sun, 05 May 2024 15:33:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact120
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Kendall tau Correlation Matrix] [] [2010-12-05 17:44:33] [b98453cac15ba1066b407e146608df68]
- RMPD  [Kendall tau Correlation Matrix] [WS 10 - Pearson c...] [2010-12-10 16:13:49] [033eb2749a430605d9b2be7c4aac4a0c]
-         [Kendall tau Correlation Matrix] [] [2010-12-13 18:15:16] [d7b28a0391ab3b2ddc9f9fba95a43f33]
- RMPD      [ARIMA Forecasting] [] [2010-12-24 12:12:29] [b07cd1964830aab808142229b1166ece]
-    D          [ARIMA Forecasting] [ARIMA forecast] [2011-12-16 12:54:24] [0e2c18186cab982e7ba7b89fbe242e59] [Current]
Feedback Forum

Post a new message
Dataseries X:
1770
2203
2836
1976
2150
2180
2631
1781
2327
2260
2051
2250
2102
2957
2485
2871
2447
2570
2622
1840
2682
2369
2119
2531
2214
3206
2709
2734
2348
2702
2642
2064
2647
2534
2297
2718
2321
3112
2664
2808
2668
2934
2616
2228
2463
2416
2407
2582
2101
3305
2818
2401
3019
2507
2948
2210
2467
2596
2451
2233
2393
3122
2801
2656
2782
2604
2803
2178
2324
2536
2408
2261
2166
3243
2296
2719
2734
2297
2732
1904
2397
2473
1967
2471
2203
3053
2350
2807
2639
2646
2577
1860
2624
2590
2261
3342
2840
3328
3245
3025
2915
3579
2787
2397
3065
2154
2689
3187
2540
3469
3005
2573
2998
2768
2556
2414
2467
2136
2493
2735
2316
3042
2364
2248
2714
2583
2631
1965
2209
1964
2132




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'AstonUniversity' @ aston.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 & 2 seconds \tabularnewline
R Server & 'AstonUniversity' @ aston.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=155879&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'AstonUniversity' @ aston.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=155879&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=155879&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 time2 seconds
R Server'AstonUniversity' @ aston.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[119])
1072689-------
1083187-------
1092540-------
1103469-------
1113005-------
1122573-------
1132998-------
1142768-------
1152556-------
1162414-------
1172467-------
1182136-------
1192493-------
12027353037.31732464.99833609.63640.15030.96880.30410.9688
12123162534.61541954.16273115.06810.23020.24930.49270.5559
12230423348.19762767.51383928.88150.15070.99980.34170.9981
12323642925.18152344.4913505.8720.02910.34670.39380.9277
12422482726.34372145.6533307.03440.05320.88930.69760.7845
12527142902.35142321.66073483.04210.26250.98640.37340.9165
12625832917.02772336.3373497.71840.12980.75340.69250.9238
12726312641.9982061.30733222.68870.48520.57890.61420.6925
12819652293.77761713.08692874.46830.13360.12750.34250.2507
12922092628.22472047.5343208.91540.07850.98740.70680.676
13019642241.76811661.07742822.45880.17420.5440.63950.1982
13121322474.35451893.66383055.04520.12390.95750.47490.4749

\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[119]) \tabularnewline
107 & 2689 & - & - & - & - & - & - & - \tabularnewline
108 & 3187 & - & - & - & - & - & - & - \tabularnewline
109 & 2540 & - & - & - & - & - & - & - \tabularnewline
110 & 3469 & - & - & - & - & - & - & - \tabularnewline
111 & 3005 & - & - & - & - & - & - & - \tabularnewline
112 & 2573 & - & - & - & - & - & - & - \tabularnewline
113 & 2998 & - & - & - & - & - & - & - \tabularnewline
114 & 2768 & - & - & - & - & - & - & - \tabularnewline
115 & 2556 & - & - & - & - & - & - & - \tabularnewline
116 & 2414 & - & - & - & - & - & - & - \tabularnewline
117 & 2467 & - & - & - & - & - & - & - \tabularnewline
118 & 2136 & - & - & - & - & - & - & - \tabularnewline
119 & 2493 & - & - & - & - & - & - & - \tabularnewline
120 & 2735 & 3037.3173 & 2464.9983 & 3609.6364 & 0.1503 & 0.9688 & 0.3041 & 0.9688 \tabularnewline
121 & 2316 & 2534.6154 & 1954.1627 & 3115.0681 & 0.2302 & 0.2493 & 0.4927 & 0.5559 \tabularnewline
122 & 3042 & 3348.1976 & 2767.5138 & 3928.8815 & 0.1507 & 0.9998 & 0.3417 & 0.9981 \tabularnewline
123 & 2364 & 2925.1815 & 2344.491 & 3505.872 & 0.0291 & 0.3467 & 0.3938 & 0.9277 \tabularnewline
124 & 2248 & 2726.3437 & 2145.653 & 3307.0344 & 0.0532 & 0.8893 & 0.6976 & 0.7845 \tabularnewline
125 & 2714 & 2902.3514 & 2321.6607 & 3483.0421 & 0.2625 & 0.9864 & 0.3734 & 0.9165 \tabularnewline
126 & 2583 & 2917.0277 & 2336.337 & 3497.7184 & 0.1298 & 0.7534 & 0.6925 & 0.9238 \tabularnewline
127 & 2631 & 2641.998 & 2061.3073 & 3222.6887 & 0.4852 & 0.5789 & 0.6142 & 0.6925 \tabularnewline
128 & 1965 & 2293.7776 & 1713.0869 & 2874.4683 & 0.1336 & 0.1275 & 0.3425 & 0.2507 \tabularnewline
129 & 2209 & 2628.2247 & 2047.534 & 3208.9154 & 0.0785 & 0.9874 & 0.7068 & 0.676 \tabularnewline
130 & 1964 & 2241.7681 & 1661.0774 & 2822.4588 & 0.1742 & 0.544 & 0.6395 & 0.1982 \tabularnewline
131 & 2132 & 2474.3545 & 1893.6638 & 3055.0452 & 0.1239 & 0.9575 & 0.4749 & 0.4749 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=155879&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[119])[/C][/ROW]
[ROW][C]107[/C][C]2689[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]3187[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]2540[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]3469[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]3005[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]2573[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]2998[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]2768[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]2556[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]2414[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]2467[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]2136[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]2493[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]2735[/C][C]3037.3173[/C][C]2464.9983[/C][C]3609.6364[/C][C]0.1503[/C][C]0.9688[/C][C]0.3041[/C][C]0.9688[/C][/ROW]
[ROW][C]121[/C][C]2316[/C][C]2534.6154[/C][C]1954.1627[/C][C]3115.0681[/C][C]0.2302[/C][C]0.2493[/C][C]0.4927[/C][C]0.5559[/C][/ROW]
[ROW][C]122[/C][C]3042[/C][C]3348.1976[/C][C]2767.5138[/C][C]3928.8815[/C][C]0.1507[/C][C]0.9998[/C][C]0.3417[/C][C]0.9981[/C][/ROW]
[ROW][C]123[/C][C]2364[/C][C]2925.1815[/C][C]2344.491[/C][C]3505.872[/C][C]0.0291[/C][C]0.3467[/C][C]0.3938[/C][C]0.9277[/C][/ROW]
[ROW][C]124[/C][C]2248[/C][C]2726.3437[/C][C]2145.653[/C][C]3307.0344[/C][C]0.0532[/C][C]0.8893[/C][C]0.6976[/C][C]0.7845[/C][/ROW]
[ROW][C]125[/C][C]2714[/C][C]2902.3514[/C][C]2321.6607[/C][C]3483.0421[/C][C]0.2625[/C][C]0.9864[/C][C]0.3734[/C][C]0.9165[/C][/ROW]
[ROW][C]126[/C][C]2583[/C][C]2917.0277[/C][C]2336.337[/C][C]3497.7184[/C][C]0.1298[/C][C]0.7534[/C][C]0.6925[/C][C]0.9238[/C][/ROW]
[ROW][C]127[/C][C]2631[/C][C]2641.998[/C][C]2061.3073[/C][C]3222.6887[/C][C]0.4852[/C][C]0.5789[/C][C]0.6142[/C][C]0.6925[/C][/ROW]
[ROW][C]128[/C][C]1965[/C][C]2293.7776[/C][C]1713.0869[/C][C]2874.4683[/C][C]0.1336[/C][C]0.1275[/C][C]0.3425[/C][C]0.2507[/C][/ROW]
[ROW][C]129[/C][C]2209[/C][C]2628.2247[/C][C]2047.534[/C][C]3208.9154[/C][C]0.0785[/C][C]0.9874[/C][C]0.7068[/C][C]0.676[/C][/ROW]
[ROW][C]130[/C][C]1964[/C][C]2241.7681[/C][C]1661.0774[/C][C]2822.4588[/C][C]0.1742[/C][C]0.544[/C][C]0.6395[/C][C]0.1982[/C][/ROW]
[ROW][C]131[/C][C]2132[/C][C]2474.3545[/C][C]1893.6638[/C][C]3055.0452[/C][C]0.1239[/C][C]0.9575[/C][C]0.4749[/C][C]0.4749[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=155879&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=155879&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[119])
1072689-------
1083187-------
1092540-------
1103469-------
1113005-------
1122573-------
1132998-------
1142768-------
1152556-------
1162414-------
1172467-------
1182136-------
1192493-------
12027353037.31732464.99833609.63640.15030.96880.30410.9688
12123162534.61541954.16273115.06810.23020.24930.49270.5559
12230423348.19762767.51383928.88150.15070.99980.34170.9981
12323642925.18152344.4913505.8720.02910.34670.39380.9277
12422482726.34372145.6533307.03440.05320.88930.69760.7845
12527142902.35142321.66073483.04210.26250.98640.37340.9165
12625832917.02772336.3373497.71840.12980.75340.69250.9238
12726312641.9982061.30733222.68870.48520.57890.61420.6925
12819652293.77761713.08692874.46830.13360.12750.34250.2507
12922092628.22472047.5343208.91540.07850.98740.70680.676
13019642241.76811661.07742822.45880.17420.5440.63950.1982
13121322474.35451893.66383055.04520.12390.95750.47490.4749







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1200.0961-0.0995091395.76400
1210.1168-0.08630.092947792.682169594.223263.8072
1220.0885-0.09150.092493756.997577648.4812278.6548
1230.1013-0.19180.1173314924.642136967.5214370.0912
1240.1087-0.17550.1289228812.65155336.5471394.1276
1250.1021-0.06490.118235476.2514135359.8312367.9128
1260.1016-0.11450.1177111574.4928131961.9257363.2656
1270.1121-0.00420.1035120.9562115481.8045339.8261
1280.1292-0.14330.1079108094.7386114661.0194338.6163
1290.1127-0.15950.1131175749.3365120769.8511347.5196
1300.1322-0.12390.114177155.1022116804.8739341.7673
1310.1197-0.13840.1161117206.5968116838.3508341.8163

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
120 & 0.0961 & -0.0995 & 0 & 91395.764 & 0 & 0 \tabularnewline
121 & 0.1168 & -0.0863 & 0.0929 & 47792.6821 & 69594.223 & 263.8072 \tabularnewline
122 & 0.0885 & -0.0915 & 0.0924 & 93756.9975 & 77648.4812 & 278.6548 \tabularnewline
123 & 0.1013 & -0.1918 & 0.1173 & 314924.642 & 136967.5214 & 370.0912 \tabularnewline
124 & 0.1087 & -0.1755 & 0.1289 & 228812.65 & 155336.5471 & 394.1276 \tabularnewline
125 & 0.1021 & -0.0649 & 0.1182 & 35476.2514 & 135359.8312 & 367.9128 \tabularnewline
126 & 0.1016 & -0.1145 & 0.1177 & 111574.4928 & 131961.9257 & 363.2656 \tabularnewline
127 & 0.1121 & -0.0042 & 0.1035 & 120.9562 & 115481.8045 & 339.8261 \tabularnewline
128 & 0.1292 & -0.1433 & 0.1079 & 108094.7386 & 114661.0194 & 338.6163 \tabularnewline
129 & 0.1127 & -0.1595 & 0.1131 & 175749.3365 & 120769.8511 & 347.5196 \tabularnewline
130 & 0.1322 & -0.1239 & 0.1141 & 77155.1022 & 116804.8739 & 341.7673 \tabularnewline
131 & 0.1197 & -0.1384 & 0.1161 & 117206.5968 & 116838.3508 & 341.8163 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=155879&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]120[/C][C]0.0961[/C][C]-0.0995[/C][C]0[/C][C]91395.764[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]121[/C][C]0.1168[/C][C]-0.0863[/C][C]0.0929[/C][C]47792.6821[/C][C]69594.223[/C][C]263.8072[/C][/ROW]
[ROW][C]122[/C][C]0.0885[/C][C]-0.0915[/C][C]0.0924[/C][C]93756.9975[/C][C]77648.4812[/C][C]278.6548[/C][/ROW]
[ROW][C]123[/C][C]0.1013[/C][C]-0.1918[/C][C]0.1173[/C][C]314924.642[/C][C]136967.5214[/C][C]370.0912[/C][/ROW]
[ROW][C]124[/C][C]0.1087[/C][C]-0.1755[/C][C]0.1289[/C][C]228812.65[/C][C]155336.5471[/C][C]394.1276[/C][/ROW]
[ROW][C]125[/C][C]0.1021[/C][C]-0.0649[/C][C]0.1182[/C][C]35476.2514[/C][C]135359.8312[/C][C]367.9128[/C][/ROW]
[ROW][C]126[/C][C]0.1016[/C][C]-0.1145[/C][C]0.1177[/C][C]111574.4928[/C][C]131961.9257[/C][C]363.2656[/C][/ROW]
[ROW][C]127[/C][C]0.1121[/C][C]-0.0042[/C][C]0.1035[/C][C]120.9562[/C][C]115481.8045[/C][C]339.8261[/C][/ROW]
[ROW][C]128[/C][C]0.1292[/C][C]-0.1433[/C][C]0.1079[/C][C]108094.7386[/C][C]114661.0194[/C][C]338.6163[/C][/ROW]
[ROW][C]129[/C][C]0.1127[/C][C]-0.1595[/C][C]0.1131[/C][C]175749.3365[/C][C]120769.8511[/C][C]347.5196[/C][/ROW]
[ROW][C]130[/C][C]0.1322[/C][C]-0.1239[/C][C]0.1141[/C][C]77155.1022[/C][C]116804.8739[/C][C]341.7673[/C][/ROW]
[ROW][C]131[/C][C]0.1197[/C][C]-0.1384[/C][C]0.1161[/C][C]117206.5968[/C][C]116838.3508[/C][C]341.8163[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=155879&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=155879&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
1200.0961-0.0995091395.76400
1210.1168-0.08630.092947792.682169594.223263.8072
1220.0885-0.09150.092493756.997577648.4812278.6548
1230.1013-0.19180.1173314924.642136967.5214370.0912
1240.1087-0.17550.1289228812.65155336.5471394.1276
1250.1021-0.06490.118235476.2514135359.8312367.9128
1260.1016-0.11450.1177111574.4928131961.9257363.2656
1270.1121-0.00420.1035120.9562115481.8045339.8261
1280.1292-0.14330.1079108094.7386114661.0194338.6163
1290.1127-0.15950.1131175749.3365120769.8511347.5196
1300.1322-0.12390.114177155.1022116804.8739341.7673
1310.1197-0.13840.1161117206.5968116838.3508341.8163



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 0 ; 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')