Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 29 Dec 2010 18:51:09 +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/29/t1293648541y2iruyglput21k7.htm/, Retrieved Fri, 03 May 2024 05:44:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=117029, Retrieved Fri, 03 May 2024 05:44:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact125
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper] [2010-12-29 18:51:09] [d5e0edb7e0239841e94676417b2a1e2e] [Current]
Feedback Forum

Post a new message
Dataseries X:
26548
26752
26967
27034
27056
27476
28497
29085
28720
29067
29249
29672
29761
30066
30315
30571
30757
30742
31310
31381
31470
31226
31081
31061
31114
30828
30418
30195
29877
29192
29876
29409
28458
28340
28164
28438
28053
27599
27226
27119
26625
26541
27023
26631
26154
26029
26008
26632
27010
27041
27244
26976
26715
27017
27714
27655
27103
27088
26968
27770
27616
27481
27279
26918
26503
26547
27467
27305
26259
26048
25743




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Herman Ole Andreas Wold' @ www.yougetit.org

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117029&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'Herman Ole Andreas Wold' @ www.yougetit.org







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[59])
4726008-------
4826632-------
4927010-------
5027041-------
5127244-------
5226976-------
5326715-------
5427017-------
5527714-------
5627655-------
5727103-------
5827088-------
5926968-------
602777027300.042626772.971727827.11340.04030.89150.99350.8915
612761627349.15426500.015928198.29210.2690.16570.78310.8105
622748127276.94626117.077728436.81440.36510.28330.65490.6992
632727927227.690825748.324428707.05720.47290.36860.49140.6346
642691827152.759525344.000328961.51870.39960.44560.57590.5793
652650326965.931724818.313629113.54970.33630.51740.59060.4992
662654726945.793424450.75529440.83170.3770.6360.47770.493
672746727634.531424784.551730484.5110.45410.77270.47820.6767
682730527587.140924375.751830798.530.43160.52920.48350.6472
692625927146.424423568.176830724.67190.31350.46540.50950.5389
702604827131.987923182.402331081.57350.29530.66760.50870.5324
712574327098.642522774.155831423.12920.26950.6830.52360.5236

