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 computationWed, 21 Nov 2012 11:59:05 -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/2012/Nov/21/t1353517227gqjy71yn1tj9sr1.htm/, Retrieved Sun, 28 Apr 2024 14:45:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=191487, Retrieved Sun, 28 Apr 2024 14:45:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact111
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Monthly US soldie...] [2010-11-02 12:07:39] [b98453cac15ba1066b407e146608df68]
- RMP   [Structural Time Series Models] [Soldiers] [2010-11-30 14:06:56] [b98453cac15ba1066b407e146608df68]
- RMP       [ARIMA Forecasting] [ARIMA forecasting] [2012-11-21 16:59:05] [a641906195a0eb35087b0121beaccdc9] [Current]
Feedback Forum

Post a new message
Dataseries X:
37
30
47
35
30
43
82
40
47
19
52
136
80
42
54
66
81
63
137
72
107
58
36
52
79
77
54
84
48
96
83
66
61
53
30
74
69
59
42
65
70
100
63
105
82
81
75
102
121
98
76
77
63
37
35
23
40
29
37
51
20
28
13
22
25
13
16
13
16
17
9
17
25
14
8
7
10
7
10
3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=191487&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'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[68])
5623-------
5740-------
5829-------
5937-------
6051-------
6120-------
6228-------
6313-------
6422-------
6525-------
6613-------
6716-------
6813-------
691616.21317.373135.65190.49140.6270.00820.627
701714.59696.049535.22090.40970.4470.08550.5603
71915.23895.898239.37230.30620.44310.03860.5721
721714.48785.39138.93450.42020.670.00170.5475
732515.09655.12644.46070.25430.44940.37170.5556
741414.83924.706346.78870.47950.26650.20970.5449
75814.98964.463150.34330.34920.52190.54390.5439
76714.82324.190952.42980.34170.63890.35420.5379
771014.93133.985455.94040.40680.64770.31520.5368
78714.88593.764758.86090.36260.58620.53350.5335
791014.92173.581462.17070.41910.62880.48220.5318
80314.88773.403665.12110.32140.57560.52940.5294

