Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 19 Dec 2008 04:37:34 -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/2008/Dec/19/t1229686720qmubcvr83rg1ogl.htm/, Retrieved Wed, 15 May 2024 07:49:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=35068, Retrieved Wed, 15 May 2024 07:49:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact182
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2008-12-19 11:37:34] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
14525.87
14295.79
13830.14
14153.22
15418.03
16666.97
16505.21
17135.96
18033.25
17671
17544.22
17677.9
18470.97
18409.96
18941.6
19685.53
19834.71
19598.93
17039.97
16969.28
16973.38
16329.89
16153.34
15311.7
14760.87
14452.93
13720.95
13266.27
12708.47
13411.84
13975.55
12974.89
12151.11
11576.21
9996.83
10438.9
10511.22
10496.2
10300.79
9981.65
11448.79
11384.49
11717.46
10965.88
10352.27
9751.2
9354.01
8792.5
8721.14
8692.94
8570.73
8538.47
8169.75
7905.84
8145.82
8895.71
9676.31
9884.59
10637.44
10717.13
10205.29
10295.98
10892.76
10631.92
11441.08
11950.95
11037.54
11527.72
11383.89
10989.34
11079.42
11028.93
10973
11068.05
11394.84
11545.71
11809.38
11395.64
11082.38
11402.75
11716.87
12204.98
12986.62
13392.79
14368.05
15650.83
16102.64
16187.64
16311.54
17232.97
16397.83
14990.31
15147.55
15786.78
15934.09
16519.44
16101.07
16775.08
17286.32
17741.23
17128.37
17460.53
17611.14
18001.37
17974.77
16460.95
16235.39
16903.36
15543.76
15532.18
13731.31
13547.84
12602.93
13357.7
13995.33
14084.6
13168.91
12989.35
12123.53
9117.03
8531.45




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35068&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'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[109])
9716101.07-------
9816775.08-------
9917286.32-------
10017741.23-------
10117128.37-------
10217460.53-------
10317611.14-------
10418001.37-------
10517974.77-------
10616460.95-------
10716235.39-------
10816903.36-------
10915543.76-------
11015532.1815249.915214006.817416493.01290.32810.32160.00810.3216
11113731.3115186.407713229.18517143.63030.07250.36460.01770.3602
11213547.8415172.682112663.681517681.68260.10220.86990.02240.386
11312602.9315169.715612203.403818136.02740.04490.85810.09780.4024
11413357.715169.074511805.814418532.33450.14560.93260.09090.4136
11513995.3315168.935911450.617818887.2540.26810.83010.0990.4217
11614084.615168.905911126.547419211.26450.29950.71530.08480.4279
11713168.9115168.899510826.604819511.19420.18330.68770.10270.4328
11812989.3515168.898110546.084919791.71130.17770.80180.29190.4369
11912123.5315168.897810281.640420056.15520.1110.8090.33440.4402
1209117.0315168.897710030.788320307.00720.01050.87730.25410.4431
1218531.4515168.89779791.625820546.16960.00780.98630.44570.4457

