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, 11 Dec 2008 07:19:43 -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/11/t12290053449j99l0igwh4xzqs.htm/, Retrieved Sun, 19 May 2024 07:46:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=32255, Retrieved Sun, 19 May 2024 07:46:45 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact181
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [Autocorrelatie] [2008-12-11 12:13:13] [9f5bfe3b95f9ec3d2ed4c0a560a9648a]
- RMP     [ARIMA Forecasting] [ARIMA forecasting] [2008-12-11 14:19:43] [a9e6d7cd6e144e8b311d9f96a24c5a25] [Current]
-   PD      [ARIMA Forecasting] [ARIMA forecasting] [2008-12-20 16:07:36] [9f5bfe3b95f9ec3d2ed4c0a560a9648a]
Feedback Forum

Post a new message
Dataseries X:
2648,9
2669,6
3042,3
2604,2
2732,1
2621,7
2483,7
2479,3
2684,6
2834,7
2566,1
2251,2
2350
2299,8
2542,8
2530,2
2508,1
2616,8
2534,1
2181,8
2578,9
2841,9
2529,9
2103,2
2326,2
2452,6
2782,1
2727,3
2648,2
2760,7
2613
2225,4
2713,9
2923,3
2707
2473,9
2521
2531,8
3068,8
2826,9
2674,2
2966,6
2798,8
2629,6
3124,6
3115,7
3083
2863,9
2728,7
2789,4
3225,7
3148,2
2836,5
3153,5
2656,9
2834,7
3172,5
2998,8
3103,1
2735,6
2818,1
2874,4
3438,5
2949,1
3306,8
3530
3003,8
3206,4
3514,6
3522,6
3525,5
2996,2
3231,1
3030
3541,7
3113,2
3390,8
3424,2
3079,8
3123,4
3317,1
3579,9
3317,9
2668,1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 4 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32255&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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32255&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32255&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 time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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])
602735.6-------
612818.1-------
622874.4-------
633438.5-------
642949.1-------
653306.8-------
663530-------
673003.8-------
683206.4-------
693514.6-------
703522.6-------
713525.5-------
722996.2-------
733231.13172.23492872.04373503.80260.36390.8510.98180.851
7430303223.95142890.223596.21850.15360.4850.96710.8848
753541.73802.22963377.95044279.79940.14250.99920.93230.9995
763113.23317.3652922.53883765.53110.1860.16330.94640.9199
773390.83625.12983168.6184147.41250.18960.97260.88390.9909
783424.23777.92743277.69584354.50280.11460.90590.80030.9961
793079.83399.23032928.36613945.80670.1260.46430.92190.9258
803123.43375.43922888.31093944.72410.19280.84560.71970.9042
813317.13789.86533222.01894457.78870.08270.97480.79040.9901
823579.93929.26533319.81624650.59660.17120.95190.86540.9944
833317.93768.99663165.35954487.74780.10930.6970.74670.9825
842668.13259.8612721.93423904.09650.03590.42990.78880.7888

