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, 24 Dec 2010 09:36:42 +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/24/t1293183264my5ac0i1d72zvch.htm/, Retrieved Tue, 30 Apr 2024 03:39:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114661, Retrieved Tue, 30 Apr 2024 03:39:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact139
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecast] [2010-12-24 09:36:42] [be034431ba35f7eb1ce695fc7ca4deb9] [Current]
Feedback Forum

Post a new message
Dataseries X:
27951
29781
32914
33488
35652
36488
35387
35676
34844
32447
31068
29010
29812
30951
32974
32936
34012
32946
31948
30599
27691
25073
23406
22248
22896
25317
26558
26471
27543
26198
24725
25005
23462
20780
19815
19761
21454
23899
24939
23580
24562
24696
23785
23812
21917
19713
19282
18788
21453
24482
27474
27264
27349
30632
29429
30084
26290
24379
23335
21346
21106
24514
28353
30805
31348
34556
33855
34787
32529
29998
29257
28155
30466
35704
39327
39351
42234
43630
43722
43121
37985
37135
34646
33026
35087
38846
42013
43908
42868
44423
44167
43636
44382
42142
43452
36912
42413
45344
44873
47510
49554
47369
45998
48140
48441
44928
40454
38661
37246
36843
36424
37594
38144
38737
34560
36080
33508
35462
33374
32110
35533
35532
37903
36763
40399
44164
44496
43110
43880
43930
44327




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114661&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114661&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114661&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'RServer@AstonUniversity' @ vre.aston.ac.uk







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])
10740454-------
10838661-------
10937246-------
11036843-------
11136424-------
11237594-------
11338144-------
11438737-------
11534560-------
11636080-------
11733508-------
11835462-------
11933374-------
1203211031435.348128241.321334629.37490.33940.117100.1171
1213553333002.705328485.669537519.7410.13610.65080.03280.436
1223553235568.657830043.833741093.4820.49480.5050.32560.7819
1233790337516.985731141.740543892.23090.45280.72920.63160.8986
1243676338294.018131169.144845418.89140.33680.54280.57640.912
1254039939315.9231513.107347118.73280.39280.73930.61580.9322
1264416439950.415531524.031148376.79990.16350.45840.61110.937
1274449638690.184329683.29747697.07160.10320.11680.81560.8763
1284311039080.143829527.966948632.32070.20420.13320.73090.8792
1294388037120.744727052.768447188.72090.09410.12180.75910.7671
1304393035295.31624736.707845853.92420.05450.05550.48770.6393
1314432733853.713122826.280744881.14560.03130.03670.5340.534

