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 2016 11:02:53 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/22/t1482401075on5cgmg59lqg9ar.htm/, Retrieved Mon, 29 Apr 2024 03:55:11 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302526, Retrieved Mon, 29 Apr 2024 03:55:11 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact100
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [forecast] [2016-12-22 10:02:53] [e7c866b75ad2fc21ab540ba3a0a42299] [Current]
Feedback Forum

Post a new message
Dataseries X:
2440
2960
3800
5440
7880
9400
9120
8720
7480
5800
4360
2120
4320
2760
4600
5520
7600
8200
8520
8680
8000
5520
4400
3320
1680
3000
4280
5280
6800
8600
8720
8440
8160
6640
3920
3920
2800
3680
3520
6120
8000
8800
9120
9560
7960
5560
5360
2320
1480
4360
5520
7560
7640
9040
9520
9720
7920
6360
3880
3040
3000
4000
5080
6880
6760
8520
9560
8800
7400
6040
4760
3480
1920
200
3920
6240
7640
8600




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302526&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302526&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302526&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[66])
549040-------
559520-------
569720-------
577920-------
586360-------
593880-------
603040-------
613000-------
624000-------
635080-------
646880-------
656760-------
668520-------
6795609117.68927657.420110577.95820.27640.78880.29460.7888
6888009243.34467782.063510704.62580.2760.33550.26130.834
6974007934.87966473.59719396.16220.23660.12290.5080.2163
7060406054.13844592.85597515.4210.49240.03550.34085e-04
7147604357.51882896.23635818.80140.29470.0120.73910
7234802950.4991489.22064411.77750.23880.00760.45220
7319202537.73381079.4283996.03960.20320.10270.26720
742003768.78592310.48015227.091800.99350.3780
7539204739.78283281.4776198.08870.135310.32370
7662406558.3375100.03128016.64280.33440.99980.33280.0042
7776407299.24785840.94198757.55360.32350.92270.76570.0504
7886008725.84017267.534310184.14590.43280.92780.6090.609

