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, 20 Dec 2011 17:02:36 -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/20/t1324418581ekao4spv6rgqnc7.htm/, Retrieved Mon, 06 May 2024 04:57:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=158305, Retrieved Mon, 06 May 2024 04:57:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact113
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [ws 10] [2009-12-04 22:28:42] [6e4e01d7eb22a9f33d58ebb35753a195]
- R PD  [ARIMA Forecasting] [Paper Voorspelling] [2010-12-21 16:33:54] [a9e130f95bad0a0597234e75c6380c5a]
- R PD      [ARIMA Forecasting] [] [2011-12-20 22:02:36] [3b32143baae8ca4a077b118800e50af3] [Current]
Feedback Forum

Post a new message
Dataseries X:
103.7
103.75
103.85
104.02
104.13
104.17
104.18
104.2
104.5
104.78
104.88
104.89
104.9
104.95
105.24
105.35
105.44
105.46
105.47
105.48
105.75
106.1
106.19
106.23
106.24
106.25
106.35
106.48
106.52
106.55
106.55
106.56
106.89
107.09
107.24
107.28
107.3
107.31
107.47
107.35
107.31
107.32
107.32
107.34
107.53
107.72
107.75
107.79
107.81
107.9
107.8
107.86
107.8
107.74
107.75
107.83
107.8
107.81
107.86
107.83




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158305&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'Herman Ole Andreas Wold' @ wold.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[48])
36107.28-------
37107.3-------
38107.31-------
39107.47-------
40107.35-------
41107.31-------
42107.32-------
43107.32-------
44107.34-------
45107.53-------
46107.72-------
47107.75-------
48107.79-------
49107.81107.8027107.6845107.9210.4520.583510.5835
50107.9107.8127107.6103108.01520.19910.510510.5871
51107.8107.9291107.6567108.20150.17650.58280.99950.8415
52107.86107.991107.6593108.32260.21940.87050.99990.8825
53107.8108.0092107.626108.39240.14230.77730.99980.8689
54107.74108.0338107.6047108.46280.08980.85720.99940.8673
55107.75108.0338107.5631108.50440.11870.88940.99850.845
56107.83108.0465107.5376108.55530.20220.87330.99670.8384
57107.8108.3383107.7939108.88280.02630.96640.99820.9758
58107.81108.5356107.9577109.11350.00690.99370.99720.9943
59107.86108.6529108.0435109.26240.00540.99660.99820.9972
60107.83108.6929108.0535109.33240.00410.99470.99720.9972

