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 computationSat, 17 Dec 2016 01:16:18 +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/17/t14819338294ka0kbgsf9hxknp.htm/, Retrieved Fri, 01 Nov 2024 03:33:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300589, Retrieved Fri, 01 Nov 2024 03:33:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact151
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2016-12-17 00:16:18] [8dbd6448339a84ba150e9d534057ba9c] [Current]
Feedback Forum

Post a new message
Dataseries X:
4751.5
4649.2
4664.9
4691.3
4713.7
4772.8
4748.9
4801
4891.9
4891.9
4903.5
4976.4
5009.8
4946.4
4981.9
5013.8
5015.5
5070.7
5000.9
5059.1
5156.8
5002.6
5059.1
5164.1
5087.9
5140.8
5192.8
5177.6
5167.8
5248.4
5097.5
5187.3
5261.5
5179.7
5205.6
5353.3
5425.7
5215.2
5215.6
5216.4
5208.2
5237.5
5175
5300.2
5279.3
5262.6
5220.5
5372.1
5406
5317.2
5258.4
5204.2
5304.2
5300.2
5228.8
5303.3
5296
5341.1
5354.8
5447.8
5405.6
5333.4
5291.9
5414.4
5317.2
5380.5
5431.5
5363.5
5435.4
5499.8
5447.4
5633
5617.4
5567.8
5574
5710.4
5583.1
5610.8
5620.1
5759.4
5838.7
5843.3
5821
5895.1
5881.6
5827.7
5865.9
5918.4
5875.2
6078.4
5986.3
6019.7
6255.7
6128.4
6210
6301.8
6305.7
6261.2
6200.5
6185.5
6237.4
6399
6182.5
6292.3
6419.8
6273.7
6344.8
6490.4
6355.4
6383.1
6377.3
6324.9
6342.2
6364.1
6249.5
6439.2
6409.4




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=300589&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=300589&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300589&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[105])
1046292.3-------
1056419.8-------
1066273.76400.09196255.37756544.80630.04350.39480.39480.3948
1076344.86414.54786253.16096575.93460.19850.95640.95640.4746
1086490.46436.23076263.73566608.72580.26910.85060.85060.5741
1096355.46458.92776275.21196642.64350.13470.36850.36850.6618
1106383.16481.74776286.08246677.41310.16150.89720.89720.7325
1116377.36504.58176296.2086712.95540.11560.87340.87340.7874
1126324.96527.41716305.61396749.22030.03680.90770.90770.8292
1136342.26550.25276314.3416786.16440.04190.96940.96940.8608
1146364.16573.08836322.4286823.74860.05110.96450.96450.8847
1156249.56595.92396329.91016861.93770.00530.95620.95620.9028
1166439.26618.75956336.81896900.70.1060.99490.99490.9167
1176409.46641.59516343.18286940.00730.06360.90810.90810.9274

