Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 11 Dec 2007 06:30:02 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2007/Dec/11/t1197379009owkm6i398w7z455.htm/, Retrieved Mon, 29 Apr 2024 03:26:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3109, Retrieved Mon, 29 Apr 2024 03:26:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact243
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ws9 -Q2] [2007-12-11 13:30:02] [6bdd947de0ee04552c8f0fc807f31807] [Current]
Feedback Forum

Post a new message
Dataseries X:
9884.9
10174.5
11395.4
10760.2
10570.1
10536
9902.6
8889
10837.3
11624.1
10509
10984.9
10649.1
10855.7
11677.4
10760.2
10046.2
10772.8
9987.7
8638.7
11063.7
11855.7
10684.5
11337.4
10478
11123.9
12909.3
11339.9
10462.2
12733.5
10519.2
10414.9
12476.8
12384.6
12266.7
12919.9
11497.3
12142
13919.4
12656.8
12034.1
13199.7
10881.3
11301.2
13643.9
12517
13981.1
14275.7
13435
13565.7
16216.3
12970
14079.9
14235
12213.4
12581
14130.4
14210.8
14378.5
13142.8
13714.7
13621.9
15379.8
14441.8
15354.8
15537.8
14552.7




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational 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' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3109&T=0

[TABLE]
[ROW][C]Summary of compuational 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' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3109&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3109&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[55])
4310881.3-------
4411301.2-------
4513643.9-------
4612517-------
4713981.1-------
4814275.7-------
4913435-------
5013565.7-------
5116216.3-------
5212970-------
5314079.9-------
5414235-------
5512213.4-------
561258112146.130311161.415913217.72110.21320.4510.93890.451
5714130.414736.715813534.977316045.15390.18190.99940.94920.9999
5814210.814324.328713059.07115712.17370.43630.60790.99470.9986
5914378.514947.032813480.151416573.5370.24660.81250.87780.9995
6013142.815293.364413753.229617005.9690.00690.85250.87790.9998
6113714.714486.826812941.233416217.0130.19090.93610.88330.995
6213621.914797.879613148.556116654.09030.10720.87360.90340.9968
6315379.817558.026915539.440319838.82970.03060.99960.87551
6414441.814252.163212550.749516184.22520.42370.12630.90330.9807
6515354.814755.056512940.252816824.37690.2850.61670.73870.992
6615537.815931.183813917.37918236.38030.3690.6880.92540.9992
6714552.713539.382711780.865315560.39220.16290.02630.90080.9008

