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 computationMon, 05 Dec 2011 13:29:58 -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/05/t1323109825v22iqa8oo6exte9.htm/, Retrieved Fri, 03 May 2024 13:48:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151150, Retrieved Fri, 03 May 2024 13:48:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact112
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Aantal niet-werke...] [2011-12-05 18:29:58] [4352eab26b4a512b718de67a19830b91] [Current]
Feedback Forum

Post a new message
Dataseries X:
547612
563280
581302
572273
518654
520579
530577
540324
547970
555654
551174
548604
563668
586111
604378
600991
544686
537034
551531
563250
574761
580112
575093
557560
564478
580523
596594
586570
536214
523597
536535
536322
532638
528222
516141
501866
506174
517945
533590
528379
477580
469357
490243
492622
507561
516922
514258
509846
527070
541657
564591
555362
498662
511038
525919
531673
548854
560576
557274
565742
587625
619916
625809
619567
572942
572775
574205
579799
590072
593408
597141
595404
612117
628232
628884
620735
569028
567456
573100
584428
589379
590865
595454
594167
611324
612613
610763
593530
542722
536662
543599
555332
560854
562325
554788
547344
565464
577992
579714
569323
506971
500857
509127
509933
517009
519164
512238
509239
518585
522975
525192
516847
455626
454724
461251
470439
474605
476049
471067
470984
502831
512927
509673
484015
431328
436087
442867
447988
460070
467037
460170
464196
485025




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ jenkins.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 & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151150&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' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151150&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151150&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' @ jenkins.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[121])
109518585-------
110522975-------
111525192-------
112516847-------
113455626-------
114454724-------
115461251-------
116470439-------
117474605-------
118476049-------
119471067-------
120470984-------
121502831-------
122512927548118.5372467234.1843629002.890.19690.86380.72880.8638
123509673548118.5372467234.1843629002.890.17580.80310.71070.8638
124484015548118.5372467234.1843629002.890.06020.82420.77570.8638
125431328548118.5372467234.1843629002.890.00230.93980.98750.8638
126436087548118.5372467234.1843629002.890.00330.99770.98820.8638
127442867548118.5372467234.1843629002.890.00540.99670.98240.8638
128447988548118.5372467234.1843629002.890.00760.99460.97010.8638
129460070548118.5372467234.1843629002.890.01640.99240.96260.8638
130467037548118.5372467234.1843629002.890.02470.98360.95960.8638
131460170548118.5372467234.1843629002.890.01650.97530.96910.8638
132464196548118.5372467234.1843629002.890.0210.98350.96920.8638
133485025548118.5372467234.1843629002.890.06310.9790.86380.8638