\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 & 40454 & - & - & - & - & - & - & - \tabularnewline
108 & 38661 & - & - & - & - & - & - & - \tabularnewline
109 & 37246 & - & - & - & - & - & - & - \tabularnewline
110 & 36843 & - & - & - & - & - & - & - \tabularnewline
111 & 36424 & - & - & - & - & - & - & - \tabularnewline
112 & 37594 & - & - & - & - & - & - & - \tabularnewline
113 & 38144 & - & - & - & - & - & - & - \tabularnewline
114 & 38737 & - & - & - & - & - & - & - \tabularnewline
115 & 34560 & - & - & - & - & - & - & - \tabularnewline
116 & 36080 & - & - & - & - & - & - & - \tabularnewline
117 & 33508 & - & - & - & - & - & - & - \tabularnewline
118 & 35462 & - & - & - & - & - & - & - \tabularnewline
119 & 33374 & - & - & - & - & - & - & - \tabularnewline
120 & 32110 & 31435.3481 & 28241.3213 & 34629.3749 & 0.3394 & 0.1171 & 0 & 0.1171 \tabularnewline
121 & 35533 & 33002.7053 & 28485.6695 & 37519.741 & 0.1361 & 0.6508 & 0.0328 & 0.436 \tabularnewline
122 & 35532 & 35568.6578 & 30043.8337 & 41093.482 & 0.4948 & 0.505 & 0.3256 & 0.7819 \tabularnewline
123 & 37903 & 37516.9857 & 31141.7405 & 43892.2309 & 0.4528 & 0.7292 & 0.6316 & 0.8986 \tabularnewline
124 & 36763 & 38294.0181 & 31169.1448 & 45418.8914 & 0.3368 & 0.5428 & 0.5764 & 0.912 \tabularnewline
125 & 40399 & 39315.92 & 31513.1073 & 47118.7328 & 0.3928 & 0.7393 & 0.6158 & 0.9322 \tabularnewline
126 & 44164 & 39950.4155 & 31524.0311 & 48376.7999 & 0.1635 & 0.4584 & 0.6111 & 0.937 \tabularnewline
127 & 44496 & 38690.1843 & 29683.297 & 47697.0716 & 0.1032 & 0.1168 & 0.8156 & 0.8763 \tabularnewline
128 & 43110 & 39080.1438 & 29527.9669 & 48632.3207 & 0.2042 & 0.1332 & 0.7309 & 0.8792 \tabularnewline
129 & 43880 & 37120.7447 & 27052.7684 & 47188.7209 & 0.0941 & 0.1218 & 0.7591 & 0.7671 \tabularnewline
130 & 43930 & 35295.316 & 24736.7078 & 45853.9242 & 0.0545 & 0.0555 & 0.4877 & 0.6393 \tabularnewline
131 & 44327 & 33853.7131 & 22826.2807 & 44881.1456 & 0.0313 & 0.0367 & 0.534 & 0.534 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114661&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]40454[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]38661[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]37246[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]36843[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]36424[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]37594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]38144[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]38737[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]34560[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]36080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]33508[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]35462[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]33374[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]32110[/C][C]31435.3481[/C][C]28241.3213[/C][C]34629.3749[/C][C]0.3394[/C][C]0.1171[/C][C]0[/C][C]0.1171[/C][/ROW]
[ROW][C]121[/C][C]35533[/C][C]33002.7053[/C][C]28485.6695[/C][C]37519.741[/C][C]0.1361[/C][C]0.6508[/C][C]0.0328[/C][C]0.436[/C][/ROW]
[ROW][C]122[/C][C]35532[/C][C]35568.6578[/C][C]30043.8337[/C][C]41093.482[/C][C]0.4948[/C][C]0.505[/C][C]0.3256[/C][C]0.7819[/C][/ROW]
[ROW][C]123[/C][C]37903[/C][C]37516.9857[/C][C]31141.7405[/C][C]43892.2309[/C][C]0.4528[/C][C]0.7292[/C][C]0.6316[/C][C]0.8986[/C][/ROW]
[ROW][C]124[/C][C]36763[/C][C]38294.0181[/C][C]31169.1448[/C][C]45418.8914[/C][C]0.3368[/C][C]0.5428[/C][C]0.5764[/C][C]0.912[/C][/ROW]
[ROW][C]125[/C][C]40399[/C][C]39315.92[/C][C]31513.1073[/C][C]47118.7328[/C][C]0.3928[/C][C]0.7393[/C][C]0.6158[/C][C]0.9322[/C][/ROW]
[ROW][C]126[/C][C]44164[/C][C]39950.4155[/C][C]31524.0311[/C][C]48376.7999[/C][C]0.1635[/C][C]0.4584[/C][C]0.6111[/C][C]0.937[/C][/ROW]
[ROW][C]127[/C][C]44496[/C][C]38690.1843[/C][C]29683.297[/C][C]47697.0716[/C][C]0.1032[/C][C]0.1168[/C][C]0.8156[/C][C]0.8763[/C][/ROW]
[ROW][C]128[/C][C]43110[/C][C]39080.1438[/C][C]29527.9669[/C][C]48632.3207[/C][C]0.2042[/C][C]0.1332[/C][C]0.7309[/C][C]0.8792[/C][/ROW]
[ROW][C]129[/C][C]43880[/C][C]37120.7447[/C][C]27052.7684[/C][C]47188.7209[/C][C]0.0941[/C][C]0.1218[/C][C]0.7591[/C][C]0.7671[/C][/ROW]
[ROW][C]130[/C][C]43930[/C][C]35295.316[/C][C]24736.7078[/C][C]45853.9242[/C][C]0.0545[/C][C]0.0555[/C][C]0.4877[/C][C]0.6393[/C][/ROW]
[ROW][C]131[/C][C]44327[/C][C]33853.7131[/C][C]22826.2807[/C][C]44881.1456[/C][C]0.0313[/C][C]0.0367[/C][C]0.534[/C][C]0.534[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114661&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114661&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])
10740454-------
10838661-------
10937246-------
11036843-------
11136424-------
11237594-------
11338144-------
11438737-------
11534560-------
11636080-------
11733508-------
11835462-------
11933374-------
1203211031435.348128241.321334629.37490.33940.117100.1171
1213553333002.705328485.669537519.7410.13610.65080.03280.436
1223553235568.657830043.833741093.4820.49480.5050.32560.7819
1233790337516.985731141.740543892.23090.45280.72920.63160.8986
1243676338294.018131169.144845418.89140.33680.54280.57640.912
1254039939315.9231513.107347118.73280.39280.73930.61580.9322
1264416439950.415531524.031148376.79990.16350.45840.61110.937
1274449638690.184329683.29747697.07160.10320.11680.81560.8763
1284311039080.143829527.966948632.32070.20420.13320.73090.8792
1294388037120.744727052.768447188.72090.09410.12180.75910.7671
1304393035295.31624736.707845853.92420.05450.05550.48770.6393
1314432733853.713122826.280744881.14560.03130.03670.5340.534







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1200.05180.02150455155.146400
1210.06980.07670.04916402391.38233428773.26431851.6947
1220.0792-0.0010.03311343.79562286296.77481512.0505
1230.08670.01030.0274149007.0261751974.33761323.6217
1240.0949-0.040.02992344016.39041870382.74821367.6194
1250.10130.02750.02951173062.19461754162.65591324.4481
1260.10760.10550.040317754294.51574039895.77872009.9492
1270.11880.15010.054133707495.7397748345.77382783.5851
1280.12470.10310.059516239741.13248691834.14692948.1917
1290.13840.18210.071845687532.795412391404.01183520.1426
1300.15260.24460.087574557768.436718042891.68684247.6925
1310.16620.30940.106109689738.041625680128.8835067.5565

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
120 & 0.0518 & 0.0215 & 0 & 455155.1464 & 0 & 0 \tabularnewline
121 & 0.0698 & 0.0767 & 0.0491 & 6402391.3823 & 3428773.2643 & 1851.6947 \tabularnewline
122 & 0.0792 & -0.001 & 0.0331 & 1343.7956 & 2286296.7748 & 1512.0505 \tabularnewline
123 & 0.0867 & 0.0103 & 0.0274 & 149007.026 & 1751974.3376 & 1323.6217 \tabularnewline
124 & 0.0949 & -0.04 & 0.0299 & 2344016.3904 & 1870382.7482 & 1367.6194 \tabularnewline
125 & 0.1013 & 0.0275 & 0.0295 & 1173062.1946 & 1754162.6559 & 1324.4481 \tabularnewline
126 & 0.1076 & 0.1055 & 0.0403 & 17754294.5157 & 4039895.7787 & 2009.9492 \tabularnewline
127 & 0.1188 & 0.1501 & 0.0541 & 33707495.739 & 7748345.7738 & 2783.5851 \tabularnewline
128 & 0.1247 & 0.1031 & 0.0595 & 16239741.1324 & 8691834.1469 & 2948.1917 \tabularnewline
129 & 0.1384 & 0.1821 & 0.0718 & 45687532.7954 & 12391404.0118 & 3520.1426 \tabularnewline
130 & 0.1526 & 0.2446 & 0.0875 & 74557768.4367 & 18042891.6868 & 4247.6925 \tabularnewline
131 & 0.1662 & 0.3094 & 0.106 & 109689738.0416 & 25680128.883 & 5067.5565 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114661&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.0518[/C][C]0.0215[/C][C]0[/C][C]455155.1464[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]121[/C][C]0.0698[/C][C]0.0767[/C][C]0.0491[/C][C]6402391.3823[/C][C]3428773.2643[/C][C]1851.6947[/C][/ROW]
[ROW][C]122[/C][C]0.0792[/C][C]-0.001[/C][C]0.0331[/C][C]1343.7956[/C][C]2286296.7748[/C][C]1512.0505[/C][/ROW]
[ROW][C]123[/C][C]0.0867[/C][C]0.0103[/C][C]0.0274[/C][C]149007.026[/C][C]1751974.3376[/C][C]1323.6217[/C][/ROW]
[ROW][C]124[/C][C]0.0949[/C][C]-0.04[/C][C]0.0299[/C][C]2344016.3904[/C][C]1870382.7482[/C][C]1367.6194[/C][/ROW]
[ROW][C]125[/C][C]0.1013[/C][C]0.0275[/C][C]0.0295[/C][C]1173062.1946[/C][C]1754162.6559[/C][C]1324.4481[/C][/ROW]
[ROW][C]126[/C][C]0.1076[/C][C]0.1055[/C][C]0.0403[/C][C]17754294.5157[/C][C]4039895.7787[/C][C]2009.9492[/C][/ROW]
[ROW][C]127[/C][C]0.1188[/C][C]0.1501[/C][C]0.0541[/C][C]33707495.739[/C][C]7748345.7738[/C][C]2783.5851[/C][/ROW]
[ROW][C]128[/C][C]0.1247[/C][C]0.1031[/C][C]0.0595[/C][C]16239741.1324[/C][C]8691834.1469[/C][C]2948.1917[/C][/ROW]
[ROW][C]129[/C][C]0.1384[/C][C]0.1821[/C][C]0.0718[/C][C]45687532.7954[/C][C]12391404.0118[/C][C]3520.1426[/C][/ROW]
[ROW][C]130[/C][C]0.1526[/C][C]0.2446[/C][C]0.0875[/C][C]74557768.4367[/C][C]18042891.6868[/C][C]4247.6925[/C][/ROW]
[ROW][C]131[/C][C]0.1662[/C][C]0.3094[/C][C]0.106[/C][C]109689738.0416[/C][C]25680128.883[/C][C]5067.5565[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114661&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114661&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.05180.02150455155.146400
1210.06980.07670.04916402391.38233428773.26431851.6947
1220.0792-0.0010.03311343.79562286296.77481512.0505
1230.08670.01030.0274149007.0261751974.33761323.6217
1240.0949-0.040.02992344016.39041870382.74821367.6194
1250.10130.02750.02951173062.19461754162.65591324.4481
1260.10760.10550.040317754294.51574039895.77872009.9492
1270.11880.15010.054133707495.7397748345.77382783.5851
1280.12470.10310.059516239741.13248691834.14692948.1917
1290.13840.18210.071845687532.795412391404.01183520.1426
1300.15260.24460.087574557768.436718042891.68684247.6925
1310.16620.30940.106109689738.041625680128.8835067.5565



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