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 computationTue, 28 Dec 2010 10:00:01 +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/28/t1293530264kzwy4d947patbmx.htm/, Retrieved Sun, 05 May 2024 03:45:50 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=116256, Retrieved Sun, 05 May 2024 03:45:50 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact143
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Variance Reduction Matrix] [] [2010-12-24 15:11:40] [afd301b68d203992295e6972aed62880]
- RMPD    [ARIMA Forecasting] [] [2010-12-28 10:00:01] [5a59313293e5c9f616ad36f6edd018c5] [Current]
-    D      [ARIMA Forecasting] [] [2010-12-29 13:35:03] [1253bc7c4737195066123d9caa6dfc18]
-    D      [ARIMA Forecasting] [] [2010-12-29 13:37:58] [1253bc7c4737195066123d9caa6dfc18]
-    D      [ARIMA Forecasting] [] [2010-12-29 13:39:48] [1253bc7c4737195066123d9caa6dfc18]
-    D      [ARIMA Forecasting] [] [2010-12-29 13:41:22] [1253bc7c4737195066123d9caa6dfc18]
Feedback Forum

Post a new message
Dataseries X:
547.344		
554.788	
562.325	
560.854	
555.332	
543.599	
536.662	
542.722	
593.530	
610.763	
612.613	
611.324	
594.167	
595.454	
590.865	
589.379	
584.428	
573.100	
567.456	
569.028	
620.735	
628.884	
628.232	
612.117	
595.404	
597.141	
593.408	
590.072	
579.799	
574.205	
572.775	
572.942	
619.567	
625.809	
619.916	
587.625	
565.742	
557.274	
560.576	
548.854	
531.673	
525.919	
511.038	
498.662	
555.362	
564.591	
541.657	
527.070	
509.846	
514.258	
516.922	
507.561	
492.622	
490.243	
469.357	
477.580	
528.379	
533.590	
517.945	
506.174	
501.866	
516.141	
528.222	
532.638	
536.322		
536.535		
523.597		
536.214		
586.570		
596.594		
580.523		
564.478		
557.560		
575.093		
580.112		
574.761		
563.250		
551.531		
537.034		
544.686		
600.991		
604.378		
586.111		
563.668		
548.604		




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 & 2 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116256&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]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116256&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116256&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'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[73])
61501.866-------
62516.141-------
63528.222-------
64532.638-------
65536.322-------
66536.535-------
67523.597-------
68536.214-------
69586.57-------
70596.594-------
71580.523-------
72564.478-------
73557.56-------
74575.093568.9892554.3157583.66270.20740.936610.9366
75580.112579.1268556.4849601.76860.4660.636510.969
76574.761580.2489550.3116610.18620.35970.50360.99910.9313
77563.25578.9056541.9195615.89160.20340.58690.9880.871
78551.531578.8406534.9325622.74880.11140.75680.97050.8289
79537.034565.3046514.5614616.04770.13740.70260.94640.6176
80544.686575.5068518.0044633.00920.14670.90510.90980.7296
81600.991627.1382562.9517691.32470.21230.99410.89230.9832
82604.378636.6617565.8695707.45390.18570.83830.86640.9857
83586.111621.2811543.9663698.59590.18630.66590.84930.9469
84563.668606.5387522.7889690.28840.15790.68370.83750.8742
85548.604599.478509.3849689.57110.13420.7820.81910.8191