\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[66]) \tabularnewline
54 & 9040 & - & - & - & - & - & - & - \tabularnewline
55 & 9520 & - & - & - & - & - & - & - \tabularnewline
56 & 9720 & - & - & - & - & - & - & - \tabularnewline
57 & 7920 & - & - & - & - & - & - & - \tabularnewline
58 & 6360 & - & - & - & - & - & - & - \tabularnewline
59 & 3880 & - & - & - & - & - & - & - \tabularnewline
60 & 3040 & - & - & - & - & - & - & - \tabularnewline
61 & 3000 & - & - & - & - & - & - & - \tabularnewline
62 & 4000 & - & - & - & - & - & - & - \tabularnewline
63 & 5080 & - & - & - & - & - & - & - \tabularnewline
64 & 6880 & - & - & - & - & - & - & - \tabularnewline
65 & 6760 & - & - & - & - & - & - & - \tabularnewline
66 & 8520 & - & - & - & - & - & - & - \tabularnewline
67 & 9560 & 9117.6892 & 7657.4201 & 10577.9582 & 0.2764 & 0.7888 & 0.2946 & 0.7888 \tabularnewline
68 & 8800 & 9243.3446 & 7782.0635 & 10704.6258 & 0.276 & 0.3355 & 0.2613 & 0.834 \tabularnewline
69 & 7400 & 7934.8796 & 6473.5971 & 9396.1622 & 0.2366 & 0.1229 & 0.508 & 0.2163 \tabularnewline
70 & 6040 & 6054.1384 & 4592.8559 & 7515.421 & 0.4924 & 0.0355 & 0.3408 & 5e-04 \tabularnewline
71 & 4760 & 4357.5188 & 2896.2363 & 5818.8014 & 0.2947 & 0.012 & 0.7391 & 0 \tabularnewline
72 & 3480 & 2950.499 & 1489.2206 & 4411.7775 & 0.2388 & 0.0076 & 0.4522 & 0 \tabularnewline
73 & 1920 & 2537.7338 & 1079.428 & 3996.0396 & 0.2032 & 0.1027 & 0.2672 & 0 \tabularnewline
74 & 200 & 3768.7859 & 2310.4801 & 5227.0918 & 0 & 0.9935 & 0.378 & 0 \tabularnewline
75 & 3920 & 4739.7828 & 3281.477 & 6198.0887 & 0.1353 & 1 & 0.3237 & 0 \tabularnewline
76 & 6240 & 6558.337 & 5100.0312 & 8016.6428 & 0.3344 & 0.9998 & 0.3328 & 0.0042 \tabularnewline
77 & 7640 & 7299.2478 & 5840.9419 & 8757.5536 & 0.3235 & 0.9227 & 0.7657 & 0.0504 \tabularnewline
78 & 8600 & 8725.8401 & 7267.5343 & 10184.1459 & 0.4328 & 0.9278 & 0.609 & 0.609 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302526&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[66])[/C][/ROW]
[ROW][C]54[/C][C]9040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]9520[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]9720[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]7920[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]6360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]3880[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]3040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]3000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]4000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]5080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]6880[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]6760[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]8520[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]9560[/C][C]9117.6892[/C][C]7657.4201[/C][C]10577.9582[/C][C]0.2764[/C][C]0.7888[/C][C]0.2946[/C][C]0.7888[/C][/ROW]
[ROW][C]68[/C][C]8800[/C][C]9243.3446[/C][C]7782.0635[/C][C]10704.6258[/C][C]0.276[/C][C]0.3355[/C][C]0.2613[/C][C]0.834[/C][/ROW]
[ROW][C]69[/C][C]7400[/C][C]7934.8796[/C][C]6473.5971[/C][C]9396.1622[/C][C]0.2366[/C][C]0.1229[/C][C]0.508[/C][C]0.2163[/C][/ROW]
[ROW][C]70[/C][C]6040[/C][C]6054.1384[/C][C]4592.8559[/C][C]7515.421[/C][C]0.4924[/C][C]0.0355[/C][C]0.3408[/C][C]5e-04[/C][/ROW]
[ROW][C]71[/C][C]4760[/C][C]4357.5188[/C][C]2896.2363[/C][C]5818.8014[/C][C]0.2947[/C][C]0.012[/C][C]0.7391[/C][C]0[/C][/ROW]
[ROW][C]72[/C][C]3480[/C][C]2950.499[/C][C]1489.2206[/C][C]4411.7775[/C][C]0.2388[/C][C]0.0076[/C][C]0.4522[/C][C]0[/C][/ROW]
[ROW][C]73[/C][C]1920[/C][C]2537.7338[/C][C]1079.428[/C][C]3996.0396[/C][C]0.2032[/C][C]0.1027[/C][C]0.2672[/C][C]0[/C][/ROW]
[ROW][C]74[/C][C]200[/C][C]3768.7859[/C][C]2310.4801[/C][C]5227.0918[/C][C]0[/C][C]0.9935[/C][C]0.378[/C][C]0[/C][/ROW]
[ROW][C]75[/C][C]3920[/C][C]4739.7828[/C][C]3281.477[/C][C]6198.0887[/C][C]0.1353[/C][C]1[/C][C]0.3237[/C][C]0[/C][/ROW]
[ROW][C]76[/C][C]6240[/C][C]6558.337[/C][C]5100.0312[/C][C]8016.6428[/C][C]0.3344[/C][C]0.9998[/C][C]0.3328[/C][C]0.0042[/C][/ROW]
[ROW][C]77[/C][C]7640[/C][C]7299.2478[/C][C]5840.9419[/C][C]8757.5536[/C][C]0.3235[/C][C]0.9227[/C][C]0.7657[/C][C]0.0504[/C][/ROW]
[ROW][C]78[/C][C]8600[/C][C]8725.8401[/C][C]7267.5343[/C][C]10184.1459[/C][C]0.4328[/C][C]0.9278[/C][C]0.609[/C][C]0.609[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302526&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302526&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[66])
549040-------
559520-------
569720-------
577920-------
586360-------
593880-------
603040-------
613000-------
624000-------
635080-------
646880-------
656760-------
668520-------
6795609117.68927657.420110577.95820.27640.78880.29460.7888
6888009243.34467782.063510704.62580.2760.33550.26130.834
6974007934.87966473.59719396.16220.23660.12290.5080.2163
7060406054.13844592.85597515.4210.49240.03550.34085e-04
7147604357.51882896.23635818.80140.29470.0120.73910
7234802950.4991489.22064411.77750.23880.00760.45220
7319202537.73381079.4283996.03960.20320.10270.26720
742003768.78592310.48015227.091800.99350.3780
7539204739.78283281.4776198.08870.135310.32370
7662406558.3375100.03128016.64280.33440.99980.33280.0042
7776407299.24785840.94198757.55360.32350.92270.76570.0504
7886008725.84017267.534310184.14590.43280.92780.6090.609







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
670.08170.04630.04630.0474195638.8594000.2740.274
680.0807-0.05040.04830.0483196554.4466196096.653442.828-0.27460.2743
690.094-0.07230.05630.0554286096.2263226096.5108475.4961-0.33130.2933
700.1231-0.00230.04280.0422199.8954169622.3569411.8523-0.00880.2221
710.17110.08460.05120.0514161991.1076168096.1071409.99530.24930.2276
720.25270.15220.0680.0703280371.2701186808.6342432.21360.3280.2443
730.2932-0.32170.10420.0998381595.044214635.2642463.2875-0.38260.2641
740.1974-17.84392.32170.312112736233.15161779835.00011334.1046-2.21040.5074
750.157-0.20912.0870.2985672043.91861656747.10221287.1469-0.50770.5074
760.1134-0.0511.88340.2736101338.43311501206.23531225.2372-0.19720.4764
770.10190.04461.71620.2529116112.08551375288.58531172.7270.21110.4523
780.0853-0.01461.57440.23315835.73681262000.84791123.3881-0.07790.4211

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
67 & 0.0817 & 0.0463 & 0.0463 & 0.0474 & 195638.8594 & 0 & 0 & 0.274 & 0.274 \tabularnewline
68 & 0.0807 & -0.0504 & 0.0483 & 0.0483 & 196554.4466 & 196096.653 & 442.828 & -0.2746 & 0.2743 \tabularnewline
69 & 0.094 & -0.0723 & 0.0563 & 0.0554 & 286096.2263 & 226096.5108 & 475.4961 & -0.3313 & 0.2933 \tabularnewline
70 & 0.1231 & -0.0023 & 0.0428 & 0.0422 & 199.8954 & 169622.3569 & 411.8523 & -0.0088 & 0.2221 \tabularnewline
71 & 0.1711 & 0.0846 & 0.0512 & 0.0514 & 161991.1076 & 168096.1071 & 409.9953 & 0.2493 & 0.2276 \tabularnewline
72 & 0.2527 & 0.1522 & 0.068 & 0.0703 & 280371.2701 & 186808.6342 & 432.2136 & 0.328 & 0.2443 \tabularnewline
73 & 0.2932 & -0.3217 & 0.1042 & 0.0998 & 381595.044 & 214635.2642 & 463.2875 & -0.3826 & 0.2641 \tabularnewline
74 & 0.1974 & -17.8439 & 2.3217 & 0.3121 & 12736233.1516 & 1779835.0001 & 1334.1046 & -2.2104 & 0.5074 \tabularnewline
75 & 0.157 & -0.2091 & 2.087 & 0.2985 & 672043.9186 & 1656747.1022 & 1287.1469 & -0.5077 & 0.5074 \tabularnewline
76 & 0.1134 & -0.051 & 1.8834 & 0.2736 & 101338.4331 & 1501206.2353 & 1225.2372 & -0.1972 & 0.4764 \tabularnewline
77 & 0.1019 & 0.0446 & 1.7162 & 0.2529 & 116112.0855 & 1375288.5853 & 1172.727 & 0.2111 & 0.4523 \tabularnewline
78 & 0.0853 & -0.0146 & 1.5744 & 0.233 & 15835.7368 & 1262000.8479 & 1123.3881 & -0.0779 & 0.4211 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302526&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]67[/C][C]0.0817[/C][C]0.0463[/C][C]0.0463[/C][C]0.0474[/C][C]195638.8594[/C][C]0[/C][C]0[/C][C]0.274[/C][C]0.274[/C][/ROW]
[ROW][C]68[/C][C]0.0807[/C][C]-0.0504[/C][C]0.0483[/C][C]0.0483[/C][C]196554.4466[/C][C]196096.653[/C][C]442.828[/C][C]-0.2746[/C][C]0.2743[/C][/ROW]
[ROW][C]69[/C][C]0.094[/C][C]-0.0723[/C][C]0.0563[/C][C]0.0554[/C][C]286096.2263[/C][C]226096.5108[/C][C]475.4961[/C][C]-0.3313[/C][C]0.2933[/C][/ROW]
[ROW][C]70[/C][C]0.1231[/C][C]-0.0023[/C][C]0.0428[/C][C]0.0422[/C][C]199.8954[/C][C]169622.3569[/C][C]411.8523[/C][C]-0.0088[/C][C]0.2221[/C][/ROW]
[ROW][C]71[/C][C]0.1711[/C][C]0.0846[/C][C]0.0512[/C][C]0.0514[/C][C]161991.1076[/C][C]168096.1071[/C][C]409.9953[/C][C]0.2493[/C][C]0.2276[/C][/ROW]
[ROW][C]72[/C][C]0.2527[/C][C]0.1522[/C][C]0.068[/C][C]0.0703[/C][C]280371.2701[/C][C]186808.6342[/C][C]432.2136[/C][C]0.328[/C][C]0.2443[/C][/ROW]
[ROW][C]73[/C][C]0.2932[/C][C]-0.3217[/C][C]0.1042[/C][C]0.0998[/C][C]381595.044[/C][C]214635.2642[/C][C]463.2875[/C][C]-0.3826[/C][C]0.2641[/C][/ROW]
[ROW][C]74[/C][C]0.1974[/C][C]-17.8439[/C][C]2.3217[/C][C]0.3121[/C][C]12736233.1516[/C][C]1779835.0001[/C][C]1334.1046[/C][C]-2.2104[/C][C]0.5074[/C][/ROW]
[ROW][C]75[/C][C]0.157[/C][C]-0.2091[/C][C]2.087[/C][C]0.2985[/C][C]672043.9186[/C][C]1656747.1022[/C][C]1287.1469[/C][C]-0.5077[/C][C]0.5074[/C][/ROW]
[ROW][C]76[/C][C]0.1134[/C][C]-0.051[/C][C]1.8834[/C][C]0.2736[/C][C]101338.4331[/C][C]1501206.2353[/C][C]1225.2372[/C][C]-0.1972[/C][C]0.4764[/C][/ROW]
[ROW][C]77[/C][C]0.1019[/C][C]0.0446[/C][C]1.7162[/C][C]0.2529[/C][C]116112.0855[/C][C]1375288.5853[/C][C]1172.727[/C][C]0.2111[/C][C]0.4523[/C][/ROW]
[ROW][C]78[/C][C]0.0853[/C][C]-0.0146[/C][C]1.5744[/C][C]0.233[/C][C]15835.7368[/C][C]1262000.8479[/C][C]1123.3881[/C][C]-0.0779[/C][C]0.4211[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302526&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302526&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
670.08170.04630.04630.0474195638.8594000.2740.274
680.0807-0.05040.04830.0483196554.4466196096.653442.828-0.27460.2743
690.094-0.07230.05630.0554286096.2263226096.5108475.4961-0.33130.2933
700.1231-0.00230.04280.0422199.8954169622.3569411.8523-0.00880.2221
710.17110.08460.05120.0514161991.1076168096.1071409.99530.24930.2276
720.25270.15220.0680.0703280371.2701186808.6342432.21360.3280.2443
730.2932-0.32170.10420.0998381595.044214635.2642463.2875-0.38260.2641
740.1974-17.84392.32170.312112736233.15161779835.00011334.1046-2.21040.5074
750.157-0.20912.0870.2985672043.91861656747.10221287.1469-0.50770.5074
760.1134-0.0511.88340.2736101338.43311501206.23531225.2372-0.19720.4764
770.10190.04461.71620.2529116112.08551375288.58531172.7270.21110.4523
780.0853-0.01461.57440.23315835.73681262000.84791123.3881-0.07790.4211



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; 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*2
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')