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 computationWed, 16 Dec 2009 09:51:24 -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/16/t1260982495pgjwm3ivu5mttxj.htm/, Retrieved Tue, 30 Apr 2024 08:38:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=68477, Retrieved Tue, 30 Apr 2024 08:38:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact141
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [ARIMA Backward Selection] [] [2009-11-27 14:53:14] [b98453cac15ba1066b407e146608df68]
-   PD    [ARIMA Backward Selection] [WS9 Berekening1 TVD] [2009-12-02 15:52:32] [42ad1186d39724f834063794eac7cea3]
-   PD      [ARIMA Backward Selection] [WS 9: Backward AR...] [2009-12-04 16:54:14] [b97b96148b0223bc16666763988dc147]
-   PD        [ARIMA Backward Selection] [Paper: Arima back...] [2009-12-14 17:41:13] [b97b96148b0223bc16666763988dc147]
- RMP             [ARIMA Forecasting] [Paper: Arima fore...] [2009-12-16 16:51:24] [17b3de9cda9f51722106e41c76160a49] [Current]
Feedback Forum

Post a new message
Dataseries X:
423
427
441
449
452
462
455
461
461
463
462
456
455
456
472
472
471
465
459
465
468
467
463
460
462
461
476
476
471
453
443
442
444
438
427
424
416
406
431
434
418
412
404
409
412
406
398
397
385
390
413
413
401
397
397
409
419
424
428
430




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=68477&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=68477&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68477&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[48])
36424-------
37416-------
38406-------
39431-------
40434-------
41418-------
42412-------
43404-------
44409-------
45412-------
46406-------
47398-------
48397-------
49385389.4248377.9435400.90610.2250.09800.098
50390380.3285363.5667397.09020.1290.29240.00130.0256
51413405.8803384.4224427.33820.25770.92650.01090.7914
52413409.1011382.2501435.9520.3880.3880.03460.8115
53401393.3741361.8071424.94120.31790.11150.06310.4109
54397387.5382351.6049423.47150.30290.23140.09110.3029
55397379.6256339.4944419.75690.19810.19810.11690.1981
56409384.7092340.6958428.72260.13970.29210.13970.2921
57419387.7603340.0997435.42090.09940.19120.15940.352
58424381.7916330.6745432.90870.05280.07680.17660.2799
59428373.8175319.4363428.19880.02540.03530.19170.2017
60430372.8338315.3502430.31740.02560.030.2050.205

