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 computationThu, 22 Dec 2011 09:05:28 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/22/t1324562767mlwxph81dju3dbb.htm/, Retrieved Fri, 03 May 2024 14:40:31 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=159473, Retrieved Fri, 03 May 2024 14:40:31 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact75
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Kendall tau Correlation Matrix] [] [2010-12-05 17:44:33] [b98453cac15ba1066b407e146608df68]
- RMPD    [ARIMA Forecasting] [ARIMA Forecasting] [2011-12-22 14:05:28] [e569a00cc6e8044e6afea1f18dd335a0] [Current]
Feedback Forum

Post a new message
Dataseries X:
2582
2624
2566
2645
3167
3051
2503
2574
2988
3086
2632
2604
2377
2258
2266
2601
2843
3018
2493
2647
3015
3101
2496
2342
2271
1969
2196
2294
2706
3001
2691
2554
2961
3226
2960
2749
2379
2254
2592
2780
2833
2911
2494
2643
2902
2880
2657
2609
2394
2492
2414
2621
3055
2940
2582
2430
2781
2904
2474
2254
2244
1972
2408
2523
2634
2798
2418
2551
2741
3011
2558
2167
1944
1836
2292
2576
2653
2900
2438
2439
2717
2872
2157
1541




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net

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

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







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[72])
602254-------
612244-------
621972-------
632408-------
642523-------
652634-------
662798-------
672418-------
682551-------
692741-------
703011-------
712558-------
722167-------
7319442153.1541869.04892437.25920.07450.4620.26540.462
7418362121.24231790.49242451.99230.04550.85320.81180.3931
7522922331.51721985.3952677.63950.41150.99750.33250.8242
7625762531.05592179.52292882.5890.40110.90870.51790.9788
7726532835.26712481.79193188.74230.15610.92470.86780.9999
7829002927.10622572.933281.28230.44040.93540.76251
7924382517.64012163.21312872.06720.32980.01720.70920.9738
8024392558.52442204.01472913.03420.25440.74740.51660.9848
8127172885.68142531.16463240.19810.17550.99320.78811
8228723031.69992677.24383386.1560.18860.95910.54561
8321572633.23172278.9722987.49140.00420.09320.66140.9951
8415412453.93572100.22862807.642900.95010.94410.9441