\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[59]) \tabularnewline
47 & 26008 & - & - & - & - & - & - & - \tabularnewline
48 & 26632 & - & - & - & - & - & - & - \tabularnewline
49 & 27010 & - & - & - & - & - & - & - \tabularnewline
50 & 27041 & - & - & - & - & - & - & - \tabularnewline
51 & 27244 & - & - & - & - & - & - & - \tabularnewline
52 & 26976 & - & - & - & - & - & - & - \tabularnewline
53 & 26715 & - & - & - & - & - & - & - \tabularnewline
54 & 27017 & - & - & - & - & - & - & - \tabularnewline
55 & 27714 & - & - & - & - & - & - & - \tabularnewline
56 & 27655 & - & - & - & - & - & - & - \tabularnewline
57 & 27103 & - & - & - & - & - & - & - \tabularnewline
58 & 27088 & - & - & - & - & - & - & - \tabularnewline
59 & 26968 & - & - & - & - & - & - & - \tabularnewline
60 & 27770 & 27300.0426 & 26772.9717 & 27827.1134 & 0.0403 & 0.8915 & 0.9935 & 0.8915 \tabularnewline
61 & 27616 & 27349.154 & 26500.0159 & 28198.2921 & 0.269 & 0.1657 & 0.7831 & 0.8105 \tabularnewline
62 & 27481 & 27276.946 & 26117.0777 & 28436.8144 & 0.3651 & 0.2833 & 0.6549 & 0.6992 \tabularnewline
63 & 27279 & 27227.6908 & 25748.3244 & 28707.0572 & 0.4729 & 0.3686 & 0.4914 & 0.6346 \tabularnewline
64 & 26918 & 27152.7595 & 25344.0003 & 28961.5187 & 0.3996 & 0.4456 & 0.5759 & 0.5793 \tabularnewline
65 & 26503 & 26965.9317 & 24818.3136 & 29113.5497 & 0.3363 & 0.5174 & 0.5906 & 0.4992 \tabularnewline
66 & 26547 & 26945.7934 & 24450.755 & 29440.8317 & 0.377 & 0.636 & 0.4777 & 0.493 \tabularnewline
67 & 27467 & 27634.5314 & 24784.5517 & 30484.511 & 0.4541 & 0.7727 & 0.4782 & 0.6767 \tabularnewline
68 & 27305 & 27587.1409 & 24375.7518 & 30798.53 & 0.4316 & 0.5292 & 0.4835 & 0.6472 \tabularnewline
69 & 26259 & 27146.4244 & 23568.1768 & 30724.6719 & 0.3135 & 0.4654 & 0.5095 & 0.5389 \tabularnewline
70 & 26048 & 27131.9879 & 23182.4023 & 31081.5735 & 0.2953 & 0.6676 & 0.5087 & 0.5324 \tabularnewline
71 & 25743 & 27098.6425 & 22774.1558 & 31423.1292 & 0.2695 & 0.683 & 0.5236 & 0.5236 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117029&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[59])[/C][/ROW]
[ROW][C]47[/C][C]26008[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]26632[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]27010[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]27041[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]27244[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]26976[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]26715[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]27017[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]27714[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]27655[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]27103[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]27088[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]26968[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]27770[/C][C]27300.0426[/C][C]26772.9717[/C][C]27827.1134[/C][C]0.0403[/C][C]0.8915[/C][C]0.9935[/C][C]0.8915[/C][/ROW]
[ROW][C]61[/C][C]27616[/C][C]27349.154[/C][C]26500.0159[/C][C]28198.2921[/C][C]0.269[/C][C]0.1657[/C][C]0.7831[/C][C]0.8105[/C][/ROW]
[ROW][C]62[/C][C]27481[/C][C]27276.946[/C][C]26117.0777[/C][C]28436.8144[/C][C]0.3651[/C][C]0.2833[/C][C]0.6549[/C][C]0.6992[/C][/ROW]
[ROW][C]63[/C][C]27279[/C][C]27227.6908[/C][C]25748.3244[/C][C]28707.0572[/C][C]0.4729[/C][C]0.3686[/C][C]0.4914[/C][C]0.6346[/C][/ROW]
[ROW][C]64[/C][C]26918[/C][C]27152.7595[/C][C]25344.0003[/C][C]28961.5187[/C][C]0.3996[/C][C]0.4456[/C][C]0.5759[/C][C]0.5793[/C][/ROW]
[ROW][C]65[/C][C]26503[/C][C]26965.9317[/C][C]24818.3136[/C][C]29113.5497[/C][C]0.3363[/C][C]0.5174[/C][C]0.5906[/C][C]0.4992[/C][/ROW]
[ROW][C]66[/C][C]26547[/C][C]26945.7934[/C][C]24450.755[/C][C]29440.8317[/C][C]0.377[/C][C]0.636[/C][C]0.4777[/C][C]0.493[/C][/ROW]
[ROW][C]67[/C][C]27467[/C][C]27634.5314[/C][C]24784.5517[/C][C]30484.511[/C][C]0.4541[/C][C]0.7727[/C][C]0.4782[/C][C]0.6767[/C][/ROW]
[ROW][C]68[/C][C]27305[/C][C]27587.1409[/C][C]24375.7518[/C][C]30798.53[/C][C]0.4316[/C][C]0.5292[/C][C]0.4835[/C][C]0.6472[/C][/ROW]
[ROW][C]69[/C][C]26259[/C][C]27146.4244[/C][C]23568.1768[/C][C]30724.6719[/C][C]0.3135[/C][C]0.4654[/C][C]0.5095[/C][C]0.5389[/C][/ROW]
[ROW][C]70[/C][C]26048[/C][C]27131.9879[/C][C]23182.4023[/C][C]31081.5735[/C][C]0.2953[/C][C]0.6676[/C][C]0.5087[/C][C]0.5324[/C][/ROW]
[ROW][C]71[/C][C]25743[/C][C]27098.6425[/C][C]22774.1558[/C][C]31423.1292[/C][C]0.2695[/C][C]0.683[/C][C]0.5236[/C][C]0.5236[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117029&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117029&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[59])
4726008-------
4826632-------
4927010-------
5027041-------
5127244-------
5226976-------
5326715-------
5427017-------
5527714-------
5627655-------
5727103-------
5827088-------
5926968-------
602777027300.042626772.971727827.11340.04030.89150.99350.8915
612761627349.15426500.015928198.29210.2690.16570.78310.8105
622748127276.94626117.077728436.81440.36510.28330.65490.6992
632727927227.690825748.324428707.05720.47290.36860.49140.6346
642691827152.759525344.000328961.51870.39960.44560.57590.5793
652650326965.931724818.313629113.54970.33630.51740.59060.4992
662654726945.793424450.75529440.83170.3770.6360.47770.493
672746727634.531424784.551730484.5110.45410.77270.47820.6767
682730527587.140924375.751830798.530.43160.52920.48350.6472
692625927146.424423568.176830724.67190.31350.46540.50950.5389
702604827131.987923182.402331081.57350.29530.66760.50870.5324
712574327098.642522774.155831423.12920.26950.6830.52360.5236







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
600.00990.01720220859.971900
610.01580.00980.013571206.7821146033.377382.1431
620.02170.00750.011541638.0281111234.9274333.519
630.02770.00190.00912632.636884084.3547289.973
640.034-0.00860.00955112.027878289.8893279.8033
650.0406-0.01720.0104214305.7353100959.197317.7408
660.0472-0.01480.011159036.164109255.9066330.5388
670.0526-0.00610.010428066.754999107.2626314.8131
680.0594-0.01020.010479603.503896940.1783311.3522
690.0673-0.03270.0126787522.0326165998.3637407.429
700.0743-0.040.01511175029.7725257728.4918507.6697
710.0814-0.050.0181837766.6574389398.3389624.0179

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
60 & 0.0099 & 0.0172 & 0 & 220859.9719 & 0 & 0 \tabularnewline
61 & 0.0158 & 0.0098 & 0.0135 & 71206.7821 & 146033.377 & 382.1431 \tabularnewline
62 & 0.0217 & 0.0075 & 0.0115 & 41638.0281 & 111234.9274 & 333.519 \tabularnewline
63 & 0.0277 & 0.0019 & 0.0091 & 2632.6368 & 84084.3547 & 289.973 \tabularnewline
64 & 0.034 & -0.0086 & 0.009 & 55112.0278 & 78289.8893 & 279.8033 \tabularnewline
65 & 0.0406 & -0.0172 & 0.0104 & 214305.7353 & 100959.197 & 317.7408 \tabularnewline
66 & 0.0472 & -0.0148 & 0.011 & 159036.164 & 109255.9066 & 330.5388 \tabularnewline
67 & 0.0526 & -0.0061 & 0.0104 & 28066.7549 & 99107.2626 & 314.8131 \tabularnewline
68 & 0.0594 & -0.0102 & 0.0104 & 79603.5038 & 96940.1783 & 311.3522 \tabularnewline
69 & 0.0673 & -0.0327 & 0.0126 & 787522.0326 & 165998.3637 & 407.429 \tabularnewline
70 & 0.0743 & -0.04 & 0.0151 & 1175029.7725 & 257728.4918 & 507.6697 \tabularnewline
71 & 0.0814 & -0.05 & 0.018 & 1837766.6574 & 389398.3389 & 624.0179 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117029&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]60[/C][C]0.0099[/C][C]0.0172[/C][C]0[/C][C]220859.9719[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]61[/C][C]0.0158[/C][C]0.0098[/C][C]0.0135[/C][C]71206.7821[/C][C]146033.377[/C][C]382.1431[/C][/ROW]
[ROW][C]62[/C][C]0.0217[/C][C]0.0075[/C][C]0.0115[/C][C]41638.0281[/C][C]111234.9274[/C][C]333.519[/C][/ROW]
[ROW][C]63[/C][C]0.0277[/C][C]0.0019[/C][C]0.0091[/C][C]2632.6368[/C][C]84084.3547[/C][C]289.973[/C][/ROW]
[ROW][C]64[/C][C]0.034[/C][C]-0.0086[/C][C]0.009[/C][C]55112.0278[/C][C]78289.8893[/C][C]279.8033[/C][/ROW]
[ROW][C]65[/C][C]0.0406[/C][C]-0.0172[/C][C]0.0104[/C][C]214305.7353[/C][C]100959.197[/C][C]317.7408[/C][/ROW]
[ROW][C]66[/C][C]0.0472[/C][C]-0.0148[/C][C]0.011[/C][C]159036.164[/C][C]109255.9066[/C][C]330.5388[/C][/ROW]
[ROW][C]67[/C][C]0.0526[/C][C]-0.0061[/C][C]0.0104[/C][C]28066.7549[/C][C]99107.2626[/C][C]314.8131[/C][/ROW]
[ROW][C]68[/C][C]0.0594[/C][C]-0.0102[/C][C]0.0104[/C][C]79603.5038[/C][C]96940.1783[/C][C]311.3522[/C][/ROW]
[ROW][C]69[/C][C]0.0673[/C][C]-0.0327[/C][C]0.0126[/C][C]787522.0326[/C][C]165998.3637[/C][C]407.429[/C][/ROW]
[ROW][C]70[/C][C]0.0743[/C][C]-0.04[/C][C]0.0151[/C][C]1175029.7725[/C][C]257728.4918[/C][C]507.6697[/C][/ROW]
[ROW][C]71[/C][C]0.0814[/C][C]-0.05[/C][C]0.018[/C][C]1837766.6574[/C][C]389398.3389[/C][C]624.0179[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117029&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117029&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
600.00990.01720220859.971900
610.01580.00980.013571206.7821146033.377382.1431
620.02170.00750.011541638.0281111234.9274333.519
630.02770.00190.00912632.636884084.3547289.973
640.034-0.00860.00955112.027878289.8893279.8033
650.0406-0.01720.0104214305.7353100959.197317.7408
660.0472-0.01480.011159036.164109255.9066330.5388
670.0526-0.00610.010428066.754999107.2626314.8131
680.0594-0.01020.010479603.503896940.1783311.3522
690.0673-0.03270.0126787522.0326165998.3637407.429
700.0743-0.040.01511175029.7725257728.4918507.6697
710.0814-0.050.0181837766.6574389398.3389624.0179



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