Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 30 Dec 2009 10:39:32 -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/2009/Dec/30/t12621948160b64rnkyv9x13ot.htm/, Retrieved Mon, 29 Apr 2024 00:05:18 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71338, Retrieved Mon, 29 Apr 2024 00:05:18 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact97
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecasting...] [2009-12-30 17:39:32] [dbd46bd47d5f87b1007a5a1708bef00e] [Current]
Feedback Forum

Post a new message
Dataseries X:
10967,87
10433,56
10665,78
10666,71
10682,74
10777,22
10052,6
10213,97
10546,82
10767,2
10444,5
10314,68
9042,56
9220,75
9721,84
9978,53
9923,81
9892,56
10500,98
10179,35
10080,48
9492,44
8616,49
8685,4
8160,67
8048,1
8641,21
8526,63
8474,21
7916,13
7977,64
8334,59
8623,36
9098,03
9154,34
9284,73
9492,49
9682,35
9762,12
10124,63
10540,05
10601,61
10323,73
10418,4
10092,96
10364,91
10152,09
10032,8
10204,59
10001,6
10411,75
10673,38
10539,51
10723,78
10682,06
10283,19
10377,18
10486,64
10545,38
10554,27
10532,54
10324,31
10695,25
10827,81
10872,48
10971,19
11145,65
11234,68
11333,88
10997,97
11036,89
11257,35
11533,59
11963,12
12185,15
12377,62
12512,89
12631,48
12268,53
12754,8
13407,75
13480,21
13673,28
13239,71
13557,69
13901,28
13200,58
13406,97
12538,12
12419,57
12193,88
12656,63
12812,48
12056,67
11322,38
11530,75
11114,08
9181,73
8614,55
8595,56
8396,20
7690,50
7235,47
7992,12
8398,37
8593
8679,75
9374,63
9634,97
9857,34
10238,83




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71338&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' @ 72.249.127.135







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[99])
8713200.58-------
8813406.97-------
8912538.12-------
9012419.57-------
9112193.88-------
9212656.63-------
9312812.48-------
9412056.67-------
9511322.38-------
9611530.75-------
9711114.08-------
989181.73-------
998614.55-------
1008595.568527.23187733.30229321.16140.4330.414700.4147
1018396.28513.78917301.49119726.0870.42460.447400.4353
1027690.58511.71956980.758610042.68040.14650.558800.4476
1037235.478511.40096716.006410306.79540.08180.814900.4552
1047992.128511.35196485.548710537.15510.30770.891500.4602
1058398.378511.34436278.757410743.93120.46050.67571e-040.4639
10685938511.34326089.560710933.12560.47370.53640.00210.4667
1078679.758511.3435914.110111108.57590.44940.47540.01690.469
1089374.638511.3435749.78411272.90190.270.45240.01610.4708
1099634.978511.34295594.701511427.98440.22510.28090.04010.4724
1109857.348511.34295447.458711575.22720.19460.23610.3340.4737
11110238.838511.34295306.974711715.71120.14530.20520.47480.4748