\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[109]) \tabularnewline
97 & 16101.07 & - & - & - & - & - & - & - \tabularnewline
98 & 16775.08 & - & - & - & - & - & - & - \tabularnewline
99 & 17286.32 & - & - & - & - & - & - & - \tabularnewline
100 & 17741.23 & - & - & - & - & - & - & - \tabularnewline
101 & 17128.37 & - & - & - & - & - & - & - \tabularnewline
102 & 17460.53 & - & - & - & - & - & - & - \tabularnewline
103 & 17611.14 & - & - & - & - & - & - & - \tabularnewline
104 & 18001.37 & - & - & - & - & - & - & - \tabularnewline
105 & 17974.77 & - & - & - & - & - & - & - \tabularnewline
106 & 16460.95 & - & - & - & - & - & - & - \tabularnewline
107 & 16235.39 & - & - & - & - & - & - & - \tabularnewline
108 & 16903.36 & - & - & - & - & - & - & - \tabularnewline
109 & 15543.76 & - & - & - & - & - & - & - \tabularnewline
110 & 15532.18 & 15249.9152 & 14006.8174 & 16493.0129 & 0.3281 & 0.3216 & 0.0081 & 0.3216 \tabularnewline
111 & 13731.31 & 15186.4077 & 13229.185 & 17143.6303 & 0.0725 & 0.3646 & 0.0177 & 0.3602 \tabularnewline
112 & 13547.84 & 15172.6821 & 12663.6815 & 17681.6826 & 0.1022 & 0.8699 & 0.0224 & 0.386 \tabularnewline
113 & 12602.93 & 15169.7156 & 12203.4038 & 18136.0274 & 0.0449 & 0.8581 & 0.0978 & 0.4024 \tabularnewline
114 & 13357.7 & 15169.0745 & 11805.8144 & 18532.3345 & 0.1456 & 0.9326 & 0.0909 & 0.4136 \tabularnewline
115 & 13995.33 & 15168.9359 & 11450.6178 & 18887.254 & 0.2681 & 0.8301 & 0.099 & 0.4217 \tabularnewline
116 & 14084.6 & 15168.9059 & 11126.5474 & 19211.2645 & 0.2995 & 0.7153 & 0.0848 & 0.4279 \tabularnewline
117 & 13168.91 & 15168.8995 & 10826.6048 & 19511.1942 & 0.1833 & 0.6877 & 0.1027 & 0.4328 \tabularnewline
118 & 12989.35 & 15168.8981 & 10546.0849 & 19791.7113 & 0.1777 & 0.8018 & 0.2919 & 0.4369 \tabularnewline
119 & 12123.53 & 15168.8978 & 10281.6404 & 20056.1552 & 0.111 & 0.809 & 0.3344 & 0.4402 \tabularnewline
120 & 9117.03 & 15168.8977 & 10030.7883 & 20307.0072 & 0.0105 & 0.8773 & 0.2541 & 0.4431 \tabularnewline
121 & 8531.45 & 15168.8977 & 9791.6258 & 20546.1696 & 0.0078 & 0.9863 & 0.4457 & 0.4457 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35068&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[109])[/C][/ROW]
[ROW][C]97[/C][C]16101.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]16775.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]17286.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]17741.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]17128.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]17460.53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]17611.14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]18001.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]17974.77[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]16460.95[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]16235.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]16903.36[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]15543.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]15532.18[/C][C]15249.9152[/C][C]14006.8174[/C][C]16493.0129[/C][C]0.3281[/C][C]0.3216[/C][C]0.0081[/C][C]0.3216[/C][/ROW]
[ROW][C]111[/C][C]13731.31[/C][C]15186.4077[/C][C]13229.185[/C][C]17143.6303[/C][C]0.0725[/C][C]0.3646[/C][C]0.0177[/C][C]0.3602[/C][/ROW]
[ROW][C]112[/C][C]13547.84[/C][C]15172.6821[/C][C]12663.6815[/C][C]17681.6826[/C][C]0.1022[/C][C]0.8699[/C][C]0.0224[/C][C]0.386[/C][/ROW]
[ROW][C]113[/C][C]12602.93[/C][C]15169.7156[/C][C]12203.4038[/C][C]18136.0274[/C][C]0.0449[/C][C]0.8581[/C][C]0.0978[/C][C]0.4024[/C][/ROW]
[ROW][C]114[/C][C]13357.7[/C][C]15169.0745[/C][C]11805.8144[/C][C]18532.3345[/C][C]0.1456[/C][C]0.9326[/C][C]0.0909[/C][C]0.4136[/C][/ROW]
[ROW][C]115[/C][C]13995.33[/C][C]15168.9359[/C][C]11450.6178[/C][C]18887.254[/C][C]0.2681[/C][C]0.8301[/C][C]0.099[/C][C]0.4217[/C][/ROW]
[ROW][C]116[/C][C]14084.6[/C][C]15168.9059[/C][C]11126.5474[/C][C]19211.2645[/C][C]0.2995[/C][C]0.7153[/C][C]0.0848[/C][C]0.4279[/C][/ROW]
[ROW][C]117[/C][C]13168.91[/C][C]15168.8995[/C][C]10826.6048[/C][C]19511.1942[/C][C]0.1833[/C][C]0.6877[/C][C]0.1027[/C][C]0.4328[/C][/ROW]
[ROW][C]118[/C][C]12989.35[/C][C]15168.8981[/C][C]10546.0849[/C][C]19791.7113[/C][C]0.1777[/C][C]0.8018[/C][C]0.2919[/C][C]0.4369[/C][/ROW]
[ROW][C]119[/C][C]12123.53[/C][C]15168.8978[/C][C]10281.6404[/C][C]20056.1552[/C][C]0.111[/C][C]0.809[/C][C]0.3344[/C][C]0.4402[/C][/ROW]
[ROW][C]120[/C][C]9117.03[/C][C]15168.8977[/C][C]10030.7883[/C][C]20307.0072[/C][C]0.0105[/C][C]0.8773[/C][C]0.2541[/C][C]0.4431[/C][/ROW]
[ROW][C]121[/C][C]8531.45[/C][C]15168.8977[/C][C]9791.6258[/C][C]20546.1696[/C][C]0.0078[/C][C]0.9863[/C][C]0.4457[/C][C]0.4457[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35068&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35068&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[109])
9716101.07-------
9816775.08-------
9917286.32-------
10017741.23-------
10117128.37-------
10217460.53-------
10317611.14-------
10418001.37-------
10517974.77-------
10616460.95-------
10716235.39-------
10816903.36-------
10915543.76-------
11015532.1815249.915214006.817416493.01290.32810.32160.00810.3216
11113731.3115186.407713229.18517143.63030.07250.36460.01770.3602
11213547.8415172.682112663.681517681.68260.10220.86990.02240.386
11312602.9315169.715612203.403818136.02740.04490.85810.09780.4024
11413357.715169.074511805.814418532.33450.14560.93260.09090.4136
11513995.3315168.935911450.617818887.2540.26810.83010.0990.4217
11614084.615168.905911126.547419211.26450.29950.71530.08480.4279
11713168.9115168.899510826.604819511.19420.18330.68770.10270.4328
11812989.3515168.898110546.084919791.71130.17770.80180.29190.4369
11912123.5315168.897810281.640420056.15520.1110.8090.33440.4402
1209117.0315168.897710030.788320307.00720.01050.87730.25410.4431
1218531.4515168.89779791.625820546.16960.00780.98630.44570.4457







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1100.04160.01850.001579673.43876639.453281.4828
1110.0658-0.09580.0082117309.2238176442.4353420.0505
1120.0844-0.10710.00892640111.6902220009.3075469.0515
1130.0998-0.16920.01416588388.2589549032.3549740.9672
1140.1131-0.11940.013281077.4321273423.1193522.8988
1150.1251-0.07740.00641377350.7961114779.233338.7908
1160.136-0.07150.0061175719.387397976.6156313.0122
1170.1461-0.13180.0113999957.8995333329.825577.3472
1180.1555-0.14370.0124750429.8156395869.1513629.1813
1190.1644-0.20080.01679274264.8769772855.4064879.122
1200.1728-0.3990.033236625102.7593052091.89661747.0237
1210.1809-0.43760.036544055711.89323671309.32441916.0661

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
110 & 0.0416 & 0.0185 & 0.0015 & 79673.4387 & 6639.4532 & 81.4828 \tabularnewline
111 & 0.0658 & -0.0958 & 0.008 & 2117309.2238 & 176442.4353 & 420.0505 \tabularnewline
112 & 0.0844 & -0.1071 & 0.0089 & 2640111.6902 & 220009.3075 & 469.0515 \tabularnewline
113 & 0.0998 & -0.1692 & 0.0141 & 6588388.2589 & 549032.3549 & 740.9672 \tabularnewline
114 & 0.1131 & -0.1194 & 0.01 & 3281077.4321 & 273423.1193 & 522.8988 \tabularnewline
115 & 0.1251 & -0.0774 & 0.0064 & 1377350.7961 & 114779.233 & 338.7908 \tabularnewline
116 & 0.136 & -0.0715 & 0.006 & 1175719.3873 & 97976.6156 & 313.0122 \tabularnewline
117 & 0.1461 & -0.1318 & 0.011 & 3999957.8995 & 333329.825 & 577.3472 \tabularnewline
118 & 0.1555 & -0.1437 & 0.012 & 4750429.8156 & 395869.1513 & 629.1813 \tabularnewline
119 & 0.1644 & -0.2008 & 0.0167 & 9274264.8769 & 772855.4064 & 879.122 \tabularnewline
120 & 0.1728 & -0.399 & 0.0332 & 36625102.759 & 3052091.8966 & 1747.0237 \tabularnewline
121 & 0.1809 & -0.4376 & 0.0365 & 44055711.8932 & 3671309.3244 & 1916.0661 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35068&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]110[/C][C]0.0416[/C][C]0.0185[/C][C]0.0015[/C][C]79673.4387[/C][C]6639.4532[/C][C]81.4828[/C][/ROW]
[ROW][C]111[/C][C]0.0658[/C][C]-0.0958[/C][C]0.008[/C][C]2117309.2238[/C][C]176442.4353[/C][C]420.0505[/C][/ROW]
[ROW][C]112[/C][C]0.0844[/C][C]-0.1071[/C][C]0.0089[/C][C]2640111.6902[/C][C]220009.3075[/C][C]469.0515[/C][/ROW]
[ROW][C]113[/C][C]0.0998[/C][C]-0.1692[/C][C]0.0141[/C][C]6588388.2589[/C][C]549032.3549[/C][C]740.9672[/C][/ROW]
[ROW][C]114[/C][C]0.1131[/C][C]-0.1194[/C][C]0.01[/C][C]3281077.4321[/C][C]273423.1193[/C][C]522.8988[/C][/ROW]
[ROW][C]115[/C][C]0.1251[/C][C]-0.0774[/C][C]0.0064[/C][C]1377350.7961[/C][C]114779.233[/C][C]338.7908[/C][/ROW]
[ROW][C]116[/C][C]0.136[/C][C]-0.0715[/C][C]0.006[/C][C]1175719.3873[/C][C]97976.6156[/C][C]313.0122[/C][/ROW]
[ROW][C]117[/C][C]0.1461[/C][C]-0.1318[/C][C]0.011[/C][C]3999957.8995[/C][C]333329.825[/C][C]577.3472[/C][/ROW]
[ROW][C]118[/C][C]0.1555[/C][C]-0.1437[/C][C]0.012[/C][C]4750429.8156[/C][C]395869.1513[/C][C]629.1813[/C][/ROW]
[ROW][C]119[/C][C]0.1644[/C][C]-0.2008[/C][C]0.0167[/C][C]9274264.8769[/C][C]772855.4064[/C][C]879.122[/C][/ROW]
[ROW][C]120[/C][C]0.1728[/C][C]-0.399[/C][C]0.0332[/C][C]36625102.759[/C][C]3052091.8966[/C][C]1747.0237[/C][/ROW]
[ROW][C]121[/C][C]0.1809[/C][C]-0.4376[/C][C]0.0365[/C][C]44055711.8932[/C][C]3671309.3244[/C][C]1916.0661[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35068&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35068&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
1100.04160.01850.001579673.43876639.453281.4828
1110.0658-0.09580.0082117309.2238176442.4353420.0505
1120.0844-0.10710.00892640111.6902220009.3075469.0515
1130.0998-0.16920.01416588388.2589549032.3549740.9672
1140.1131-0.11940.013281077.4321273423.1193522.8988
1150.1251-0.07740.00641377350.7961114779.233338.7908
1160.136-0.07150.0061175719.387397976.6156313.0122
1170.1461-0.13180.0113999957.8995333329.825577.3472
1180.1555-0.14370.0124750429.8156395869.1513629.1813
1190.1644-0.20080.01679274264.8769772855.4064879.122
1200.1728-0.3990.033236625102.7593052091.89661747.0237
1210.1809-0.43760.036544055711.89323671309.32441916.0661



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,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)
}
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.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')