\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[68]) \tabularnewline
56 & 23 & - & - & - & - & - & - & - \tabularnewline
57 & 40 & - & - & - & - & - & - & - \tabularnewline
58 & 29 & - & - & - & - & - & - & - \tabularnewline
59 & 37 & - & - & - & - & - & - & - \tabularnewline
60 & 51 & - & - & - & - & - & - & - \tabularnewline
61 & 20 & - & - & - & - & - & - & - \tabularnewline
62 & 28 & - & - & - & - & - & - & - \tabularnewline
63 & 13 & - & - & - & - & - & - & - \tabularnewline
64 & 22 & - & - & - & - & - & - & - \tabularnewline
65 & 25 & - & - & - & - & - & - & - \tabularnewline
66 & 13 & - & - & - & - & - & - & - \tabularnewline
67 & 16 & - & - & - & - & - & - & - \tabularnewline
68 & 13 & - & - & - & - & - & - & - \tabularnewline
69 & 16 & 16.2131 & 7.3731 & 35.6519 & 0.4914 & 0.627 & 0.0082 & 0.627 \tabularnewline
70 & 17 & 14.5969 & 6.0495 & 35.2209 & 0.4097 & 0.447 & 0.0855 & 0.5603 \tabularnewline
71 & 9 & 15.2389 & 5.8982 & 39.3723 & 0.3062 & 0.4431 & 0.0386 & 0.5721 \tabularnewline
72 & 17 & 14.4878 & 5.391 & 38.9345 & 0.4202 & 0.67 & 0.0017 & 0.5475 \tabularnewline
73 & 25 & 15.0965 & 5.126 & 44.4607 & 0.2543 & 0.4494 & 0.3717 & 0.5556 \tabularnewline
74 & 14 & 14.8392 & 4.7063 & 46.7887 & 0.4795 & 0.2665 & 0.2097 & 0.5449 \tabularnewline
75 & 8 & 14.9896 & 4.4631 & 50.3433 & 0.3492 & 0.5219 & 0.5439 & 0.5439 \tabularnewline
76 & 7 & 14.8232 & 4.1909 & 52.4298 & 0.3417 & 0.6389 & 0.3542 & 0.5379 \tabularnewline
77 & 10 & 14.9313 & 3.9854 & 55.9404 & 0.4068 & 0.6477 & 0.3152 & 0.5368 \tabularnewline
78 & 7 & 14.8859 & 3.7647 & 58.8609 & 0.3626 & 0.5862 & 0.5335 & 0.5335 \tabularnewline
79 & 10 & 14.9217 & 3.5814 & 62.1707 & 0.4191 & 0.6288 & 0.4822 & 0.5318 \tabularnewline
80 & 3 & 14.8877 & 3.4036 & 65.1211 & 0.3214 & 0.5756 & 0.5294 & 0.5294 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=191487&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[68])[/C][/ROW]
[ROW][C]56[/C][C]23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]40[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]20[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]16[/C][C]16.2131[/C][C]7.3731[/C][C]35.6519[/C][C]0.4914[/C][C]0.627[/C][C]0.0082[/C][C]0.627[/C][/ROW]
[ROW][C]70[/C][C]17[/C][C]14.5969[/C][C]6.0495[/C][C]35.2209[/C][C]0.4097[/C][C]0.447[/C][C]0.0855[/C][C]0.5603[/C][/ROW]
[ROW][C]71[/C][C]9[/C][C]15.2389[/C][C]5.8982[/C][C]39.3723[/C][C]0.3062[/C][C]0.4431[/C][C]0.0386[/C][C]0.5721[/C][/ROW]
[ROW][C]72[/C][C]17[/C][C]14.4878[/C][C]5.391[/C][C]38.9345[/C][C]0.4202[/C][C]0.67[/C][C]0.0017[/C][C]0.5475[/C][/ROW]
[ROW][C]73[/C][C]25[/C][C]15.0965[/C][C]5.126[/C][C]44.4607[/C][C]0.2543[/C][C]0.4494[/C][C]0.3717[/C][C]0.5556[/C][/ROW]
[ROW][C]74[/C][C]14[/C][C]14.8392[/C][C]4.7063[/C][C]46.7887[/C][C]0.4795[/C][C]0.2665[/C][C]0.2097[/C][C]0.5449[/C][/ROW]
[ROW][C]75[/C][C]8[/C][C]14.9896[/C][C]4.4631[/C][C]50.3433[/C][C]0.3492[/C][C]0.5219[/C][C]0.5439[/C][C]0.5439[/C][/ROW]
[ROW][C]76[/C][C]7[/C][C]14.8232[/C][C]4.1909[/C][C]52.4298[/C][C]0.3417[/C][C]0.6389[/C][C]0.3542[/C][C]0.5379[/C][/ROW]
[ROW][C]77[/C][C]10[/C][C]14.9313[/C][C]3.9854[/C][C]55.9404[/C][C]0.4068[/C][C]0.6477[/C][C]0.3152[/C][C]0.5368[/C][/ROW]
[ROW][C]78[/C][C]7[/C][C]14.8859[/C][C]3.7647[/C][C]58.8609[/C][C]0.3626[/C][C]0.5862[/C][C]0.5335[/C][C]0.5335[/C][/ROW]
[ROW][C]79[/C][C]10[/C][C]14.9217[/C][C]3.5814[/C][C]62.1707[/C][C]0.4191[/C][C]0.6288[/C][C]0.4822[/C][C]0.5318[/C][/ROW]
[ROW][C]80[/C][C]3[/C][C]14.8877[/C][C]3.4036[/C][C]65.1211[/C][C]0.3214[/C][C]0.5756[/C][C]0.5294[/C][C]0.5294[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=191487&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=191487&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[68])
5623-------
5740-------
5829-------
5937-------
6051-------
6120-------
6228-------
6313-------
6422-------
6525-------
6613-------
6716-------
6813-------
691616.21317.373135.65190.49140.6270.00820.627
701714.59696.049535.22090.40970.4470.08550.5603
71915.23895.898239.37230.30620.44310.03860.5721
721714.48785.39138.93450.42020.670.00170.5475
732515.09655.12644.46070.25430.44940.37170.5556
741414.83924.706346.78870.47950.26650.20970.5449
75814.98964.463150.34330.34920.52190.54390.5439
76714.82324.190952.42980.34170.63890.35420.5379
771014.93133.985455.94040.40680.64770.31520.5368
78714.88593.764758.86090.36260.58620.53350.5335
791014.92173.581462.17070.41910.62880.48220.5318
80314.88773.403665.12110.32140.57560.52940.5294







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.6117-0.013100.045400
700.72090.16460.08895.77482.91011.7059
710.808-0.40940.195738.923814.91473.862
720.86090.17340.19016.31112.76383.5726
730.99240.6560.283398.079129.82685.4614
741.0985-0.05660.24550.704224.97314.9973
751.2033-0.46630.277148.854428.38475.3277
761.2944-0.52780.308461.201832.48685.6997
771.4013-0.33030.310824.317931.57925.6195
781.5072-0.52980.332762.187934.645.8856
791.6155-0.32980.332524.22333.6935.8046
801.7215-0.79850.3713141.317742.66176.5316

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
69 & 0.6117 & -0.0131 & 0 & 0.0454 & 0 & 0 \tabularnewline
70 & 0.7209 & 0.1646 & 0.0889 & 5.7748 & 2.9101 & 1.7059 \tabularnewline
71 & 0.808 & -0.4094 & 0.1957 & 38.9238 & 14.9147 & 3.862 \tabularnewline
72 & 0.8609 & 0.1734 & 0.1901 & 6.311 & 12.7638 & 3.5726 \tabularnewline
73 & 0.9924 & 0.656 & 0.2833 & 98.0791 & 29.8268 & 5.4614 \tabularnewline
74 & 1.0985 & -0.0566 & 0.2455 & 0.7042 & 24.9731 & 4.9973 \tabularnewline
75 & 1.2033 & -0.4663 & 0.2771 & 48.8544 & 28.3847 & 5.3277 \tabularnewline
76 & 1.2944 & -0.5278 & 0.3084 & 61.2018 & 32.4868 & 5.6997 \tabularnewline
77 & 1.4013 & -0.3303 & 0.3108 & 24.3179 & 31.5792 & 5.6195 \tabularnewline
78 & 1.5072 & -0.5298 & 0.3327 & 62.1879 & 34.64 & 5.8856 \tabularnewline
79 & 1.6155 & -0.3298 & 0.3325 & 24.223 & 33.693 & 5.8046 \tabularnewline
80 & 1.7215 & -0.7985 & 0.3713 & 141.3177 & 42.6617 & 6.5316 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=191487&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]69[/C][C]0.6117[/C][C]-0.0131[/C][C]0[/C][C]0.0454[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]70[/C][C]0.7209[/C][C]0.1646[/C][C]0.0889[/C][C]5.7748[/C][C]2.9101[/C][C]1.7059[/C][/ROW]
[ROW][C]71[/C][C]0.808[/C][C]-0.4094[/C][C]0.1957[/C][C]38.9238[/C][C]14.9147[/C][C]3.862[/C][/ROW]
[ROW][C]72[/C][C]0.8609[/C][C]0.1734[/C][C]0.1901[/C][C]6.311[/C][C]12.7638[/C][C]3.5726[/C][/ROW]
[ROW][C]73[/C][C]0.9924[/C][C]0.656[/C][C]0.2833[/C][C]98.0791[/C][C]29.8268[/C][C]5.4614[/C][/ROW]
[ROW][C]74[/C][C]1.0985[/C][C]-0.0566[/C][C]0.2455[/C][C]0.7042[/C][C]24.9731[/C][C]4.9973[/C][/ROW]
[ROW][C]75[/C][C]1.2033[/C][C]-0.4663[/C][C]0.2771[/C][C]48.8544[/C][C]28.3847[/C][C]5.3277[/C][/ROW]
[ROW][C]76[/C][C]1.2944[/C][C]-0.5278[/C][C]0.3084[/C][C]61.2018[/C][C]32.4868[/C][C]5.6997[/C][/ROW]
[ROW][C]77[/C][C]1.4013[/C][C]-0.3303[/C][C]0.3108[/C][C]24.3179[/C][C]31.5792[/C][C]5.6195[/C][/ROW]
[ROW][C]78[/C][C]1.5072[/C][C]-0.5298[/C][C]0.3327[/C][C]62.1879[/C][C]34.64[/C][C]5.8856[/C][/ROW]
[ROW][C]79[/C][C]1.6155[/C][C]-0.3298[/C][C]0.3325[/C][C]24.223[/C][C]33.693[/C][C]5.8046[/C][/ROW]
[ROW][C]80[/C][C]1.7215[/C][C]-0.7985[/C][C]0.3713[/C][C]141.3177[/C][C]42.6617[/C][C]6.5316[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=191487&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=191487&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
690.6117-0.013100.045400
700.72090.16460.08895.77482.91011.7059
710.808-0.40940.195738.923814.91473.862
720.86090.17340.19016.31112.76383.5726
730.99240.6560.283398.079129.82685.4614
741.0985-0.05660.24550.704224.97314.9973
751.2033-0.46630.277148.854428.38475.3277
761.2944-0.52780.308461.201832.48685.6997
771.4013-0.33030.310824.317931.57925.6195
781.5072-0.52980.332762.187934.645.8856
791.6155-0.32980.332524.22333.6935.8046
801.7215-0.79850.3713141.317742.66176.5316



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