\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[99]) \tabularnewline
87 & 13200.58 & - & - & - & - & - & - & - \tabularnewline
88 & 13406.97 & - & - & - & - & - & - & - \tabularnewline
89 & 12538.12 & - & - & - & - & - & - & - \tabularnewline
90 & 12419.57 & - & - & - & - & - & - & - \tabularnewline
91 & 12193.88 & - & - & - & - & - & - & - \tabularnewline
92 & 12656.63 & - & - & - & - & - & - & - \tabularnewline
93 & 12812.48 & - & - & - & - & - & - & - \tabularnewline
94 & 12056.67 & - & - & - & - & - & - & - \tabularnewline
95 & 11322.38 & - & - & - & - & - & - & - \tabularnewline
96 & 11530.75 & - & - & - & - & - & - & - \tabularnewline
97 & 11114.08 & - & - & - & - & - & - & - \tabularnewline
98 & 9181.73 & - & - & - & - & - & - & - \tabularnewline
99 & 8614.55 & - & - & - & - & - & - & - \tabularnewline
100 & 8595.56 & 8527.2318 & 7733.3022 & 9321.1614 & 0.433 & 0.4147 & 0 & 0.4147 \tabularnewline
101 & 8396.2 & 8513.7891 & 7301.4911 & 9726.087 & 0.4246 & 0.4474 & 0 & 0.4353 \tabularnewline
102 & 7690.5 & 8511.7195 & 6980.7586 & 10042.6804 & 0.1465 & 0.5588 & 0 & 0.4476 \tabularnewline
103 & 7235.47 & 8511.4009 & 6716.0064 & 10306.7954 & 0.0818 & 0.8149 & 0 & 0.4552 \tabularnewline
104 & 7992.12 & 8511.3519 & 6485.5487 & 10537.1551 & 0.3077 & 0.8915 & 0 & 0.4602 \tabularnewline
105 & 8398.37 & 8511.3443 & 6278.7574 & 10743.9312 & 0.4605 & 0.6757 & 1e-04 & 0.4639 \tabularnewline
106 & 8593 & 8511.3432 & 6089.5607 & 10933.1256 & 0.4737 & 0.5364 & 0.0021 & 0.4667 \tabularnewline
107 & 8679.75 & 8511.343 & 5914.1101 & 11108.5759 & 0.4494 & 0.4754 & 0.0169 & 0.469 \tabularnewline
108 & 9374.63 & 8511.343 & 5749.784 & 11272.9019 & 0.27 & 0.4524 & 0.0161 & 0.4708 \tabularnewline
109 & 9634.97 & 8511.3429 & 5594.7015 & 11427.9844 & 0.2251 & 0.2809 & 0.0401 & 0.4724 \tabularnewline
110 & 9857.34 & 8511.3429 & 5447.4587 & 11575.2272 & 0.1946 & 0.2361 & 0.334 & 0.4737 \tabularnewline
111 & 10238.83 & 8511.3429 & 5306.9747 & 11715.7112 & 0.1453 & 0.2052 & 0.4748 & 0.4748 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71338&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[99])[/C][/ROW]
[ROW][C]87[/C][C]13200.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]13406.97[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]12538.12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]12419.57[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]12193.88[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]12656.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]12812.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]12056.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]11322.38[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]11530.75[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]11114.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]9181.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]8614.55[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]8595.56[/C][C]8527.2318[/C][C]7733.3022[/C][C]9321.1614[/C][C]0.433[/C][C]0.4147[/C][C]0[/C][C]0.4147[/C][/ROW]
[ROW][C]101[/C][C]8396.2[/C][C]8513.7891[/C][C]7301.4911[/C][C]9726.087[/C][C]0.4246[/C][C]0.4474[/C][C]0[/C][C]0.4353[/C][/ROW]
[ROW][C]102[/C][C]7690.5[/C][C]8511.7195[/C][C]6980.7586[/C][C]10042.6804[/C][C]0.1465[/C][C]0.5588[/C][C]0[/C][C]0.4476[/C][/ROW]
[ROW][C]103[/C][C]7235.47[/C][C]8511.4009[/C][C]6716.0064[/C][C]10306.7954[/C][C]0.0818[/C][C]0.8149[/C][C]0[/C][C]0.4552[/C][/ROW]
[ROW][C]104[/C][C]7992.12[/C][C]8511.3519[/C][C]6485.5487[/C][C]10537.1551[/C][C]0.3077[/C][C]0.8915[/C][C]0[/C][C]0.4602[/C][/ROW]
[ROW][C]105[/C][C]8398.37[/C][C]8511.3443[/C][C]6278.7574[/C][C]10743.9312[/C][C]0.4605[/C][C]0.6757[/C][C]1e-04[/C][C]0.4639[/C][/ROW]
[ROW][C]106[/C][C]8593[/C][C]8511.3432[/C][C]6089.5607[/C][C]10933.1256[/C][C]0.4737[/C][C]0.5364[/C][C]0.0021[/C][C]0.4667[/C][/ROW]
[ROW][C]107[/C][C]8679.75[/C][C]8511.343[/C][C]5914.1101[/C][C]11108.5759[/C][C]0.4494[/C][C]0.4754[/C][C]0.0169[/C][C]0.469[/C][/ROW]
[ROW][C]108[/C][C]9374.63[/C][C]8511.343[/C][C]5749.784[/C][C]11272.9019[/C][C]0.27[/C][C]0.4524[/C][C]0.0161[/C][C]0.4708[/C][/ROW]
[ROW][C]109[/C][C]9634.97[/C][C]8511.3429[/C][C]5594.7015[/C][C]11427.9844[/C][C]0.2251[/C][C]0.2809[/C][C]0.0401[/C][C]0.4724[/C][/ROW]
[ROW][C]110[/C][C]9857.34[/C][C]8511.3429[/C][C]5447.4587[/C][C]11575.2272[/C][C]0.1946[/C][C]0.2361[/C][C]0.334[/C][C]0.4737[/C][/ROW]
[ROW][C]111[/C][C]10238.83[/C][C]8511.3429[/C][C]5306.9747[/C][C]11715.7112[/C][C]0.1453[/C][C]0.2052[/C][C]0.4748[/C][C]0.4748[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71338&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71338&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[99])
8713200.58-------
8813406.97-------
8912538.12-------
9012419.57-------
9112193.88-------
9212656.63-------
9312812.48-------
9412056.67-------
9511322.38-------
9611530.75-------
9711114.08-------
989181.73-------
998614.55-------
1008595.568527.23187733.30229321.16140.4330.414700.4147
1018396.28513.78917301.49119726.0870.42460.447400.4353
1027690.58511.71956980.758610042.68040.14650.558800.4476
1037235.478511.40096716.006410306.79540.08180.814900.4552
1047992.128511.35196485.548710537.15510.30770.891500.4602
1058398.378511.34436278.757410743.93120.46050.67571e-040.4639
10685938511.34326089.560710933.12560.47370.53640.00210.4667
1078679.758511.3435914.110111108.57590.44940.47540.01690.469
1089374.638511.3435749.78411272.90190.270.45240.01610.4708
1099634.978511.34295594.701511427.98440.22510.28090.04010.4724
1109857.348511.34295447.458711575.22720.19460.23610.3340.4737
11110238.838511.34295306.974711715.71120.14530.20520.47480.4748







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1000.04750.00804668.740100
1010.0726-0.01380.010913827.18729247.963696.1663
1020.0918-0.09650.0394674401.5136230965.8136480.589
1030.1076-0.14990.06711627999.7146580224.2889761.7245
1040.1214-0.0610.0658269601.7356518099.7782719.7915
1050.1338-0.01330.057112763.1968433877.0147658.6934
1060.14520.00960.05036667.84372847.1326610.6121
1070.15570.01980.046528360.9251329786.3566574.2703
1080.16550.10140.0526745264.5302375950.5981613.1481
1090.17480.1320.06051262537.7563464609.314681.6226
1100.18370.15810.06941811708.0709587072.8373766.2068
1110.19210.2030.08052984211.5241786834.3945887.0369

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
100 & 0.0475 & 0.008 & 0 & 4668.7401 & 0 & 0 \tabularnewline
101 & 0.0726 & -0.0138 & 0.0109 & 13827.1872 & 9247.9636 & 96.1663 \tabularnewline
102 & 0.0918 & -0.0965 & 0.0394 & 674401.5136 & 230965.8136 & 480.589 \tabularnewline
103 & 0.1076 & -0.1499 & 0.0671 & 1627999.7146 & 580224.2889 & 761.7245 \tabularnewline
104 & 0.1214 & -0.061 & 0.0658 & 269601.7356 & 518099.7782 & 719.7915 \tabularnewline
105 & 0.1338 & -0.0133 & 0.0571 & 12763.1968 & 433877.0147 & 658.6934 \tabularnewline
106 & 0.1452 & 0.0096 & 0.0503 & 6667.84 & 372847.1326 & 610.6121 \tabularnewline
107 & 0.1557 & 0.0198 & 0.0465 & 28360.9251 & 329786.3566 & 574.2703 \tabularnewline
108 & 0.1655 & 0.1014 & 0.0526 & 745264.5302 & 375950.5981 & 613.1481 \tabularnewline
109 & 0.1748 & 0.132 & 0.0605 & 1262537.7563 & 464609.314 & 681.6226 \tabularnewline
110 & 0.1837 & 0.1581 & 0.0694 & 1811708.0709 & 587072.8373 & 766.2068 \tabularnewline
111 & 0.1921 & 0.203 & 0.0805 & 2984211.5241 & 786834.3945 & 887.0369 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71338&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]100[/C][C]0.0475[/C][C]0.008[/C][C]0[/C][C]4668.7401[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]101[/C][C]0.0726[/C][C]-0.0138[/C][C]0.0109[/C][C]13827.1872[/C][C]9247.9636[/C][C]96.1663[/C][/ROW]
[ROW][C]102[/C][C]0.0918[/C][C]-0.0965[/C][C]0.0394[/C][C]674401.5136[/C][C]230965.8136[/C][C]480.589[/C][/ROW]
[ROW][C]103[/C][C]0.1076[/C][C]-0.1499[/C][C]0.0671[/C][C]1627999.7146[/C][C]580224.2889[/C][C]761.7245[/C][/ROW]
[ROW][C]104[/C][C]0.1214[/C][C]-0.061[/C][C]0.0658[/C][C]269601.7356[/C][C]518099.7782[/C][C]719.7915[/C][/ROW]
[ROW][C]105[/C][C]0.1338[/C][C]-0.0133[/C][C]0.0571[/C][C]12763.1968[/C][C]433877.0147[/C][C]658.6934[/C][/ROW]
[ROW][C]106[/C][C]0.1452[/C][C]0.0096[/C][C]0.0503[/C][C]6667.84[/C][C]372847.1326[/C][C]610.6121[/C][/ROW]
[ROW][C]107[/C][C]0.1557[/C][C]0.0198[/C][C]0.0465[/C][C]28360.9251[/C][C]329786.3566[/C][C]574.2703[/C][/ROW]
[ROW][C]108[/C][C]0.1655[/C][C]0.1014[/C][C]0.0526[/C][C]745264.5302[/C][C]375950.5981[/C][C]613.1481[/C][/ROW]
[ROW][C]109[/C][C]0.1748[/C][C]0.132[/C][C]0.0605[/C][C]1262537.7563[/C][C]464609.314[/C][C]681.6226[/C][/ROW]
[ROW][C]110[/C][C]0.1837[/C][C]0.1581[/C][C]0.0694[/C][C]1811708.0709[/C][C]587072.8373[/C][C]766.2068[/C][/ROW]
[ROW][C]111[/C][C]0.1921[/C][C]0.203[/C][C]0.0805[/C][C]2984211.5241[/C][C]786834.3945[/C][C]887.0369[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71338&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71338&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
1000.04750.00804668.740100
1010.0726-0.01380.010913827.18729247.963696.1663
1020.0918-0.09650.0394674401.5136230965.8136480.589
1030.1076-0.14990.06711627999.7146580224.2889761.7245
1040.1214-0.0610.0658269601.7356518099.7782719.7915
1050.1338-0.01330.057112763.1968433877.0147658.6934
1060.14520.00960.05036667.84372847.1326610.6121
1070.15570.01980.046528360.9251329786.3566574.2703
1080.16550.10140.0526745264.5302375950.5981613.1481
1090.17480.1320.06051262537.7563464609.314681.6226
1100.18370.15810.06941811708.0709587072.8373766.2068
1110.19210.2030.08052984211.5241786834.3945887.0369



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