\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[121]) \tabularnewline
109 & 518585 & - & - & - & - & - & - & - \tabularnewline
110 & 522975 & - & - & - & - & - & - & - \tabularnewline
111 & 525192 & - & - & - & - & - & - & - \tabularnewline
112 & 516847 & - & - & - & - & - & - & - \tabularnewline
113 & 455626 & - & - & - & - & - & - & - \tabularnewline
114 & 454724 & - & - & - & - & - & - & - \tabularnewline
115 & 461251 & - & - & - & - & - & - & - \tabularnewline
116 & 470439 & - & - & - & - & - & - & - \tabularnewline
117 & 474605 & - & - & - & - & - & - & - \tabularnewline
118 & 476049 & - & - & - & - & - & - & - \tabularnewline
119 & 471067 & - & - & - & - & - & - & - \tabularnewline
120 & 470984 & - & - & - & - & - & - & - \tabularnewline
121 & 502831 & - & - & - & - & - & - & - \tabularnewline
122 & 512927 & 548118.5372 & 467234.1843 & 629002.89 & 0.1969 & 0.8638 & 0.7288 & 0.8638 \tabularnewline
123 & 509673 & 548118.5372 & 467234.1843 & 629002.89 & 0.1758 & 0.8031 & 0.7107 & 0.8638 \tabularnewline
124 & 484015 & 548118.5372 & 467234.1843 & 629002.89 & 0.0602 & 0.8242 & 0.7757 & 0.8638 \tabularnewline
125 & 431328 & 548118.5372 & 467234.1843 & 629002.89 & 0.0023 & 0.9398 & 0.9875 & 0.8638 \tabularnewline
126 & 436087 & 548118.5372 & 467234.1843 & 629002.89 & 0.0033 & 0.9977 & 0.9882 & 0.8638 \tabularnewline
127 & 442867 & 548118.5372 & 467234.1843 & 629002.89 & 0.0054 & 0.9967 & 0.9824 & 0.8638 \tabularnewline
128 & 447988 & 548118.5372 & 467234.1843 & 629002.89 & 0.0076 & 0.9946 & 0.9701 & 0.8638 \tabularnewline
129 & 460070 & 548118.5372 & 467234.1843 & 629002.89 & 0.0164 & 0.9924 & 0.9626 & 0.8638 \tabularnewline
130 & 467037 & 548118.5372 & 467234.1843 & 629002.89 & 0.0247 & 0.9836 & 0.9596 & 0.8638 \tabularnewline
131 & 460170 & 548118.5372 & 467234.1843 & 629002.89 & 0.0165 & 0.9753 & 0.9691 & 0.8638 \tabularnewline
132 & 464196 & 548118.5372 & 467234.1843 & 629002.89 & 0.021 & 0.9835 & 0.9692 & 0.8638 \tabularnewline
133 & 485025 & 548118.5372 & 467234.1843 & 629002.89 & 0.0631 & 0.979 & 0.8638 & 0.8638 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151150&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[121])[/C][/ROW]
[ROW][C]109[/C][C]518585[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]522975[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]525192[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]516847[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]455626[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]454724[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]461251[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]470439[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]474605[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]476049[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]471067[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]470984[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]502831[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]512927[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.1969[/C][C]0.8638[/C][C]0.7288[/C][C]0.8638[/C][/ROW]
[ROW][C]123[/C][C]509673[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.1758[/C][C]0.8031[/C][C]0.7107[/C][C]0.8638[/C][/ROW]
[ROW][C]124[/C][C]484015[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0602[/C][C]0.8242[/C][C]0.7757[/C][C]0.8638[/C][/ROW]
[ROW][C]125[/C][C]431328[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0023[/C][C]0.9398[/C][C]0.9875[/C][C]0.8638[/C][/ROW]
[ROW][C]126[/C][C]436087[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0033[/C][C]0.9977[/C][C]0.9882[/C][C]0.8638[/C][/ROW]
[ROW][C]127[/C][C]442867[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0054[/C][C]0.9967[/C][C]0.9824[/C][C]0.8638[/C][/ROW]
[ROW][C]128[/C][C]447988[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0076[/C][C]0.9946[/C][C]0.9701[/C][C]0.8638[/C][/ROW]
[ROW][C]129[/C][C]460070[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0164[/C][C]0.9924[/C][C]0.9626[/C][C]0.8638[/C][/ROW]
[ROW][C]130[/C][C]467037[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0247[/C][C]0.9836[/C][C]0.9596[/C][C]0.8638[/C][/ROW]
[ROW][C]131[/C][C]460170[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0165[/C][C]0.9753[/C][C]0.9691[/C][C]0.8638[/C][/ROW]
[ROW][C]132[/C][C]464196[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.021[/C][C]0.9835[/C][C]0.9692[/C][C]0.8638[/C][/ROW]
[ROW][C]133[/C][C]485025[/C][C]548118.5372[/C][C]467234.1843[/C][C]629002.89[/C][C]0.0631[/C][C]0.979[/C][C]0.8638[/C][C]0.8638[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151150&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151150&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[121])
109518585-------
110522975-------
111525192-------
112516847-------
113455626-------
114454724-------
115461251-------
116470439-------
117474605-------
118476049-------
119471067-------
120470984-------
121502831-------
122512927548118.5372467234.1843629002.890.19690.86380.72880.8638
123509673548118.5372467234.1843629002.890.17580.80310.71070.8638
124484015548118.5372467234.1843629002.890.06020.82420.77570.8638
125431328548118.5372467234.1843629002.890.00230.93980.98750.8638
126436087548118.5372467234.1843629002.890.00330.99770.98820.8638
127442867548118.5372467234.1843629002.890.00540.99670.98240.8638
128447988548118.5372467234.1843629002.890.00760.99460.97010.8638
129460070548118.5372467234.1843629002.890.01640.99240.96260.8638
130467037548118.5372467234.1843629002.890.02470.98360.95960.8638
131460170548118.5372467234.1843629002.890.01650.97530.96910.8638
132464196548118.5372467234.1843629002.890.0210.98350.96920.8638
133485025548118.5372467234.1843629002.890.06310.9790.86380.8638







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1220.0753-0.064201238444289.80100
1230.0753-0.07010.06721478059329.8341358251809.817536854.468
1240.0753-0.1170.08384109263480.28032275255699.971847699.6405
1250.0753-0.21310.116113640029577.14815116449169.265871529.3588
1260.0753-0.20440.133812551065325.17296603372400.447281261.1371
1270.0753-0.1920.143511077886080.87537349124680.518685727.0359
1280.0753-0.18270.149110026124477.97457731553223.012387929.2512
1290.0753-0.16060.15057752544901.31347734177182.799987944.1708
1300.0753-0.14790.15026574215673.10677605292570.611887208.3286
1310.0753-0.16050.15127734945193.87537618257832.938287282.6319
1320.0753-0.15310.15147042992248.42087565960961.618486982.5325
1330.0753-0.11510.14843980794435.15637267197084.413285247.8568

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
122 & 0.0753 & -0.0642 & 0 & 1238444289.801 & 0 & 0 \tabularnewline
123 & 0.0753 & -0.0701 & 0.0672 & 1478059329.834 & 1358251809.8175 & 36854.468 \tabularnewline
124 & 0.0753 & -0.117 & 0.0838 & 4109263480.2803 & 2275255699.9718 & 47699.6405 \tabularnewline
125 & 0.0753 & -0.2131 & 0.1161 & 13640029577.1481 & 5116449169.2658 & 71529.3588 \tabularnewline
126 & 0.0753 & -0.2044 & 0.1338 & 12551065325.1729 & 6603372400.4472 & 81261.1371 \tabularnewline
127 & 0.0753 & -0.192 & 0.1435 & 11077886080.8753 & 7349124680.5186 & 85727.0359 \tabularnewline
128 & 0.0753 & -0.1827 & 0.1491 & 10026124477.9745 & 7731553223.0123 & 87929.2512 \tabularnewline
129 & 0.0753 & -0.1606 & 0.1505 & 7752544901.3134 & 7734177182.7999 & 87944.1708 \tabularnewline
130 & 0.0753 & -0.1479 & 0.1502 & 6574215673.1067 & 7605292570.6118 & 87208.3286 \tabularnewline
131 & 0.0753 & -0.1605 & 0.1512 & 7734945193.8753 & 7618257832.9382 & 87282.6319 \tabularnewline
132 & 0.0753 & -0.1531 & 0.1514 & 7042992248.4208 & 7565960961.6184 & 86982.5325 \tabularnewline
133 & 0.0753 & -0.1151 & 0.1484 & 3980794435.1563 & 7267197084.4132 & 85247.8568 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151150&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]122[/C][C]0.0753[/C][C]-0.0642[/C][C]0[/C][C]1238444289.801[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]123[/C][C]0.0753[/C][C]-0.0701[/C][C]0.0672[/C][C]1478059329.834[/C][C]1358251809.8175[/C][C]36854.468[/C][/ROW]
[ROW][C]124[/C][C]0.0753[/C][C]-0.117[/C][C]0.0838[/C][C]4109263480.2803[/C][C]2275255699.9718[/C][C]47699.6405[/C][/ROW]
[ROW][C]125[/C][C]0.0753[/C][C]-0.2131[/C][C]0.1161[/C][C]13640029577.1481[/C][C]5116449169.2658[/C][C]71529.3588[/C][/ROW]
[ROW][C]126[/C][C]0.0753[/C][C]-0.2044[/C][C]0.1338[/C][C]12551065325.1729[/C][C]6603372400.4472[/C][C]81261.1371[/C][/ROW]
[ROW][C]127[/C][C]0.0753[/C][C]-0.192[/C][C]0.1435[/C][C]11077886080.8753[/C][C]7349124680.5186[/C][C]85727.0359[/C][/ROW]
[ROW][C]128[/C][C]0.0753[/C][C]-0.1827[/C][C]0.1491[/C][C]10026124477.9745[/C][C]7731553223.0123[/C][C]87929.2512[/C][/ROW]
[ROW][C]129[/C][C]0.0753[/C][C]-0.1606[/C][C]0.1505[/C][C]7752544901.3134[/C][C]7734177182.7999[/C][C]87944.1708[/C][/ROW]
[ROW][C]130[/C][C]0.0753[/C][C]-0.1479[/C][C]0.1502[/C][C]6574215673.1067[/C][C]7605292570.6118[/C][C]87208.3286[/C][/ROW]
[ROW][C]131[/C][C]0.0753[/C][C]-0.1605[/C][C]0.1512[/C][C]7734945193.8753[/C][C]7618257832.9382[/C][C]87282.6319[/C][/ROW]
[ROW][C]132[/C][C]0.0753[/C][C]-0.1531[/C][C]0.1514[/C][C]7042992248.4208[/C][C]7565960961.6184[/C][C]86982.5325[/C][/ROW]
[ROW][C]133[/C][C]0.0753[/C][C]-0.1151[/C][C]0.1484[/C][C]3980794435.1563[/C][C]7267197084.4132[/C][C]85247.8568[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151150&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151150&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
1220.0753-0.064201238444289.80100
1230.0753-0.07010.06721478059329.8341358251809.817536854.468
1240.0753-0.1170.08384109263480.28032275255699.971847699.6405
1250.0753-0.21310.116113640029577.14815116449169.265871529.3588
1260.0753-0.20440.133812551065325.17296603372400.447281261.1371
1270.0753-0.1920.143511077886080.87537349124680.518685727.0359
1280.0753-0.18270.149110026124477.97457731553223.012387929.2512
1290.0753-0.16060.15057752544901.31347734177182.799987944.1708
1300.0753-0.14790.15026574215673.10677605292570.611887208.3286
1310.0753-0.16050.15127734945193.87537618257832.938287282.6319
1320.0753-0.15310.15147042992248.42087565960961.618486982.5325
1330.0753-0.11510.14843980794435.15637267197084.413285247.8568



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