\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[55]) \tabularnewline
43 & 10881.3 & - & - & - & - & - & - & - \tabularnewline
44 & 11301.2 & - & - & - & - & - & - & - \tabularnewline
45 & 13643.9 & - & - & - & - & - & - & - \tabularnewline
46 & 12517 & - & - & - & - & - & - & - \tabularnewline
47 & 13981.1 & - & - & - & - & - & - & - \tabularnewline
48 & 14275.7 & - & - & - & - & - & - & - \tabularnewline
49 & 13435 & - & - & - & - & - & - & - \tabularnewline
50 & 13565.7 & - & - & - & - & - & - & - \tabularnewline
51 & 16216.3 & - & - & - & - & - & - & - \tabularnewline
52 & 12970 & - & - & - & - & - & - & - \tabularnewline
53 & 14079.9 & - & - & - & - & - & - & - \tabularnewline
54 & 14235 & - & - & - & - & - & - & - \tabularnewline
55 & 12213.4 & - & - & - & - & - & - & - \tabularnewline
56 & 12581 & 12146.1303 & 11161.4159 & 13217.7211 & 0.2132 & 0.451 & 0.9389 & 0.451 \tabularnewline
57 & 14130.4 & 14736.7158 & 13534.9773 & 16045.1539 & 0.1819 & 0.9994 & 0.9492 & 0.9999 \tabularnewline
58 & 14210.8 & 14324.3287 & 13059.071 & 15712.1737 & 0.4363 & 0.6079 & 0.9947 & 0.9986 \tabularnewline
59 & 14378.5 & 14947.0328 & 13480.1514 & 16573.537 & 0.2466 & 0.8125 & 0.8778 & 0.9995 \tabularnewline
60 & 13142.8 & 15293.3644 & 13753.2296 & 17005.969 & 0.0069 & 0.8525 & 0.8779 & 0.9998 \tabularnewline
61 & 13714.7 & 14486.8268 & 12941.2334 & 16217.013 & 0.1909 & 0.9361 & 0.8833 & 0.995 \tabularnewline
62 & 13621.9 & 14797.8796 & 13148.5561 & 16654.0903 & 0.1072 & 0.8736 & 0.9034 & 0.9968 \tabularnewline
63 & 15379.8 & 17558.0269 & 15539.4403 & 19838.8297 & 0.0306 & 0.9996 & 0.8755 & 1 \tabularnewline
64 & 14441.8 & 14252.1632 & 12550.7495 & 16184.2252 & 0.4237 & 0.1263 & 0.9033 & 0.9807 \tabularnewline
65 & 15354.8 & 14755.0565 & 12940.2528 & 16824.3769 & 0.285 & 0.6167 & 0.7387 & 0.992 \tabularnewline
66 & 15537.8 & 15931.1838 & 13917.379 & 18236.3803 & 0.369 & 0.688 & 0.9254 & 0.9992 \tabularnewline
67 & 14552.7 & 13539.3827 & 11780.8653 & 15560.3922 & 0.1629 & 0.0263 & 0.9008 & 0.9008 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3109&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[55])[/C][/ROW]
[ROW][C]43[/C][C]10881.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]11301.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]13643.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]12517[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]13981.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]14275.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]13435[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]13565.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]16216.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]12970[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]14079.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]14235[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]12213.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]12581[/C][C]12146.1303[/C][C]11161.4159[/C][C]13217.7211[/C][C]0.2132[/C][C]0.451[/C][C]0.9389[/C][C]0.451[/C][/ROW]
[ROW][C]57[/C][C]14130.4[/C][C]14736.7158[/C][C]13534.9773[/C][C]16045.1539[/C][C]0.1819[/C][C]0.9994[/C][C]0.9492[/C][C]0.9999[/C][/ROW]
[ROW][C]58[/C][C]14210.8[/C][C]14324.3287[/C][C]13059.071[/C][C]15712.1737[/C][C]0.4363[/C][C]0.6079[/C][C]0.9947[/C][C]0.9986[/C][/ROW]
[ROW][C]59[/C][C]14378.5[/C][C]14947.0328[/C][C]13480.1514[/C][C]16573.537[/C][C]0.2466[/C][C]0.8125[/C][C]0.8778[/C][C]0.9995[/C][/ROW]
[ROW][C]60[/C][C]13142.8[/C][C]15293.3644[/C][C]13753.2296[/C][C]17005.969[/C][C]0.0069[/C][C]0.8525[/C][C]0.8779[/C][C]0.9998[/C][/ROW]
[ROW][C]61[/C][C]13714.7[/C][C]14486.8268[/C][C]12941.2334[/C][C]16217.013[/C][C]0.1909[/C][C]0.9361[/C][C]0.8833[/C][C]0.995[/C][/ROW]
[ROW][C]62[/C][C]13621.9[/C][C]14797.8796[/C][C]13148.5561[/C][C]16654.0903[/C][C]0.1072[/C][C]0.8736[/C][C]0.9034[/C][C]0.9968[/C][/ROW]
[ROW][C]63[/C][C]15379.8[/C][C]17558.0269[/C][C]15539.4403[/C][C]19838.8297[/C][C]0.0306[/C][C]0.9996[/C][C]0.8755[/C][C]1[/C][/ROW]
[ROW][C]64[/C][C]14441.8[/C][C]14252.1632[/C][C]12550.7495[/C][C]16184.2252[/C][C]0.4237[/C][C]0.1263[/C][C]0.9033[/C][C]0.9807[/C][/ROW]
[ROW][C]65[/C][C]15354.8[/C][C]14755.0565[/C][C]12940.2528[/C][C]16824.3769[/C][C]0.285[/C][C]0.6167[/C][C]0.7387[/C][C]0.992[/C][/ROW]
[ROW][C]66[/C][C]15537.8[/C][C]15931.1838[/C][C]13917.379[/C][C]18236.3803[/C][C]0.369[/C][C]0.688[/C][C]0.9254[/C][C]0.9992[/C][/ROW]
[ROW][C]67[/C][C]14552.7[/C][C]13539.3827[/C][C]11780.8653[/C][C]15560.3922[/C][C]0.1629[/C][C]0.0263[/C][C]0.9008[/C][C]0.9008[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3109&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3109&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[55])
4310881.3-------
4411301.2-------
4513643.9-------
4612517-------
4713981.1-------
4814275.7-------
4913435-------
5013565.7-------
5116216.3-------
5212970-------
5314079.9-------
5414235-------
5512213.4-------
561258112146.130311161.415913217.72110.21320.4510.93890.451
5714130.414736.715813534.977316045.15390.18190.99940.94920.9999
5814210.814324.328713059.07115712.17370.43630.60790.99470.9986
5914378.514947.032813480.151416573.5370.24660.81250.87780.9995
6013142.815293.364413753.229617005.9690.00690.85250.87790.9998
6113714.714486.826812941.233416217.0130.19090.93610.88330.995
6213621.914797.879613148.556116654.09030.10720.87360.90340.9968
6315379.817558.026915539.440319838.82970.03060.99960.87551
6414441.814252.163212550.749516184.22520.42370.12630.90330.9807
6515354.814755.056512940.252816824.37690.2850.61670.73870.992
6615537.815931.183813917.37918236.38030.3690.6880.92540.9992
6714552.713539.382711780.865315560.39220.16290.02630.90080.9008







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.0450.03580.003189111.621815759.3018125.5361
570.0453-0.04110.0034367618.89930634.9082175.0283
580.0494-0.00797e-0412888.76821074.06432.7729
590.0555-0.0380.0032323229.53126935.7942164.1213
600.0571-0.14060.01174624927.3966385410.6164620.8145
610.0609-0.05330.0044596179.773649681.6478222.8938
620.064-0.07950.00661382928.0147115244.0012339.4761
630.0663-0.12410.01034744672.63395389.3858628.8
640.06920.01330.001135962.09722996.841454.7434
650.07160.04060.0034359692.312629974.3594173.131
660.0738-0.02470.0021154750.790212895.8992113.5601
670.07620.07480.00621026811.917585567.6598292.5195

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.045 & 0.0358 & 0.003 & 189111.6218 & 15759.3018 & 125.5361 \tabularnewline
57 & 0.0453 & -0.0411 & 0.0034 & 367618.899 & 30634.9082 & 175.0283 \tabularnewline
58 & 0.0494 & -0.0079 & 7e-04 & 12888.7682 & 1074.064 & 32.7729 \tabularnewline
59 & 0.0555 & -0.038 & 0.0032 & 323229.531 & 26935.7942 & 164.1213 \tabularnewline
60 & 0.0571 & -0.1406 & 0.0117 & 4624927.3966 & 385410.6164 & 620.8145 \tabularnewline
61 & 0.0609 & -0.0533 & 0.0044 & 596179.7736 & 49681.6478 & 222.8938 \tabularnewline
62 & 0.064 & -0.0795 & 0.0066 & 1382928.0147 & 115244.0012 & 339.4761 \tabularnewline
63 & 0.0663 & -0.1241 & 0.0103 & 4744672.63 & 395389.3858 & 628.8 \tabularnewline
64 & 0.0692 & 0.0133 & 0.0011 & 35962.0972 & 2996.8414 & 54.7434 \tabularnewline
65 & 0.0716 & 0.0406 & 0.0034 & 359692.3126 & 29974.3594 & 173.131 \tabularnewline
66 & 0.0738 & -0.0247 & 0.0021 & 154750.7902 & 12895.8992 & 113.5601 \tabularnewline
67 & 0.0762 & 0.0748 & 0.0062 & 1026811.9175 & 85567.6598 & 292.5195 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3109&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]56[/C][C]0.045[/C][C]0.0358[/C][C]0.003[/C][C]189111.6218[/C][C]15759.3018[/C][C]125.5361[/C][/ROW]
[ROW][C]57[/C][C]0.0453[/C][C]-0.0411[/C][C]0.0034[/C][C]367618.899[/C][C]30634.9082[/C][C]175.0283[/C][/ROW]
[ROW][C]58[/C][C]0.0494[/C][C]-0.0079[/C][C]7e-04[/C][C]12888.7682[/C][C]1074.064[/C][C]32.7729[/C][/ROW]
[ROW][C]59[/C][C]0.0555[/C][C]-0.038[/C][C]0.0032[/C][C]323229.531[/C][C]26935.7942[/C][C]164.1213[/C][/ROW]
[ROW][C]60[/C][C]0.0571[/C][C]-0.1406[/C][C]0.0117[/C][C]4624927.3966[/C][C]385410.6164[/C][C]620.8145[/C][/ROW]
[ROW][C]61[/C][C]0.0609[/C][C]-0.0533[/C][C]0.0044[/C][C]596179.7736[/C][C]49681.6478[/C][C]222.8938[/C][/ROW]
[ROW][C]62[/C][C]0.064[/C][C]-0.0795[/C][C]0.0066[/C][C]1382928.0147[/C][C]115244.0012[/C][C]339.4761[/C][/ROW]
[ROW][C]63[/C][C]0.0663[/C][C]-0.1241[/C][C]0.0103[/C][C]4744672.63[/C][C]395389.3858[/C][C]628.8[/C][/ROW]
[ROW][C]64[/C][C]0.0692[/C][C]0.0133[/C][C]0.0011[/C][C]35962.0972[/C][C]2996.8414[/C][C]54.7434[/C][/ROW]
[ROW][C]65[/C][C]0.0716[/C][C]0.0406[/C][C]0.0034[/C][C]359692.3126[/C][C]29974.3594[/C][C]173.131[/C][/ROW]
[ROW][C]66[/C][C]0.0738[/C][C]-0.0247[/C][C]0.0021[/C][C]154750.7902[/C][C]12895.8992[/C][C]113.5601[/C][/ROW]
[ROW][C]67[/C][C]0.0762[/C][C]0.0748[/C][C]0.0062[/C][C]1026811.9175[/C][C]85567.6598[/C][C]292.5195[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3109&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3109&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
560.0450.03580.003189111.621815759.3018125.5361
570.0453-0.04110.0034367618.89930634.9082175.0283
580.0494-0.00797e-0412888.76821074.06432.7729
590.0555-0.0380.0032323229.53126935.7942164.1213
600.0571-0.14060.01174624927.3966385410.6164620.8145
610.0609-0.05330.0044596179.773649681.6478222.8938
620.064-0.07950.00661382928.0147115244.0012339.4761
630.0663-0.12410.01034744672.63395389.3858628.8
640.06920.01330.001135962.09722996.841454.7434
650.07160.04060.0034359692.312629974.3594173.131
660.0738-0.02470.0021154750.790212895.8992113.5601
670.07620.07480.00621026811.917585567.6598292.5195



Parameters (Session):
par1 = 12 ; par2 = 0.0 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 0 ; 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,fx))
(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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')