\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[72]) \tabularnewline
60 & 2254 & - & - & - & - & - & - & - \tabularnewline
61 & 2244 & - & - & - & - & - & - & - \tabularnewline
62 & 1972 & - & - & - & - & - & - & - \tabularnewline
63 & 2408 & - & - & - & - & - & - & - \tabularnewline
64 & 2523 & - & - & - & - & - & - & - \tabularnewline
65 & 2634 & - & - & - & - & - & - & - \tabularnewline
66 & 2798 & - & - & - & - & - & - & - \tabularnewline
67 & 2418 & - & - & - & - & - & - & - \tabularnewline
68 & 2551 & - & - & - & - & - & - & - \tabularnewline
69 & 2741 & - & - & - & - & - & - & - \tabularnewline
70 & 3011 & - & - & - & - & - & - & - \tabularnewline
71 & 2558 & - & - & - & - & - & - & - \tabularnewline
72 & 2167 & - & - & - & - & - & - & - \tabularnewline
73 & 1944 & 2153.154 & 1869.0489 & 2437.2592 & 0.0745 & 0.462 & 0.2654 & 0.462 \tabularnewline
74 & 1836 & 2121.2423 & 1790.4924 & 2451.9923 & 0.0455 & 0.8532 & 0.8118 & 0.3931 \tabularnewline
75 & 2292 & 2331.5172 & 1985.395 & 2677.6395 & 0.4115 & 0.9975 & 0.3325 & 0.8242 \tabularnewline
76 & 2576 & 2531.0559 & 2179.5229 & 2882.589 & 0.4011 & 0.9087 & 0.5179 & 0.9788 \tabularnewline
77 & 2653 & 2835.2671 & 2481.7919 & 3188.7423 & 0.1561 & 0.9247 & 0.8678 & 0.9999 \tabularnewline
78 & 2900 & 2927.1062 & 2572.93 & 3281.2823 & 0.4404 & 0.9354 & 0.7625 & 1 \tabularnewline
79 & 2438 & 2517.6401 & 2163.2131 & 2872.0672 & 0.3298 & 0.0172 & 0.7092 & 0.9738 \tabularnewline
80 & 2439 & 2558.5244 & 2204.0147 & 2913.0342 & 0.2544 & 0.7474 & 0.5166 & 0.9848 \tabularnewline
81 & 2717 & 2885.6814 & 2531.1646 & 3240.1981 & 0.1755 & 0.9932 & 0.7881 & 1 \tabularnewline
82 & 2872 & 3031.6999 & 2677.2438 & 3386.156 & 0.1886 & 0.9591 & 0.5456 & 1 \tabularnewline
83 & 2157 & 2633.2317 & 2278.972 & 2987.4914 & 0.0042 & 0.0932 & 0.6614 & 0.9951 \tabularnewline
84 & 1541 & 2453.9357 & 2100.2286 & 2807.6429 & 0 & 0.9501 & 0.9441 & 0.9441 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159473&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[72])[/C][/ROW]
[ROW][C]60[/C][C]2254[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]2244[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]1972[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]2408[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]2523[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]2634[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]2798[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]2418[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]2551[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]2741[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]3011[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]2558[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]2167[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]1944[/C][C]2153.154[/C][C]1869.0489[/C][C]2437.2592[/C][C]0.0745[/C][C]0.462[/C][C]0.2654[/C][C]0.462[/C][/ROW]
[ROW][C]74[/C][C]1836[/C][C]2121.2423[/C][C]1790.4924[/C][C]2451.9923[/C][C]0.0455[/C][C]0.8532[/C][C]0.8118[/C][C]0.3931[/C][/ROW]
[ROW][C]75[/C][C]2292[/C][C]2331.5172[/C][C]1985.395[/C][C]2677.6395[/C][C]0.4115[/C][C]0.9975[/C][C]0.3325[/C][C]0.8242[/C][/ROW]
[ROW][C]76[/C][C]2576[/C][C]2531.0559[/C][C]2179.5229[/C][C]2882.589[/C][C]0.4011[/C][C]0.9087[/C][C]0.5179[/C][C]0.9788[/C][/ROW]
[ROW][C]77[/C][C]2653[/C][C]2835.2671[/C][C]2481.7919[/C][C]3188.7423[/C][C]0.1561[/C][C]0.9247[/C][C]0.8678[/C][C]0.9999[/C][/ROW]
[ROW][C]78[/C][C]2900[/C][C]2927.1062[/C][C]2572.93[/C][C]3281.2823[/C][C]0.4404[/C][C]0.9354[/C][C]0.7625[/C][C]1[/C][/ROW]
[ROW][C]79[/C][C]2438[/C][C]2517.6401[/C][C]2163.2131[/C][C]2872.0672[/C][C]0.3298[/C][C]0.0172[/C][C]0.7092[/C][C]0.9738[/C][/ROW]
[ROW][C]80[/C][C]2439[/C][C]2558.5244[/C][C]2204.0147[/C][C]2913.0342[/C][C]0.2544[/C][C]0.7474[/C][C]0.5166[/C][C]0.9848[/C][/ROW]
[ROW][C]81[/C][C]2717[/C][C]2885.6814[/C][C]2531.1646[/C][C]3240.1981[/C][C]0.1755[/C][C]0.9932[/C][C]0.7881[/C][C]1[/C][/ROW]
[ROW][C]82[/C][C]2872[/C][C]3031.6999[/C][C]2677.2438[/C][C]3386.156[/C][C]0.1886[/C][C]0.9591[/C][C]0.5456[/C][C]1[/C][/ROW]
[ROW][C]83[/C][C]2157[/C][C]2633.2317[/C][C]2278.972[/C][C]2987.4914[/C][C]0.0042[/C][C]0.0932[/C][C]0.6614[/C][C]0.9951[/C][/ROW]
[ROW][C]84[/C][C]1541[/C][C]2453.9357[/C][C]2100.2286[/C][C]2807.6429[/C][C]0[/C][C]0.9501[/C][C]0.9441[/C][C]0.9441[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159473&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159473&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[72])
602254-------
612244-------
621972-------
632408-------
642523-------
652634-------
662798-------
672418-------
682551-------
692741-------
703011-------
712558-------
722167-------
7319442153.1541869.04892437.25920.07450.4620.26540.462
7418362121.24231790.49242451.99230.04550.85320.81180.3931
7522922331.51721985.3952677.63950.41150.99750.33250.8242
7625762531.05592179.52292882.5890.40110.90870.51790.9788
7726532835.26712481.79193188.74230.15610.92470.86780.9999
7829002927.10622572.933281.28230.44040.93540.76251
7924382517.64012163.21312872.06720.32980.01720.70920.9738
8024392558.52442204.01472913.03420.25440.74740.51660.9848
8127172885.68142531.16463240.19810.17550.99320.78811
8228723031.69992677.24383386.1560.18860.95910.54561
8321572633.23172278.9722987.49140.00420.09320.66140.9951
8415412453.93572100.22862807.642900.95010.94410.9441







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
730.0673-0.0971043745.408900
740.0796-0.13450.115881363.189162554.299250.1086
750.0757-0.01690.08291561.611942223.4033205.4833
760.07090.01780.06662019.967732172.5444179.3671
770.0636-0.06430.066133221.294632382.2944179.9508
780.0617-0.00930.0566734.744327107.7028164.6442
790.0718-0.03160.05316342.549724141.2523155.3746
800.0707-0.04670.052314286.093822909.3575151.3584
810.0627-0.05850.05328453.402723525.3625153.3798
820.0597-0.05270.052925504.048723723.2311154.0235
830.0686-0.18090.0646226796.604742184.4469205.3885
840.0735-0.3720.0902833451.6734108123.3825328.8212

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
73 & 0.0673 & -0.0971 & 0 & 43745.4089 & 0 & 0 \tabularnewline
74 & 0.0796 & -0.1345 & 0.1158 & 81363.1891 & 62554.299 & 250.1086 \tabularnewline
75 & 0.0757 & -0.0169 & 0.0829 & 1561.6119 & 42223.4033 & 205.4833 \tabularnewline
76 & 0.0709 & 0.0178 & 0.0666 & 2019.9677 & 32172.5444 & 179.3671 \tabularnewline
77 & 0.0636 & -0.0643 & 0.0661 & 33221.2946 & 32382.2944 & 179.9508 \tabularnewline
78 & 0.0617 & -0.0093 & 0.0566 & 734.7443 & 27107.7028 & 164.6442 \tabularnewline
79 & 0.0718 & -0.0316 & 0.0531 & 6342.5497 & 24141.2523 & 155.3746 \tabularnewline
80 & 0.0707 & -0.0467 & 0.0523 & 14286.0938 & 22909.3575 & 151.3584 \tabularnewline
81 & 0.0627 & -0.0585 & 0.053 & 28453.4027 & 23525.3625 & 153.3798 \tabularnewline
82 & 0.0597 & -0.0527 & 0.0529 & 25504.0487 & 23723.2311 & 154.0235 \tabularnewline
83 & 0.0686 & -0.1809 & 0.0646 & 226796.6047 & 42184.4469 & 205.3885 \tabularnewline
84 & 0.0735 & -0.372 & 0.0902 & 833451.6734 & 108123.3825 & 328.8212 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159473&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]73[/C][C]0.0673[/C][C]-0.0971[/C][C]0[/C][C]43745.4089[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]74[/C][C]0.0796[/C][C]-0.1345[/C][C]0.1158[/C][C]81363.1891[/C][C]62554.299[/C][C]250.1086[/C][/ROW]
[ROW][C]75[/C][C]0.0757[/C][C]-0.0169[/C][C]0.0829[/C][C]1561.6119[/C][C]42223.4033[/C][C]205.4833[/C][/ROW]
[ROW][C]76[/C][C]0.0709[/C][C]0.0178[/C][C]0.0666[/C][C]2019.9677[/C][C]32172.5444[/C][C]179.3671[/C][/ROW]
[ROW][C]77[/C][C]0.0636[/C][C]-0.0643[/C][C]0.0661[/C][C]33221.2946[/C][C]32382.2944[/C][C]179.9508[/C][/ROW]
[ROW][C]78[/C][C]0.0617[/C][C]-0.0093[/C][C]0.0566[/C][C]734.7443[/C][C]27107.7028[/C][C]164.6442[/C][/ROW]
[ROW][C]79[/C][C]0.0718[/C][C]-0.0316[/C][C]0.0531[/C][C]6342.5497[/C][C]24141.2523[/C][C]155.3746[/C][/ROW]
[ROW][C]80[/C][C]0.0707[/C][C]-0.0467[/C][C]0.0523[/C][C]14286.0938[/C][C]22909.3575[/C][C]151.3584[/C][/ROW]
[ROW][C]81[/C][C]0.0627[/C][C]-0.0585[/C][C]0.053[/C][C]28453.4027[/C][C]23525.3625[/C][C]153.3798[/C][/ROW]
[ROW][C]82[/C][C]0.0597[/C][C]-0.0527[/C][C]0.0529[/C][C]25504.0487[/C][C]23723.2311[/C][C]154.0235[/C][/ROW]
[ROW][C]83[/C][C]0.0686[/C][C]-0.1809[/C][C]0.0646[/C][C]226796.6047[/C][C]42184.4469[/C][C]205.3885[/C][/ROW]
[ROW][C]84[/C][C]0.0735[/C][C]-0.372[/C][C]0.0902[/C][C]833451.6734[/C][C]108123.3825[/C][C]328.8212[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159473&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159473&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
730.0673-0.0971043745.408900
740.0796-0.13450.115881363.189162554.299250.1086
750.0757-0.01690.08291561.611942223.4033205.4833
760.07090.01780.06662019.967732172.5444179.3671
770.0636-0.06430.066133221.294632382.2944179.9508
780.0617-0.00930.0566734.744327107.7028164.6442
790.0718-0.03160.05316342.549724141.2523155.3746
800.0707-0.04670.052314286.093822909.3575151.3584
810.0627-0.05850.05328453.402723525.3625153.3798
820.0597-0.05270.052925504.048723723.2311154.0235
830.0686-0.18090.0646226796.604742184.4469205.3885
840.0735-0.3720.0902833451.6734108123.3825328.8212



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