\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[48]) \tabularnewline
36 & 107.28 & - & - & - & - & - & - & - \tabularnewline
37 & 107.3 & - & - & - & - & - & - & - \tabularnewline
38 & 107.31 & - & - & - & - & - & - & - \tabularnewline
39 & 107.47 & - & - & - & - & - & - & - \tabularnewline
40 & 107.35 & - & - & - & - & - & - & - \tabularnewline
41 & 107.31 & - & - & - & - & - & - & - \tabularnewline
42 & 107.32 & - & - & - & - & - & - & - \tabularnewline
43 & 107.32 & - & - & - & - & - & - & - \tabularnewline
44 & 107.34 & - & - & - & - & - & - & - \tabularnewline
45 & 107.53 & - & - & - & - & - & - & - \tabularnewline
46 & 107.72 & - & - & - & - & - & - & - \tabularnewline
47 & 107.75 & - & - & - & - & - & - & - \tabularnewline
48 & 107.79 & - & - & - & - & - & - & - \tabularnewline
49 & 107.81 & 107.8027 & 107.6845 & 107.921 & 0.452 & 0.5835 & 1 & 0.5835 \tabularnewline
50 & 107.9 & 107.8127 & 107.6103 & 108.0152 & 0.1991 & 0.5105 & 1 & 0.5871 \tabularnewline
51 & 107.8 & 107.9291 & 107.6567 & 108.2015 & 0.1765 & 0.5828 & 0.9995 & 0.8415 \tabularnewline
52 & 107.86 & 107.991 & 107.6593 & 108.3226 & 0.2194 & 0.8705 & 0.9999 & 0.8825 \tabularnewline
53 & 107.8 & 108.0092 & 107.626 & 108.3924 & 0.1423 & 0.7773 & 0.9998 & 0.8689 \tabularnewline
54 & 107.74 & 108.0338 & 107.6047 & 108.4628 & 0.0898 & 0.8572 & 0.9994 & 0.8673 \tabularnewline
55 & 107.75 & 108.0338 & 107.5631 & 108.5044 & 0.1187 & 0.8894 & 0.9985 & 0.845 \tabularnewline
56 & 107.83 & 108.0465 & 107.5376 & 108.5553 & 0.2022 & 0.8733 & 0.9967 & 0.8384 \tabularnewline
57 & 107.8 & 108.3383 & 107.7939 & 108.8828 & 0.0263 & 0.9664 & 0.9982 & 0.9758 \tabularnewline
58 & 107.81 & 108.5356 & 107.9577 & 109.1135 & 0.0069 & 0.9937 & 0.9972 & 0.9943 \tabularnewline
59 & 107.86 & 108.6529 & 108.0435 & 109.2624 & 0.0054 & 0.9966 & 0.9982 & 0.9972 \tabularnewline
60 & 107.83 & 108.6929 & 108.0535 & 109.3324 & 0.0041 & 0.9947 & 0.9972 & 0.9972 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158305&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[48])[/C][/ROW]
[ROW][C]36[/C][C]107.28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]107.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]107.31[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]107.47[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]107.35[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]107.31[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]107.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]107.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]107.34[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]107.53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]107.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]107.75[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]107.79[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]107.81[/C][C]107.8027[/C][C]107.6845[/C][C]107.921[/C][C]0.452[/C][C]0.5835[/C][C]1[/C][C]0.5835[/C][/ROW]
[ROW][C]50[/C][C]107.9[/C][C]107.8127[/C][C]107.6103[/C][C]108.0152[/C][C]0.1991[/C][C]0.5105[/C][C]1[/C][C]0.5871[/C][/ROW]
[ROW][C]51[/C][C]107.8[/C][C]107.9291[/C][C]107.6567[/C][C]108.2015[/C][C]0.1765[/C][C]0.5828[/C][C]0.9995[/C][C]0.8415[/C][/ROW]
[ROW][C]52[/C][C]107.86[/C][C]107.991[/C][C]107.6593[/C][C]108.3226[/C][C]0.2194[/C][C]0.8705[/C][C]0.9999[/C][C]0.8825[/C][/ROW]
[ROW][C]53[/C][C]107.8[/C][C]108.0092[/C][C]107.626[/C][C]108.3924[/C][C]0.1423[/C][C]0.7773[/C][C]0.9998[/C][C]0.8689[/C][/ROW]
[ROW][C]54[/C][C]107.74[/C][C]108.0338[/C][C]107.6047[/C][C]108.4628[/C][C]0.0898[/C][C]0.8572[/C][C]0.9994[/C][C]0.8673[/C][/ROW]
[ROW][C]55[/C][C]107.75[/C][C]108.0338[/C][C]107.5631[/C][C]108.5044[/C][C]0.1187[/C][C]0.8894[/C][C]0.9985[/C][C]0.845[/C][/ROW]
[ROW][C]56[/C][C]107.83[/C][C]108.0465[/C][C]107.5376[/C][C]108.5553[/C][C]0.2022[/C][C]0.8733[/C][C]0.9967[/C][C]0.8384[/C][/ROW]
[ROW][C]57[/C][C]107.8[/C][C]108.3383[/C][C]107.7939[/C][C]108.8828[/C][C]0.0263[/C][C]0.9664[/C][C]0.9982[/C][C]0.9758[/C][/ROW]
[ROW][C]58[/C][C]107.81[/C][C]108.5356[/C][C]107.9577[/C][C]109.1135[/C][C]0.0069[/C][C]0.9937[/C][C]0.9972[/C][C]0.9943[/C][/ROW]
[ROW][C]59[/C][C]107.86[/C][C]108.6529[/C][C]108.0435[/C][C]109.2624[/C][C]0.0054[/C][C]0.9966[/C][C]0.9982[/C][C]0.9972[/C][/ROW]
[ROW][C]60[/C][C]107.83[/C][C]108.6929[/C][C]108.0535[/C][C]109.3324[/C][C]0.0041[/C][C]0.9947[/C][C]0.9972[/C][C]0.9972[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158305&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158305&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[48])
36107.28-------
37107.3-------
38107.31-------
39107.47-------
40107.35-------
41107.31-------
42107.32-------
43107.32-------
44107.34-------
45107.53-------
46107.72-------
47107.75-------
48107.79-------
49107.81107.8027107.6845107.9210.4520.583510.5835
50107.9107.8127107.6103108.01520.19910.510510.5871
51107.8107.9291107.6567108.20150.17650.58280.99950.8415
52107.86107.991107.6593108.32260.21940.87050.99990.8825
53107.8108.0092107.626108.39240.14230.77730.99980.8689
54107.74108.0338107.6047108.46280.08980.85720.99940.8673
55107.75108.0338107.5631108.50440.11870.88940.99850.845
56107.83108.0465107.5376108.55530.20220.87330.99670.8384
57107.8108.3383107.7939108.88280.02630.96640.99820.9758
58107.81108.5356107.9577109.11350.00690.99370.99720.9943
59107.86108.6529108.0435109.26240.00540.99660.99820.9972
60107.83108.6929108.0535109.33240.00410.99470.99720.9972







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
496e-041e-0401e-0400
500.0018e-044e-040.00760.00380.0619
510.0013-0.00127e-040.01670.00810.0901
520.0016-0.00128e-040.01720.01040.1018
530.0018-0.00190.0010.04380.0170.1306
540.002-0.00270.00130.08630.02860.1691
550.0022-0.00260.00150.08050.0360.1898
560.0024-0.0020.00160.04690.03740.1933
570.0026-0.0050.00190.28980.06540.2558
580.0027-0.00670.00240.52650.11150.334
590.0029-0.00730.00290.62880.15850.3982
600.003-0.00790.00330.74470.20740.4554

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 6e-04 & 1e-04 & 0 & 1e-04 & 0 & 0 \tabularnewline
50 & 0.001 & 8e-04 & 4e-04 & 0.0076 & 0.0038 & 0.0619 \tabularnewline
51 & 0.0013 & -0.0012 & 7e-04 & 0.0167 & 0.0081 & 0.0901 \tabularnewline
52 & 0.0016 & -0.0012 & 8e-04 & 0.0172 & 0.0104 & 0.1018 \tabularnewline
53 & 0.0018 & -0.0019 & 0.001 & 0.0438 & 0.017 & 0.1306 \tabularnewline
54 & 0.002 & -0.0027 & 0.0013 & 0.0863 & 0.0286 & 0.1691 \tabularnewline
55 & 0.0022 & -0.0026 & 0.0015 & 0.0805 & 0.036 & 0.1898 \tabularnewline
56 & 0.0024 & -0.002 & 0.0016 & 0.0469 & 0.0374 & 0.1933 \tabularnewline
57 & 0.0026 & -0.005 & 0.0019 & 0.2898 & 0.0654 & 0.2558 \tabularnewline
58 & 0.0027 & -0.0067 & 0.0024 & 0.5265 & 0.1115 & 0.334 \tabularnewline
59 & 0.0029 & -0.0073 & 0.0029 & 0.6288 & 0.1585 & 0.3982 \tabularnewline
60 & 0.003 & -0.0079 & 0.0033 & 0.7447 & 0.2074 & 0.4554 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158305&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]49[/C][C]6e-04[/C][C]1e-04[/C][C]0[/C][C]1e-04[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.001[/C][C]8e-04[/C][C]4e-04[/C][C]0.0076[/C][C]0.0038[/C][C]0.0619[/C][/ROW]
[ROW][C]51[/C][C]0.0013[/C][C]-0.0012[/C][C]7e-04[/C][C]0.0167[/C][C]0.0081[/C][C]0.0901[/C][/ROW]
[ROW][C]52[/C][C]0.0016[/C][C]-0.0012[/C][C]8e-04[/C][C]0.0172[/C][C]0.0104[/C][C]0.1018[/C][/ROW]
[ROW][C]53[/C][C]0.0018[/C][C]-0.0019[/C][C]0.001[/C][C]0.0438[/C][C]0.017[/C][C]0.1306[/C][/ROW]
[ROW][C]54[/C][C]0.002[/C][C]-0.0027[/C][C]0.0013[/C][C]0.0863[/C][C]0.0286[/C][C]0.1691[/C][/ROW]
[ROW][C]55[/C][C]0.0022[/C][C]-0.0026[/C][C]0.0015[/C][C]0.0805[/C][C]0.036[/C][C]0.1898[/C][/ROW]
[ROW][C]56[/C][C]0.0024[/C][C]-0.002[/C][C]0.0016[/C][C]0.0469[/C][C]0.0374[/C][C]0.1933[/C][/ROW]
[ROW][C]57[/C][C]0.0026[/C][C]-0.005[/C][C]0.0019[/C][C]0.2898[/C][C]0.0654[/C][C]0.2558[/C][/ROW]
[ROW][C]58[/C][C]0.0027[/C][C]-0.0067[/C][C]0.0024[/C][C]0.5265[/C][C]0.1115[/C][C]0.334[/C][/ROW]
[ROW][C]59[/C][C]0.0029[/C][C]-0.0073[/C][C]0.0029[/C][C]0.6288[/C][C]0.1585[/C][C]0.3982[/C][/ROW]
[ROW][C]60[/C][C]0.003[/C][C]-0.0079[/C][C]0.0033[/C][C]0.7447[/C][C]0.2074[/C][C]0.4554[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158305&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158305&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
496e-041e-0401e-0400
500.0018e-044e-040.00760.00380.0619
510.0013-0.00127e-040.01670.00810.0901
520.0016-0.00128e-040.01720.01040.1018
530.0018-0.00190.0010.04380.0170.1306
540.002-0.00270.00130.08630.02860.1691
550.0022-0.00260.00150.08050.0360.1898
560.0024-0.0020.00160.04690.03740.1933
570.0026-0.0050.00190.28980.06540.2558
580.0027-0.00670.00240.52650.11150.334
590.0029-0.00730.00290.62880.15850.3982
600.003-0.00790.00330.74470.20740.4554



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