\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[105]) \tabularnewline
104 & 6292.3 & - & - & - & - & - & - & - \tabularnewline
105 & 6419.8 & - & - & - & - & - & - & - \tabularnewline
106 & 6273.7 & 6400.0919 & 6255.3775 & 6544.8063 & 0.0435 & 0.3948 & 0.3948 & 0.3948 \tabularnewline
107 & 6344.8 & 6414.5478 & 6253.1609 & 6575.9346 & 0.1985 & 0.9564 & 0.9564 & 0.4746 \tabularnewline
108 & 6490.4 & 6436.2307 & 6263.7356 & 6608.7258 & 0.2691 & 0.8506 & 0.8506 & 0.5741 \tabularnewline
109 & 6355.4 & 6458.9277 & 6275.2119 & 6642.6435 & 0.1347 & 0.3685 & 0.3685 & 0.6618 \tabularnewline
110 & 6383.1 & 6481.7477 & 6286.0824 & 6677.4131 & 0.1615 & 0.8972 & 0.8972 & 0.7325 \tabularnewline
111 & 6377.3 & 6504.5817 & 6296.208 & 6712.9554 & 0.1156 & 0.8734 & 0.8734 & 0.7874 \tabularnewline
112 & 6324.9 & 6527.4171 & 6305.6139 & 6749.2203 & 0.0368 & 0.9077 & 0.9077 & 0.8292 \tabularnewline
113 & 6342.2 & 6550.2527 & 6314.341 & 6786.1644 & 0.0419 & 0.9694 & 0.9694 & 0.8608 \tabularnewline
114 & 6364.1 & 6573.0883 & 6322.428 & 6823.7486 & 0.0511 & 0.9645 & 0.9645 & 0.8847 \tabularnewline
115 & 6249.5 & 6595.9239 & 6329.9101 & 6861.9377 & 0.0053 & 0.9562 & 0.9562 & 0.9028 \tabularnewline
116 & 6439.2 & 6618.7595 & 6336.8189 & 6900.7 & 0.106 & 0.9949 & 0.9949 & 0.9167 \tabularnewline
117 & 6409.4 & 6641.5951 & 6343.1828 & 6940.0073 & 0.0636 & 0.9081 & 0.9081 & 0.9274 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300589&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[105])[/C][/ROW]
[ROW][C]104[/C][C]6292.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]6419.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]6273.7[/C][C]6400.0919[/C][C]6255.3775[/C][C]6544.8063[/C][C]0.0435[/C][C]0.3948[/C][C]0.3948[/C][C]0.3948[/C][/ROW]
[ROW][C]107[/C][C]6344.8[/C][C]6414.5478[/C][C]6253.1609[/C][C]6575.9346[/C][C]0.1985[/C][C]0.9564[/C][C]0.9564[/C][C]0.4746[/C][/ROW]
[ROW][C]108[/C][C]6490.4[/C][C]6436.2307[/C][C]6263.7356[/C][C]6608.7258[/C][C]0.2691[/C][C]0.8506[/C][C]0.8506[/C][C]0.5741[/C][/ROW]
[ROW][C]109[/C][C]6355.4[/C][C]6458.9277[/C][C]6275.2119[/C][C]6642.6435[/C][C]0.1347[/C][C]0.3685[/C][C]0.3685[/C][C]0.6618[/C][/ROW]
[ROW][C]110[/C][C]6383.1[/C][C]6481.7477[/C][C]6286.0824[/C][C]6677.4131[/C][C]0.1615[/C][C]0.8972[/C][C]0.8972[/C][C]0.7325[/C][/ROW]
[ROW][C]111[/C][C]6377.3[/C][C]6504.5817[/C][C]6296.208[/C][C]6712.9554[/C][C]0.1156[/C][C]0.8734[/C][C]0.8734[/C][C]0.7874[/C][/ROW]
[ROW][C]112[/C][C]6324.9[/C][C]6527.4171[/C][C]6305.6139[/C][C]6749.2203[/C][C]0.0368[/C][C]0.9077[/C][C]0.9077[/C][C]0.8292[/C][/ROW]
[ROW][C]113[/C][C]6342.2[/C][C]6550.2527[/C][C]6314.341[/C][C]6786.1644[/C][C]0.0419[/C][C]0.9694[/C][C]0.9694[/C][C]0.8608[/C][/ROW]
[ROW][C]114[/C][C]6364.1[/C][C]6573.0883[/C][C]6322.428[/C][C]6823.7486[/C][C]0.0511[/C][C]0.9645[/C][C]0.9645[/C][C]0.8847[/C][/ROW]
[ROW][C]115[/C][C]6249.5[/C][C]6595.9239[/C][C]6329.9101[/C][C]6861.9377[/C][C]0.0053[/C][C]0.9562[/C][C]0.9562[/C][C]0.9028[/C][/ROW]
[ROW][C]116[/C][C]6439.2[/C][C]6618.7595[/C][C]6336.8189[/C][C]6900.7[/C][C]0.106[/C][C]0.9949[/C][C]0.9949[/C][C]0.9167[/C][/ROW]
[ROW][C]117[/C][C]6409.4[/C][C]6641.5951[/C][C]6343.1828[/C][C]6940.0073[/C][C]0.0636[/C][C]0.9081[/C][C]0.9081[/C][C]0.9274[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300589&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300589&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[105])
1046292.3-------
1056419.8-------
1066273.76400.09196255.37756544.80630.04350.39480.39480.3948
1076344.86414.54786253.16096575.93460.19850.95640.95640.4746
1086490.46436.23076263.73566608.72580.26910.85060.85060.5741
1096355.46458.92776275.21196642.64350.13470.36850.36850.6618
1106383.16481.74776286.08246677.41310.16150.89720.89720.7325
1116377.36504.58176296.2086712.95540.11560.87340.87340.7874
1126324.96527.41716305.61396749.22030.03680.90770.90770.8292
1136342.26550.25276314.3416786.16440.04190.96940.96940.8608
1146364.16573.08836322.4286823.74860.05110.96450.96450.8847
1156249.56595.92396329.91016861.93770.00530.95620.95620.9028
1166439.26618.75956336.81896900.70.1060.99490.99490.9167
1176409.46641.59516343.18286940.00730.06360.90810.90810.9274







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1060.0115-0.02010.02010.019915974.912500-1.71451.7145
1070.0128-0.0110.01560.01544864.748910419.8307102.0776-0.94611.3303
1080.01370.00830.01320.01312934.3137924.658189.02050.73481.1318
1090.0145-0.01630.01390.013910717.97958622.988592.86-1.40441.2
1100.0154-0.01550.01420.01429731.37718844.666294.0461-1.33821.2276
1110.0163-0.020.01520.015116200.624610070.6593100.3527-1.72661.3108
1120.0173-0.0320.01760.017441013.174914491.0187120.3786-2.74721.516
1130.0184-0.03280.01950.019343285.916218090.3809134.5005-2.82231.6793
1140.0195-0.03280.0210.020743676.097620933.2383144.6832-2.8351.8077
1150.0206-0.05540.02440.0241120009.496230840.8641175.6157-4.69932.0968
1160.0217-0.02790.02470.024432241.601230968.2038175.9779-2.43582.1276
1170.0229-0.03620.02570.025353914.546332880.399181.3295-3.14982.2128

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
106 & 0.0115 & -0.0201 & 0.0201 & 0.0199 & 15974.9125 & 0 & 0 & -1.7145 & 1.7145 \tabularnewline
107 & 0.0128 & -0.011 & 0.0156 & 0.0154 & 4864.7489 & 10419.8307 & 102.0776 & -0.9461 & 1.3303 \tabularnewline
108 & 0.0137 & 0.0083 & 0.0132 & 0.0131 & 2934.313 & 7924.6581 & 89.0205 & 0.7348 & 1.1318 \tabularnewline
109 & 0.0145 & -0.0163 & 0.0139 & 0.0139 & 10717.9795 & 8622.9885 & 92.86 & -1.4044 & 1.2 \tabularnewline
110 & 0.0154 & -0.0155 & 0.0142 & 0.0142 & 9731.3771 & 8844.6662 & 94.0461 & -1.3382 & 1.2276 \tabularnewline
111 & 0.0163 & -0.02 & 0.0152 & 0.0151 & 16200.6246 & 10070.6593 & 100.3527 & -1.7266 & 1.3108 \tabularnewline
112 & 0.0173 & -0.032 & 0.0176 & 0.0174 & 41013.1749 & 14491.0187 & 120.3786 & -2.7472 & 1.516 \tabularnewline
113 & 0.0184 & -0.0328 & 0.0195 & 0.0193 & 43285.9162 & 18090.3809 & 134.5005 & -2.8223 & 1.6793 \tabularnewline
114 & 0.0195 & -0.0328 & 0.021 & 0.0207 & 43676.0976 & 20933.2383 & 144.6832 & -2.835 & 1.8077 \tabularnewline
115 & 0.0206 & -0.0554 & 0.0244 & 0.0241 & 120009.4962 & 30840.8641 & 175.6157 & -4.6993 & 2.0968 \tabularnewline
116 & 0.0217 & -0.0279 & 0.0247 & 0.0244 & 32241.6012 & 30968.2038 & 175.9779 & -2.4358 & 2.1276 \tabularnewline
117 & 0.0229 & -0.0362 & 0.0257 & 0.0253 & 53914.5463 & 32880.399 & 181.3295 & -3.1498 & 2.2128 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300589&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]106[/C][C]0.0115[/C][C]-0.0201[/C][C]0.0201[/C][C]0.0199[/C][C]15974.9125[/C][C]0[/C][C]0[/C][C]-1.7145[/C][C]1.7145[/C][/ROW]
[ROW][C]107[/C][C]0.0128[/C][C]-0.011[/C][C]0.0156[/C][C]0.0154[/C][C]4864.7489[/C][C]10419.8307[/C][C]102.0776[/C][C]-0.9461[/C][C]1.3303[/C][/ROW]
[ROW][C]108[/C][C]0.0137[/C][C]0.0083[/C][C]0.0132[/C][C]0.0131[/C][C]2934.313[/C][C]7924.6581[/C][C]89.0205[/C][C]0.7348[/C][C]1.1318[/C][/ROW]
[ROW][C]109[/C][C]0.0145[/C][C]-0.0163[/C][C]0.0139[/C][C]0.0139[/C][C]10717.9795[/C][C]8622.9885[/C][C]92.86[/C][C]-1.4044[/C][C]1.2[/C][/ROW]
[ROW][C]110[/C][C]0.0154[/C][C]-0.0155[/C][C]0.0142[/C][C]0.0142[/C][C]9731.3771[/C][C]8844.6662[/C][C]94.0461[/C][C]-1.3382[/C][C]1.2276[/C][/ROW]
[ROW][C]111[/C][C]0.0163[/C][C]-0.02[/C][C]0.0152[/C][C]0.0151[/C][C]16200.6246[/C][C]10070.6593[/C][C]100.3527[/C][C]-1.7266[/C][C]1.3108[/C][/ROW]
[ROW][C]112[/C][C]0.0173[/C][C]-0.032[/C][C]0.0176[/C][C]0.0174[/C][C]41013.1749[/C][C]14491.0187[/C][C]120.3786[/C][C]-2.7472[/C][C]1.516[/C][/ROW]
[ROW][C]113[/C][C]0.0184[/C][C]-0.0328[/C][C]0.0195[/C][C]0.0193[/C][C]43285.9162[/C][C]18090.3809[/C][C]134.5005[/C][C]-2.8223[/C][C]1.6793[/C][/ROW]
[ROW][C]114[/C][C]0.0195[/C][C]-0.0328[/C][C]0.021[/C][C]0.0207[/C][C]43676.0976[/C][C]20933.2383[/C][C]144.6832[/C][C]-2.835[/C][C]1.8077[/C][/ROW]
[ROW][C]115[/C][C]0.0206[/C][C]-0.0554[/C][C]0.0244[/C][C]0.0241[/C][C]120009.4962[/C][C]30840.8641[/C][C]175.6157[/C][C]-4.6993[/C][C]2.0968[/C][/ROW]
[ROW][C]116[/C][C]0.0217[/C][C]-0.0279[/C][C]0.0247[/C][C]0.0244[/C][C]32241.6012[/C][C]30968.2038[/C][C]175.9779[/C][C]-2.4358[/C][C]2.1276[/C][/ROW]
[ROW][C]117[/C][C]0.0229[/C][C]-0.0362[/C][C]0.0257[/C][C]0.0253[/C][C]53914.5463[/C][C]32880.399[/C][C]181.3295[/C][C]-3.1498[/C][C]2.2128[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300589&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300589&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
1060.0115-0.02010.02010.019915974.912500-1.71451.7145
1070.0128-0.0110.01560.01544864.748910419.8307102.0776-0.94611.3303
1080.01370.00830.01320.01312934.3137924.658189.02050.73481.1318
1090.0145-0.01630.01390.013910717.97958622.988592.86-1.40441.2
1100.0154-0.01550.01420.01429731.37718844.666294.0461-1.33821.2276
1110.0163-0.020.01520.015116200.624610070.6593100.3527-1.72661.3108
1120.0173-0.0320.01760.017441013.174914491.0187120.3786-2.74721.516
1130.0184-0.03280.01950.019343285.916218090.3809134.5005-2.82231.6793
1140.0195-0.03280.0210.020743676.097620933.2383144.6832-2.8351.8077
1150.0206-0.05540.02440.0241120009.496230840.8641175.6157-4.69932.0968
1160.0217-0.02790.02470.024432241.601230968.2038175.9779-2.43582.1276
1170.0229-0.03620.02570.025353914.546332880.399181.3295-3.14982.2128



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