\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 & 2735.6 & - & - & - & - & - & - & - \tabularnewline
61 & 2818.1 & - & - & - & - & - & - & - \tabularnewline
62 & 2874.4 & - & - & - & - & - & - & - \tabularnewline
63 & 3438.5 & - & - & - & - & - & - & - \tabularnewline
64 & 2949.1 & - & - & - & - & - & - & - \tabularnewline
65 & 3306.8 & - & - & - & - & - & - & - \tabularnewline
66 & 3530 & - & - & - & - & - & - & - \tabularnewline
67 & 3003.8 & - & - & - & - & - & - & - \tabularnewline
68 & 3206.4 & - & - & - & - & - & - & - \tabularnewline
69 & 3514.6 & - & - & - & - & - & - & - \tabularnewline
70 & 3522.6 & - & - & - & - & - & - & - \tabularnewline
71 & 3525.5 & - & - & - & - & - & - & - \tabularnewline
72 & 2996.2 & - & - & - & - & - & - & - \tabularnewline
73 & 3231.1 & 3172.2349 & 2872.0437 & 3503.8026 & 0.3639 & 0.851 & 0.9818 & 0.851 \tabularnewline
74 & 3030 & 3223.9514 & 2890.22 & 3596.2185 & 0.1536 & 0.485 & 0.9671 & 0.8848 \tabularnewline
75 & 3541.7 & 3802.2296 & 3377.9504 & 4279.7994 & 0.1425 & 0.9992 & 0.9323 & 0.9995 \tabularnewline
76 & 3113.2 & 3317.365 & 2922.5388 & 3765.5311 & 0.186 & 0.1633 & 0.9464 & 0.9199 \tabularnewline
77 & 3390.8 & 3625.1298 & 3168.618 & 4147.4125 & 0.1896 & 0.9726 & 0.8839 & 0.9909 \tabularnewline
78 & 3424.2 & 3777.9274 & 3277.6958 & 4354.5028 & 0.1146 & 0.9059 & 0.8003 & 0.9961 \tabularnewline
79 & 3079.8 & 3399.2303 & 2928.3661 & 3945.8067 & 0.126 & 0.4643 & 0.9219 & 0.9258 \tabularnewline
80 & 3123.4 & 3375.4392 & 2888.3109 & 3944.7241 & 0.1928 & 0.8456 & 0.7197 & 0.9042 \tabularnewline
81 & 3317.1 & 3789.8653 & 3222.0189 & 4457.7887 & 0.0827 & 0.9748 & 0.7904 & 0.9901 \tabularnewline
82 & 3579.9 & 3929.2653 & 3319.8162 & 4650.5966 & 0.1712 & 0.9519 & 0.8654 & 0.9944 \tabularnewline
83 & 3317.9 & 3768.9966 & 3165.3595 & 4487.7478 & 0.1093 & 0.697 & 0.7467 & 0.9825 \tabularnewline
84 & 2668.1 & 3259.861 & 2721.9342 & 3904.0965 & 0.0359 & 0.4299 & 0.7888 & 0.7888 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32255&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]2735.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]2818.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]2874.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]3438.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]2949.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]3306.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]3530[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]3003.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]3206.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]3514.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]3522.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]3525.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]2996.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]3231.1[/C][C]3172.2349[/C][C]2872.0437[/C][C]3503.8026[/C][C]0.3639[/C][C]0.851[/C][C]0.9818[/C][C]0.851[/C][/ROW]
[ROW][C]74[/C][C]3030[/C][C]3223.9514[/C][C]2890.22[/C][C]3596.2185[/C][C]0.1536[/C][C]0.485[/C][C]0.9671[/C][C]0.8848[/C][/ROW]
[ROW][C]75[/C][C]3541.7[/C][C]3802.2296[/C][C]3377.9504[/C][C]4279.7994[/C][C]0.1425[/C][C]0.9992[/C][C]0.9323[/C][C]0.9995[/C][/ROW]
[ROW][C]76[/C][C]3113.2[/C][C]3317.365[/C][C]2922.5388[/C][C]3765.5311[/C][C]0.186[/C][C]0.1633[/C][C]0.9464[/C][C]0.9199[/C][/ROW]
[ROW][C]77[/C][C]3390.8[/C][C]3625.1298[/C][C]3168.618[/C][C]4147.4125[/C][C]0.1896[/C][C]0.9726[/C][C]0.8839[/C][C]0.9909[/C][/ROW]
[ROW][C]78[/C][C]3424.2[/C][C]3777.9274[/C][C]3277.6958[/C][C]4354.5028[/C][C]0.1146[/C][C]0.9059[/C][C]0.8003[/C][C]0.9961[/C][/ROW]
[ROW][C]79[/C][C]3079.8[/C][C]3399.2303[/C][C]2928.3661[/C][C]3945.8067[/C][C]0.126[/C][C]0.4643[/C][C]0.9219[/C][C]0.9258[/C][/ROW]
[ROW][C]80[/C][C]3123.4[/C][C]3375.4392[/C][C]2888.3109[/C][C]3944.7241[/C][C]0.1928[/C][C]0.8456[/C][C]0.7197[/C][C]0.9042[/C][/ROW]
[ROW][C]81[/C][C]3317.1[/C][C]3789.8653[/C][C]3222.0189[/C][C]4457.7887[/C][C]0.0827[/C][C]0.9748[/C][C]0.7904[/C][C]0.9901[/C][/ROW]
[ROW][C]82[/C][C]3579.9[/C][C]3929.2653[/C][C]3319.8162[/C][C]4650.5966[/C][C]0.1712[/C][C]0.9519[/C][C]0.8654[/C][C]0.9944[/C][/ROW]
[ROW][C]83[/C][C]3317.9[/C][C]3768.9966[/C][C]3165.3595[/C][C]4487.7478[/C][C]0.1093[/C][C]0.697[/C][C]0.7467[/C][C]0.9825[/C][/ROW]
[ROW][C]84[/C][C]2668.1[/C][C]3259.861[/C][C]2721.9342[/C][C]3904.0965[/C][C]0.0359[/C][C]0.4299[/C][C]0.7888[/C][C]0.7888[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32255&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32255&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])
602735.6-------
612818.1-------
622874.4-------
633438.5-------
642949.1-------
653306.8-------
663530-------
673003.8-------
683206.4-------
693514.6-------
703522.6-------
713525.5-------
722996.2-------
733231.13172.23492872.04373503.80260.36390.8510.98180.851
7430303223.95142890.223596.21850.15360.4850.96710.8848
753541.73802.22963377.95044279.79940.14250.99920.93230.9995
763113.23317.3652922.53883765.53110.1860.16330.94640.9199
773390.83625.12983168.6184147.41250.18960.97260.88390.9909
783424.23777.92743277.69584354.50280.11460.90590.80030.9961
793079.83399.23032928.36613945.80670.1260.46430.92190.9258
803123.43375.43922888.31093944.72410.19280.84560.71970.9042
813317.13789.86533222.01894457.78870.08270.97480.79040.9901
823579.93929.26533319.81624650.59660.17120.95190.86540.9944
833317.93768.99663165.35954487.74780.10930.6970.74670.9825
842668.13259.8612721.93423904.09650.03590.42990.78880.7888







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
730.05330.01860.00153465.0999288.758316.9929
740.0589-0.06020.00537617.14223134.761955.9889
750.0641-0.06850.005767875.68835656.307475.2084
760.0689-0.06150.005141683.3593473.613258.9374
770.0735-0.06460.005454910.4484575.870767.6452
780.0779-0.09360.0078125123.102210426.9252102.1123
790.082-0.0940.0078102035.72328502.976992.2116
800.086-0.07470.006263523.74865293.645772.7574
810.0899-0.12470.0104223507.065618625.5888136.4756
820.0937-0.08890.0074122056.130610171.3442100.8531
830.0973-0.11970.01203488.131516957.3443130.2204
840.1008-0.18150.0151350181.081629181.7568170.8267

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
73 & 0.0533 & 0.0186 & 0.0015 & 3465.0999 & 288.7583 & 16.9929 \tabularnewline
74 & 0.0589 & -0.0602 & 0.005 & 37617.1422 & 3134.7619 & 55.9889 \tabularnewline
75 & 0.0641 & -0.0685 & 0.0057 & 67875.6883 & 5656.3074 & 75.2084 \tabularnewline
76 & 0.0689 & -0.0615 & 0.0051 & 41683.359 & 3473.6132 & 58.9374 \tabularnewline
77 & 0.0735 & -0.0646 & 0.0054 & 54910.448 & 4575.8707 & 67.6452 \tabularnewline
78 & 0.0779 & -0.0936 & 0.0078 & 125123.1022 & 10426.9252 & 102.1123 \tabularnewline
79 & 0.082 & -0.094 & 0.0078 & 102035.7232 & 8502.9769 & 92.2116 \tabularnewline
80 & 0.086 & -0.0747 & 0.0062 & 63523.7486 & 5293.6457 & 72.7574 \tabularnewline
81 & 0.0899 & -0.1247 & 0.0104 & 223507.0656 & 18625.5888 & 136.4756 \tabularnewline
82 & 0.0937 & -0.0889 & 0.0074 & 122056.1306 & 10171.3442 & 100.8531 \tabularnewline
83 & 0.0973 & -0.1197 & 0.01 & 203488.1315 & 16957.3443 & 130.2204 \tabularnewline
84 & 0.1008 & -0.1815 & 0.0151 & 350181.0816 & 29181.7568 & 170.8267 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32255&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.0533[/C][C]0.0186[/C][C]0.0015[/C][C]3465.0999[/C][C]288.7583[/C][C]16.9929[/C][/ROW]
[ROW][C]74[/C][C]0.0589[/C][C]-0.0602[/C][C]0.005[/C][C]37617.1422[/C][C]3134.7619[/C][C]55.9889[/C][/ROW]
[ROW][C]75[/C][C]0.0641[/C][C]-0.0685[/C][C]0.0057[/C][C]67875.6883[/C][C]5656.3074[/C][C]75.2084[/C][/ROW]
[ROW][C]76[/C][C]0.0689[/C][C]-0.0615[/C][C]0.0051[/C][C]41683.359[/C][C]3473.6132[/C][C]58.9374[/C][/ROW]
[ROW][C]77[/C][C]0.0735[/C][C]-0.0646[/C][C]0.0054[/C][C]54910.448[/C][C]4575.8707[/C][C]67.6452[/C][/ROW]
[ROW][C]78[/C][C]0.0779[/C][C]-0.0936[/C][C]0.0078[/C][C]125123.1022[/C][C]10426.9252[/C][C]102.1123[/C][/ROW]
[ROW][C]79[/C][C]0.082[/C][C]-0.094[/C][C]0.0078[/C][C]102035.7232[/C][C]8502.9769[/C][C]92.2116[/C][/ROW]
[ROW][C]80[/C][C]0.086[/C][C]-0.0747[/C][C]0.0062[/C][C]63523.7486[/C][C]5293.6457[/C][C]72.7574[/C][/ROW]
[ROW][C]81[/C][C]0.0899[/C][C]-0.1247[/C][C]0.0104[/C][C]223507.0656[/C][C]18625.5888[/C][C]136.4756[/C][/ROW]
[ROW][C]82[/C][C]0.0937[/C][C]-0.0889[/C][C]0.0074[/C][C]122056.1306[/C][C]10171.3442[/C][C]100.8531[/C][/ROW]
[ROW][C]83[/C][C]0.0973[/C][C]-0.1197[/C][C]0.01[/C][C]203488.1315[/C][C]16957.3443[/C][C]130.2204[/C][/ROW]
[ROW][C]84[/C][C]0.1008[/C][C]-0.1815[/C][C]0.0151[/C][C]350181.0816[/C][C]29181.7568[/C][C]170.8267[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32255&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32255&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.05330.01860.00153465.0999288.758316.9929
740.0589-0.06020.00537617.14223134.761955.9889
750.0641-0.06850.005767875.68835656.307475.2084
760.0689-0.06150.005141683.3593473.613258.9374
770.0735-0.06460.005454910.4484575.870767.6452
780.0779-0.09360.0078125123.102210426.9252102.1123
790.082-0.0940.0078102035.72328502.976992.2116
800.086-0.07470.006263523.74865293.645772.7574
810.0899-0.12470.0104223507.065618625.5888136.4756
820.0937-0.08890.0074122056.130610171.3442100.8531
830.0973-0.11970.01203488.131516957.3443130.2204
840.1008-0.18150.0151350181.081629181.7568170.8267



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