\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[73]) \tabularnewline
61 & 501.866 & - & - & - & - & - & - & - \tabularnewline
62 & 516.141 & - & - & - & - & - & - & - \tabularnewline
63 & 528.222 & - & - & - & - & - & - & - \tabularnewline
64 & 532.638 & - & - & - & - & - & - & - \tabularnewline
65 & 536.322 & - & - & - & - & - & - & - \tabularnewline
66 & 536.535 & - & - & - & - & - & - & - \tabularnewline
67 & 523.597 & - & - & - & - & - & - & - \tabularnewline
68 & 536.214 & - & - & - & - & - & - & - \tabularnewline
69 & 586.57 & - & - & - & - & - & - & - \tabularnewline
70 & 596.594 & - & - & - & - & - & - & - \tabularnewline
71 & 580.523 & - & - & - & - & - & - & - \tabularnewline
72 & 564.478 & - & - & - & - & - & - & - \tabularnewline
73 & 557.56 & - & - & - & - & - & - & - \tabularnewline
74 & 575.093 & 568.9892 & 554.3157 & 583.6627 & 0.2074 & 0.9366 & 1 & 0.9366 \tabularnewline
75 & 580.112 & 579.1268 & 556.4849 & 601.7686 & 0.466 & 0.6365 & 1 & 0.969 \tabularnewline
76 & 574.761 & 580.2489 & 550.3116 & 610.1862 & 0.3597 & 0.5036 & 0.9991 & 0.9313 \tabularnewline
77 & 563.25 & 578.9056 & 541.9195 & 615.8916 & 0.2034 & 0.5869 & 0.988 & 0.871 \tabularnewline
78 & 551.531 & 578.8406 & 534.9325 & 622.7488 & 0.1114 & 0.7568 & 0.9705 & 0.8289 \tabularnewline
79 & 537.034 & 565.3046 & 514.5614 & 616.0477 & 0.1374 & 0.7026 & 0.9464 & 0.6176 \tabularnewline
80 & 544.686 & 575.5068 & 518.0044 & 633.0092 & 0.1467 & 0.9051 & 0.9098 & 0.7296 \tabularnewline
81 & 600.991 & 627.1382 & 562.9517 & 691.3247 & 0.2123 & 0.9941 & 0.8923 & 0.9832 \tabularnewline
82 & 604.378 & 636.6617 & 565.8695 & 707.4539 & 0.1857 & 0.8383 & 0.8664 & 0.9857 \tabularnewline
83 & 586.111 & 621.2811 & 543.9663 & 698.5959 & 0.1863 & 0.6659 & 0.8493 & 0.9469 \tabularnewline
84 & 563.668 & 606.5387 & 522.7889 & 690.2884 & 0.1579 & 0.6837 & 0.8375 & 0.8742 \tabularnewline
85 & 548.604 & 599.478 & 509.3849 & 689.5711 & 0.1342 & 0.782 & 0.8191 & 0.8191 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116256&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[73])[/C][/ROW]
[ROW][C]61[/C][C]501.866[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]516.141[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]528.222[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]532.638[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]536.322[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]536.535[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]523.597[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]536.214[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]586.57[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]596.594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]580.523[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]564.478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]557.56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]575.093[/C][C]568.9892[/C][C]554.3157[/C][C]583.6627[/C][C]0.2074[/C][C]0.9366[/C][C]1[/C][C]0.9366[/C][/ROW]
[ROW][C]75[/C][C]580.112[/C][C]579.1268[/C][C]556.4849[/C][C]601.7686[/C][C]0.466[/C][C]0.6365[/C][C]1[/C][C]0.969[/C][/ROW]
[ROW][C]76[/C][C]574.761[/C][C]580.2489[/C][C]550.3116[/C][C]610.1862[/C][C]0.3597[/C][C]0.5036[/C][C]0.9991[/C][C]0.9313[/C][/ROW]
[ROW][C]77[/C][C]563.25[/C][C]578.9056[/C][C]541.9195[/C][C]615.8916[/C][C]0.2034[/C][C]0.5869[/C][C]0.988[/C][C]0.871[/C][/ROW]
[ROW][C]78[/C][C]551.531[/C][C]578.8406[/C][C]534.9325[/C][C]622.7488[/C][C]0.1114[/C][C]0.7568[/C][C]0.9705[/C][C]0.8289[/C][/ROW]
[ROW][C]79[/C][C]537.034[/C][C]565.3046[/C][C]514.5614[/C][C]616.0477[/C][C]0.1374[/C][C]0.7026[/C][C]0.9464[/C][C]0.6176[/C][/ROW]
[ROW][C]80[/C][C]544.686[/C][C]575.5068[/C][C]518.0044[/C][C]633.0092[/C][C]0.1467[/C][C]0.9051[/C][C]0.9098[/C][C]0.7296[/C][/ROW]
[ROW][C]81[/C][C]600.991[/C][C]627.1382[/C][C]562.9517[/C][C]691.3247[/C][C]0.2123[/C][C]0.9941[/C][C]0.8923[/C][C]0.9832[/C][/ROW]
[ROW][C]82[/C][C]604.378[/C][C]636.6617[/C][C]565.8695[/C][C]707.4539[/C][C]0.1857[/C][C]0.8383[/C][C]0.8664[/C][C]0.9857[/C][/ROW]
[ROW][C]83[/C][C]586.111[/C][C]621.2811[/C][C]543.9663[/C][C]698.5959[/C][C]0.1863[/C][C]0.6659[/C][C]0.8493[/C][C]0.9469[/C][/ROW]
[ROW][C]84[/C][C]563.668[/C][C]606.5387[/C][C]522.7889[/C][C]690.2884[/C][C]0.1579[/C][C]0.6837[/C][C]0.8375[/C][C]0.8742[/C][/ROW]
[ROW][C]85[/C][C]548.604[/C][C]599.478[/C][C]509.3849[/C][C]689.5711[/C][C]0.1342[/C][C]0.782[/C][C]0.8191[/C][C]0.8191[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116256&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116256&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[73])
61501.866-------
62516.141-------
63528.222-------
64532.638-------
65536.322-------
66536.535-------
67523.597-------
68536.214-------
69586.57-------
70596.594-------
71580.523-------
72564.478-------
73557.56-------
74575.093568.9892554.3157583.66270.20740.936610.9366
75580.112579.1268556.4849601.76860.4660.636510.969
76574.761580.2489550.3116610.18620.35970.50360.99910.9313
77563.25578.9056541.9195615.89160.20340.58690.9880.871
78551.531578.8406534.9325622.74880.11140.75680.97050.8289
79537.034565.3046514.5614616.04770.13740.70260.94640.6176
80544.686575.5068518.0044633.00920.14670.90510.90980.7296
81600.991627.1382562.9517691.32470.21230.99410.89230.9832
82604.378636.6617565.8695707.45390.18570.83830.86640.9857
83586.111621.2811543.9663698.59590.18630.66590.84930.9469
84563.668606.5387522.7889690.28840.15790.68370.83750.8742
85548.604599.478509.3849689.57110.13420.7820.81910.8191







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
740.01320.0107037.256300
750.01990.00170.00620.970719.11354.3719
760.0263-0.00950.007330.11722.78134.773
770.0326-0.0270.0122245.09778.36028.8521
780.0387-0.04720.0192745.8169211.851514.5551
790.0458-0.050.0244799.2247309.747117.5996
800.051-0.05360.0285949.9203401.200420.03
810.0522-0.04170.0302683.6762436.509920.8928
820.0567-0.05070.03251042.2375503.812922.4458
830.0635-0.05660.03491236.936577.125224.0234
840.0704-0.07070.03811837.8963691.740826.301
850.0767-0.08490.0422588.1605849.775829.1509

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
74 & 0.0132 & 0.0107 & 0 & 37.2563 & 0 & 0 \tabularnewline
75 & 0.0199 & 0.0017 & 0.0062 & 0.9707 & 19.1135 & 4.3719 \tabularnewline
76 & 0.0263 & -0.0095 & 0.0073 & 30.117 & 22.7813 & 4.773 \tabularnewline
77 & 0.0326 & -0.027 & 0.0122 & 245.097 & 78.3602 & 8.8521 \tabularnewline
78 & 0.0387 & -0.0472 & 0.0192 & 745.8169 & 211.8515 & 14.5551 \tabularnewline
79 & 0.0458 & -0.05 & 0.0244 & 799.2247 & 309.7471 & 17.5996 \tabularnewline
80 & 0.051 & -0.0536 & 0.0285 & 949.9203 & 401.2004 & 20.03 \tabularnewline
81 & 0.0522 & -0.0417 & 0.0302 & 683.6762 & 436.5099 & 20.8928 \tabularnewline
82 & 0.0567 & -0.0507 & 0.0325 & 1042.2375 & 503.8129 & 22.4458 \tabularnewline
83 & 0.0635 & -0.0566 & 0.0349 & 1236.936 & 577.1252 & 24.0234 \tabularnewline
84 & 0.0704 & -0.0707 & 0.0381 & 1837.8963 & 691.7408 & 26.301 \tabularnewline
85 & 0.0767 & -0.0849 & 0.042 & 2588.1605 & 849.7758 & 29.1509 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116256&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]74[/C][C]0.0132[/C][C]0.0107[/C][C]0[/C][C]37.2563[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]75[/C][C]0.0199[/C][C]0.0017[/C][C]0.0062[/C][C]0.9707[/C][C]19.1135[/C][C]4.3719[/C][/ROW]
[ROW][C]76[/C][C]0.0263[/C][C]-0.0095[/C][C]0.0073[/C][C]30.117[/C][C]22.7813[/C][C]4.773[/C][/ROW]
[ROW][C]77[/C][C]0.0326[/C][C]-0.027[/C][C]0.0122[/C][C]245.097[/C][C]78.3602[/C][C]8.8521[/C][/ROW]
[ROW][C]78[/C][C]0.0387[/C][C]-0.0472[/C][C]0.0192[/C][C]745.8169[/C][C]211.8515[/C][C]14.5551[/C][/ROW]
[ROW][C]79[/C][C]0.0458[/C][C]-0.05[/C][C]0.0244[/C][C]799.2247[/C][C]309.7471[/C][C]17.5996[/C][/ROW]
[ROW][C]80[/C][C]0.051[/C][C]-0.0536[/C][C]0.0285[/C][C]949.9203[/C][C]401.2004[/C][C]20.03[/C][/ROW]
[ROW][C]81[/C][C]0.0522[/C][C]-0.0417[/C][C]0.0302[/C][C]683.6762[/C][C]436.5099[/C][C]20.8928[/C][/ROW]
[ROW][C]82[/C][C]0.0567[/C][C]-0.0507[/C][C]0.0325[/C][C]1042.2375[/C][C]503.8129[/C][C]22.4458[/C][/ROW]
[ROW][C]83[/C][C]0.0635[/C][C]-0.0566[/C][C]0.0349[/C][C]1236.936[/C][C]577.1252[/C][C]24.0234[/C][/ROW]
[ROW][C]84[/C][C]0.0704[/C][C]-0.0707[/C][C]0.0381[/C][C]1837.8963[/C][C]691.7408[/C][C]26.301[/C][/ROW]
[ROW][C]85[/C][C]0.0767[/C][C]-0.0849[/C][C]0.042[/C][C]2588.1605[/C][C]849.7758[/C][C]29.1509[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116256&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116256&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
740.01320.0107037.256300
750.01990.00170.00620.970719.11354.3719
760.0263-0.00950.007330.11722.78134.773
770.0326-0.0270.0122245.09778.36028.8521
780.0387-0.04720.0192745.8169211.851514.5551
790.0458-0.050.0244799.2247309.747117.5996
800.051-0.05360.0285949.9203401.200420.03
810.0522-0.04170.0302683.6762436.509920.8928
820.0567-0.05070.03251042.2375503.812922.4458
830.0635-0.05660.03491236.936577.125224.0234
840.0704-0.07070.03811837.8963691.740826.301
850.0767-0.08490.0422588.1605849.775829.1509



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