\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[48]) \tabularnewline
36 & 424 & - & - & - & - & - & - & - \tabularnewline
37 & 416 & - & - & - & - & - & - & - \tabularnewline
38 & 406 & - & - & - & - & - & - & - \tabularnewline
39 & 431 & - & - & - & - & - & - & - \tabularnewline
40 & 434 & - & - & - & - & - & - & - \tabularnewline
41 & 418 & - & - & - & - & - & - & - \tabularnewline
42 & 412 & - & - & - & - & - & - & - \tabularnewline
43 & 404 & - & - & - & - & - & - & - \tabularnewline
44 & 409 & - & - & - & - & - & - & - \tabularnewline
45 & 412 & - & - & - & - & - & - & - \tabularnewline
46 & 406 & - & - & - & - & - & - & - \tabularnewline
47 & 398 & - & - & - & - & - & - & - \tabularnewline
48 & 397 & - & - & - & - & - & - & - \tabularnewline
49 & 385 & 389.4248 & 377.9435 & 400.9061 & 0.225 & 0.098 & 0 & 0.098 \tabularnewline
50 & 390 & 380.3285 & 363.5667 & 397.0902 & 0.129 & 0.2924 & 0.0013 & 0.0256 \tabularnewline
51 & 413 & 405.8803 & 384.4224 & 427.3382 & 0.2577 & 0.9265 & 0.0109 & 0.7914 \tabularnewline
52 & 413 & 409.1011 & 382.2501 & 435.952 & 0.388 & 0.388 & 0.0346 & 0.8115 \tabularnewline
53 & 401 & 393.3741 & 361.8071 & 424.9412 & 0.3179 & 0.1115 & 0.0631 & 0.4109 \tabularnewline
54 & 397 & 387.5382 & 351.6049 & 423.4715 & 0.3029 & 0.2314 & 0.0911 & 0.3029 \tabularnewline
55 & 397 & 379.6256 & 339.4944 & 419.7569 & 0.1981 & 0.1981 & 0.1169 & 0.1981 \tabularnewline
56 & 409 & 384.7092 & 340.6958 & 428.7226 & 0.1397 & 0.2921 & 0.1397 & 0.2921 \tabularnewline
57 & 419 & 387.7603 & 340.0997 & 435.4209 & 0.0994 & 0.1912 & 0.1594 & 0.352 \tabularnewline
58 & 424 & 381.7916 & 330.6745 & 432.9087 & 0.0528 & 0.0768 & 0.1766 & 0.2799 \tabularnewline
59 & 428 & 373.8175 & 319.4363 & 428.1988 & 0.0254 & 0.0353 & 0.1917 & 0.2017 \tabularnewline
60 & 430 & 372.8338 & 315.3502 & 430.3174 & 0.0256 & 0.03 & 0.205 & 0.205 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68477&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[48])[/C][/ROW]
[ROW][C]36[/C][C]424[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]416[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]431[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]434[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]418[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]412[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]404[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]409[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]412[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]398[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]397[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]385[/C][C]389.4248[/C][C]377.9435[/C][C]400.9061[/C][C]0.225[/C][C]0.098[/C][C]0[/C][C]0.098[/C][/ROW]
[ROW][C]50[/C][C]390[/C][C]380.3285[/C][C]363.5667[/C][C]397.0902[/C][C]0.129[/C][C]0.2924[/C][C]0.0013[/C][C]0.0256[/C][/ROW]
[ROW][C]51[/C][C]413[/C][C]405.8803[/C][C]384.4224[/C][C]427.3382[/C][C]0.2577[/C][C]0.9265[/C][C]0.0109[/C][C]0.7914[/C][/ROW]
[ROW][C]52[/C][C]413[/C][C]409.1011[/C][C]382.2501[/C][C]435.952[/C][C]0.388[/C][C]0.388[/C][C]0.0346[/C][C]0.8115[/C][/ROW]
[ROW][C]53[/C][C]401[/C][C]393.3741[/C][C]361.8071[/C][C]424.9412[/C][C]0.3179[/C][C]0.1115[/C][C]0.0631[/C][C]0.4109[/C][/ROW]
[ROW][C]54[/C][C]397[/C][C]387.5382[/C][C]351.6049[/C][C]423.4715[/C][C]0.3029[/C][C]0.2314[/C][C]0.0911[/C][C]0.3029[/C][/ROW]
[ROW][C]55[/C][C]397[/C][C]379.6256[/C][C]339.4944[/C][C]419.7569[/C][C]0.1981[/C][C]0.1981[/C][C]0.1169[/C][C]0.1981[/C][/ROW]
[ROW][C]56[/C][C]409[/C][C]384.7092[/C][C]340.6958[/C][C]428.7226[/C][C]0.1397[/C][C]0.2921[/C][C]0.1397[/C][C]0.2921[/C][/ROW]
[ROW][C]57[/C][C]419[/C][C]387.7603[/C][C]340.0997[/C][C]435.4209[/C][C]0.0994[/C][C]0.1912[/C][C]0.1594[/C][C]0.352[/C][/ROW]
[ROW][C]58[/C][C]424[/C][C]381.7916[/C][C]330.6745[/C][C]432.9087[/C][C]0.0528[/C][C]0.0768[/C][C]0.1766[/C][C]0.2799[/C][/ROW]
[ROW][C]59[/C][C]428[/C][C]373.8175[/C][C]319.4363[/C][C]428.1988[/C][C]0.0254[/C][C]0.0353[/C][C]0.1917[/C][C]0.2017[/C][/ROW]
[ROW][C]60[/C][C]430[/C][C]372.8338[/C][C]315.3502[/C][C]430.3174[/C][C]0.0256[/C][C]0.03[/C][C]0.205[/C][C]0.205[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68477&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68477&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[48])
36424-------
37416-------
38406-------
39431-------
40434-------
41418-------
42412-------
43404-------
44409-------
45412-------
46406-------
47398-------
48397-------
49385389.4248377.9435400.90610.2250.09800.098
50390380.3285363.5667397.09020.1290.29240.00130.0256
51413405.8803384.4224427.33820.25770.92650.01090.7914
52413409.1011382.2501435.9520.3880.3880.03460.8115
53401393.3741361.8071424.94120.31790.11150.06310.4109
54397387.5382351.6049423.47150.30290.23140.09110.3029
55397379.6256339.4944419.75690.19810.19810.11690.1981
56409384.7092340.6958428.72260.13970.29210.13970.2921
57419387.7603340.0997435.42090.09940.19120.15940.352
58424381.7916330.6745432.90870.05280.07680.17660.2799
59428373.8175319.4363428.19880.02540.03530.19170.2017
60430372.8338315.3502430.31740.02560.030.2050.205







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.015-0.0114019.57900
500.02250.02540.018493.538856.55897.5206
510.0270.01750.018150.690454.60277.3894
520.03350.00950.01615.201744.75256.6897
530.04090.01940.016658.153747.43276.8871
540.04730.02440.017989.525954.44827.3789
550.05390.04580.0219301.868989.79419.476
560.05840.06310.0271590.043152.325212.342
570.06270.08060.033975.9202243.835715.6152
580.06830.11060.04081781.5502397.607219.9401
590.07420.14490.05022935.739628.346425.0668
600.07870.15330.05883267.9693848.31529.1258

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.015 & -0.0114 & 0 & 19.579 & 0 & 0 \tabularnewline
50 & 0.0225 & 0.0254 & 0.0184 & 93.5388 & 56.5589 & 7.5206 \tabularnewline
51 & 0.027 & 0.0175 & 0.0181 & 50.6904 & 54.6027 & 7.3894 \tabularnewline
52 & 0.0335 & 0.0095 & 0.016 & 15.2017 & 44.7525 & 6.6897 \tabularnewline
53 & 0.0409 & 0.0194 & 0.0166 & 58.1537 & 47.4327 & 6.8871 \tabularnewline
54 & 0.0473 & 0.0244 & 0.0179 & 89.5259 & 54.4482 & 7.3789 \tabularnewline
55 & 0.0539 & 0.0458 & 0.0219 & 301.8689 & 89.7941 & 9.476 \tabularnewline
56 & 0.0584 & 0.0631 & 0.0271 & 590.043 & 152.3252 & 12.342 \tabularnewline
57 & 0.0627 & 0.0806 & 0.033 & 975.9202 & 243.8357 & 15.6152 \tabularnewline
58 & 0.0683 & 0.1106 & 0.0408 & 1781.5502 & 397.6072 & 19.9401 \tabularnewline
59 & 0.0742 & 0.1449 & 0.0502 & 2935.739 & 628.3464 & 25.0668 \tabularnewline
60 & 0.0787 & 0.1533 & 0.0588 & 3267.9693 & 848.315 & 29.1258 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68477&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]49[/C][C]0.015[/C][C]-0.0114[/C][C]0[/C][C]19.579[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0225[/C][C]0.0254[/C][C]0.0184[/C][C]93.5388[/C][C]56.5589[/C][C]7.5206[/C][/ROW]
[ROW][C]51[/C][C]0.027[/C][C]0.0175[/C][C]0.0181[/C][C]50.6904[/C][C]54.6027[/C][C]7.3894[/C][/ROW]
[ROW][C]52[/C][C]0.0335[/C][C]0.0095[/C][C]0.016[/C][C]15.2017[/C][C]44.7525[/C][C]6.6897[/C][/ROW]
[ROW][C]53[/C][C]0.0409[/C][C]0.0194[/C][C]0.0166[/C][C]58.1537[/C][C]47.4327[/C][C]6.8871[/C][/ROW]
[ROW][C]54[/C][C]0.0473[/C][C]0.0244[/C][C]0.0179[/C][C]89.5259[/C][C]54.4482[/C][C]7.3789[/C][/ROW]
[ROW][C]55[/C][C]0.0539[/C][C]0.0458[/C][C]0.0219[/C][C]301.8689[/C][C]89.7941[/C][C]9.476[/C][/ROW]
[ROW][C]56[/C][C]0.0584[/C][C]0.0631[/C][C]0.0271[/C][C]590.043[/C][C]152.3252[/C][C]12.342[/C][/ROW]
[ROW][C]57[/C][C]0.0627[/C][C]0.0806[/C][C]0.033[/C][C]975.9202[/C][C]243.8357[/C][C]15.6152[/C][/ROW]
[ROW][C]58[/C][C]0.0683[/C][C]0.1106[/C][C]0.0408[/C][C]1781.5502[/C][C]397.6072[/C][C]19.9401[/C][/ROW]
[ROW][C]59[/C][C]0.0742[/C][C]0.1449[/C][C]0.0502[/C][C]2935.739[/C][C]628.3464[/C][C]25.0668[/C][/ROW]
[ROW][C]60[/C][C]0.0787[/C][C]0.1533[/C][C]0.0588[/C][C]3267.9693[/C][C]848.315[/C][C]29.1258[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68477&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68477&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
490.015-0.0114019.57900
500.02250.02540.018493.538856.55897.5206
510.0270.01750.018150.690454.60277.3894
520.03350.00950.01615.201744.75256.6897
530.04090.01940.016658.153747.43276.8871
540.04730.02440.017989.525954.44827.3789
550.05390.04580.0219301.868989.79419.476
560.05840.06310.0271590.043152.325212.342
570.06270.08060.033975.9202243.835715.6152
580.06830.11060.04081781.5502397.607219.9401
590.07420.14490.05022935.739628.346425.0668
600.07870.15330.05883267.9693848.31529.1258



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