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 computationFri, 24 Dec 2010 09:42:48 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/24/t1293183679tfuf4zh4nzll2u0.htm/, Retrieved Tue, 30 Apr 2024 00:49:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114669, Retrieved Tue, 30 Apr 2024 00:49:17 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact150
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
-   PD      [ARIMA Forecasting] [ARIMA forecast ol...] [2010-12-22 22:41:36] [a8a0ff0853b70f438be515083758c362]
-   P           [ARIMA Forecasting] [Arima Forecast ol...] [2010-12-24 09:42:48] [8f110cf3e3846d42560df9b5835185a6] [Current]
-   P             [ARIMA Forecasting] [ARIMA forecasting...] [2010-12-24 21:10:37] [a8a0ff0853b70f438be515083758c362]
Feedback Forum

Post a new message
Dataseries X:
78.33
78.21
78.94
77.94
77.31
75.75
77.73
77.90
77.45
77.46
77.97
77.23
76.56
76.70
76.51
76.03
76.69
76.38
76.80
76.63
77.17
78.63
78.89
76.94
77.50
79.27
79.77
78.62
78.60
77.88
78.71
79.27
80.12
81.12
81.48
82.81
82.39
82.41
82.20
81.99
81.61
83.51
84.05
82.99
83.54
84.44
84.24
83.88
84.17
84.59
84.76
85.14
85.22
84.77
84.50
84.56
83.79
83.96
84.80
84.89
84.78
84.80
84.44
84.65
84.22
84.08
85.29
85.00
84.63
84.92
84.61
84.50
84.29
84.50
84.41
84.71
84.21
83.86
84.40
83.71
84.42
85.26
85.08
85.65
85.74
85.89
86.08
85.49
85.97
85.84
86.72
85.42
83.87
85.45
85.35
84.27
83.13
83.79
83.70
83.76
83.47
83.78
84.83
84.43
84.90
85.36
85.49
85.29




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114669&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114669&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114669&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'Gwilym Jenkins' @ 72.249.127.135







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[96])
8485.65-------
8585.74-------
8685.89-------
8786.08-------
8885.49-------
8985.97-------
9085.84-------
9186.72-------
9285.42-------
9383.87-------
9485.45-------
9585.35-------
9684.27-------
9783.1384.416283.075185.75720.03010.58460.02650.5846
9883.7984.758182.94986.56720.14710.96110.110.7015
9983.784.641282.65986.62330.1760.80.07740.6432
10083.7684.480382.28186.67950.26050.75660.18410.5743
10183.4784.538382.071687.00490.1980.73190.12760.5844
10283.7884.546581.852287.24080.28860.78320.17340.5797
10384.8384.553581.655687.45130.42580.69960.07140.576
10484.4384.463781.358987.56840.49150.40860.2730.5487
10584.984.379281.069987.68840.37890.4880.61850.5258
10685.3684.449280.944787.95380.30530.40050.28780.5399
10785.4984.428880.734588.12320.28670.31060.31250.5336
10885.2984.362180.481188.24310.31970.28450.51860.5186

\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[96]) \tabularnewline
84 & 85.65 & - & - & - & - & - & - & - \tabularnewline
85 & 85.74 & - & - & - & - & - & - & - \tabularnewline
86 & 85.89 & - & - & - & - & - & - & - \tabularnewline
87 & 86.08 & - & - & - & - & - & - & - \tabularnewline
88 & 85.49 & - & - & - & - & - & - & - \tabularnewline
89 & 85.97 & - & - & - & - & - & - & - \tabularnewline
90 & 85.84 & - & - & - & - & - & - & - \tabularnewline
91 & 86.72 & - & - & - & - & - & - & - \tabularnewline
92 & 85.42 & - & - & - & - & - & - & - \tabularnewline
93 & 83.87 & - & - & - & - & - & - & - \tabularnewline
94 & 85.45 & - & - & - & - & - & - & - \tabularnewline
95 & 85.35 & - & - & - & - & - & - & - \tabularnewline
96 & 84.27 & - & - & - & - & - & - & - \tabularnewline
97 & 83.13 & 84.4162 & 83.0751 & 85.7572 & 0.0301 & 0.5846 & 0.0265 & 0.5846 \tabularnewline
98 & 83.79 & 84.7581 & 82.949 & 86.5672 & 0.1471 & 0.9611 & 0.11 & 0.7015 \tabularnewline
99 & 83.7 & 84.6412 & 82.659 & 86.6233 & 0.176 & 0.8 & 0.0774 & 0.6432 \tabularnewline
100 & 83.76 & 84.4803 & 82.281 & 86.6795 & 0.2605 & 0.7566 & 0.1841 & 0.5743 \tabularnewline
101 & 83.47 & 84.5383 & 82.0716 & 87.0049 & 0.198 & 0.7319 & 0.1276 & 0.5844 \tabularnewline
102 & 83.78 & 84.5465 & 81.8522 & 87.2408 & 0.2886 & 0.7832 & 0.1734 & 0.5797 \tabularnewline
103 & 84.83 & 84.5535 & 81.6556 & 87.4513 & 0.4258 & 0.6996 & 0.0714 & 0.576 \tabularnewline
104 & 84.43 & 84.4637 & 81.3589 & 87.5684 & 0.4915 & 0.4086 & 0.273 & 0.5487 \tabularnewline
105 & 84.9 & 84.3792 & 81.0699 & 87.6884 & 0.3789 & 0.488 & 0.6185 & 0.5258 \tabularnewline
106 & 85.36 & 84.4492 & 80.9447 & 87.9538 & 0.3053 & 0.4005 & 0.2878 & 0.5399 \tabularnewline
107 & 85.49 & 84.4288 & 80.7345 & 88.1232 & 0.2867 & 0.3106 & 0.3125 & 0.5336 \tabularnewline
108 & 85.29 & 84.3621 & 80.4811 & 88.2431 & 0.3197 & 0.2845 & 0.5186 & 0.5186 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114669&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[96])[/C][/ROW]
[ROW][C]84[/C][C]85.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]85.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]85.89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]86.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]85.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]85.97[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]85.84[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]86.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]85.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]83.87[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]85.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]85.35[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]84.27[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]83.13[/C][C]84.4162[/C][C]83.0751[/C][C]85.7572[/C][C]0.0301[/C][C]0.5846[/C][C]0.0265[/C][C]0.5846[/C][/ROW]
[ROW][C]98[/C][C]83.79[/C][C]84.7581[/C][C]82.949[/C][C]86.5672[/C][C]0.1471[/C][C]0.9611[/C][C]0.11[/C][C]0.7015[/C][/ROW]
[ROW][C]99[/C][C]83.7[/C][C]84.6412[/C][C]82.659[/C][C]86.6233[/C][C]0.176[/C][C]0.8[/C][C]0.0774[/C][C]0.6432[/C][/ROW]
[ROW][C]100[/C][C]83.76[/C][C]84.4803[/C][C]82.281[/C][C]86.6795[/C][C]0.2605[/C][C]0.7566[/C][C]0.1841[/C][C]0.5743[/C][/ROW]
[ROW][C]101[/C][C]83.47[/C][C]84.5383[/C][C]82.0716[/C][C]87.0049[/C][C]0.198[/C][C]0.7319[/C][C]0.1276[/C][C]0.5844[/C][/ROW]
[ROW][C]102[/C][C]83.78[/C][C]84.5465[/C][C]81.8522[/C][C]87.2408[/C][C]0.2886[/C][C]0.7832[/C][C]0.1734[/C][C]0.5797[/C][/ROW]
[ROW][C]103[/C][C]84.83[/C][C]84.5535[/C][C]81.6556[/C][C]87.4513[/C][C]0.4258[/C][C]0.6996[/C][C]0.0714[/C][C]0.576[/C][/ROW]
[ROW][C]104[/C][C]84.43[/C][C]84.4637[/C][C]81.3589[/C][C]87.5684[/C][C]0.4915[/C][C]0.4086[/C][C]0.273[/C][C]0.5487[/C][/ROW]
[ROW][C]105[/C][C]84.9[/C][C]84.3792[/C][C]81.0699[/C][C]87.6884[/C][C]0.3789[/C][C]0.488[/C][C]0.6185[/C][C]0.5258[/C][/ROW]
[ROW][C]106[/C][C]85.36[/C][C]84.4492[/C][C]80.9447[/C][C]87.9538[/C][C]0.3053[/C][C]0.4005[/C][C]0.2878[/C][C]0.5399[/C][/ROW]
[ROW][C]107[/C][C]85.49[/C][C]84.4288[/C][C]80.7345[/C][C]88.1232[/C][C]0.2867[/C][C]0.3106[/C][C]0.3125[/C][C]0.5336[/C][/ROW]
[ROW][C]108[/C][C]85.29[/C][C]84.3621[/C][C]80.4811[/C][C]88.2431[/C][C]0.3197[/C][C]0.2845[/C][C]0.5186[/C][C]0.5186[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114669&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114669&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[96])
8485.65-------
8585.74-------
8685.89-------
8786.08-------
8885.49-------
8985.97-------
9085.84-------
9186.72-------
9285.42-------
9383.87-------
9485.45-------
9585.35-------
9684.27-------
9783.1384.416283.075185.75720.03010.58460.02650.5846
9883.7984.758182.94986.56720.14710.96110.110.7015
9983.784.641282.65986.62330.1760.80.07740.6432
10083.7684.480382.28186.67950.26050.75660.18410.5743
10183.4784.538382.071687.00490.1980.73190.12760.5844
10283.7884.546581.852287.24080.28860.78320.17340.5797
10384.8384.553581.655687.45130.42580.69960.07140.576
10484.4384.463781.358987.56840.49150.40860.2730.5487
10584.984.379281.069987.68840.37890.4880.61850.5258
10685.3684.449280.944787.95380.30530.40050.28780.5399
10785.4984.428880.734588.12320.28670.31060.31250.5336
10885.2984.362180.481188.24310.31970.28450.51860.5186







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.0081-0.015201.654200
980.0109-0.01140.01330.93721.29571.1383
990.0119-0.01110.01260.88581.15911.0766
1000.0133-0.00850.01160.51880.9990.9995
1010.0149-0.01260.01181.14121.02741.0136
1020.0163-0.00910.01130.58750.95410.9768
1030.01750.00330.01020.07650.82870.9104
1040.0188-4e-040.0090.00110.72530.8516
1050.020.00620.00860.27120.67480.8215
1060.02120.01080.00890.82950.69030.8308
1070.02230.01260.00921.12610.72990.8544
1080.02350.0110.00930.8610.74080.8607

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.0081 & -0.0152 & 0 & 1.6542 & 0 & 0 \tabularnewline
98 & 0.0109 & -0.0114 & 0.0133 & 0.9372 & 1.2957 & 1.1383 \tabularnewline
99 & 0.0119 & -0.0111 & 0.0126 & 0.8858 & 1.1591 & 1.0766 \tabularnewline
100 & 0.0133 & -0.0085 & 0.0116 & 0.5188 & 0.999 & 0.9995 \tabularnewline
101 & 0.0149 & -0.0126 & 0.0118 & 1.1412 & 1.0274 & 1.0136 \tabularnewline
102 & 0.0163 & -0.0091 & 0.0113 & 0.5875 & 0.9541 & 0.9768 \tabularnewline
103 & 0.0175 & 0.0033 & 0.0102 & 0.0765 & 0.8287 & 0.9104 \tabularnewline
104 & 0.0188 & -4e-04 & 0.009 & 0.0011 & 0.7253 & 0.8516 \tabularnewline
105 & 0.02 & 0.0062 & 0.0086 & 0.2712 & 0.6748 & 0.8215 \tabularnewline
106 & 0.0212 & 0.0108 & 0.0089 & 0.8295 & 0.6903 & 0.8308 \tabularnewline
107 & 0.0223 & 0.0126 & 0.0092 & 1.1261 & 0.7299 & 0.8544 \tabularnewline
108 & 0.0235 & 0.011 & 0.0093 & 0.861 & 0.7408 & 0.8607 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114669&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]97[/C][C]0.0081[/C][C]-0.0152[/C][C]0[/C][C]1.6542[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]98[/C][C]0.0109[/C][C]-0.0114[/C][C]0.0133[/C][C]0.9372[/C][C]1.2957[/C][C]1.1383[/C][/ROW]
[ROW][C]99[/C][C]0.0119[/C][C]-0.0111[/C][C]0.0126[/C][C]0.8858[/C][C]1.1591[/C][C]1.0766[/C][/ROW]
[ROW][C]100[/C][C]0.0133[/C][C]-0.0085[/C][C]0.0116[/C][C]0.5188[/C][C]0.999[/C][C]0.9995[/C][/ROW]
[ROW][C]101[/C][C]0.0149[/C][C]-0.0126[/C][C]0.0118[/C][C]1.1412[/C][C]1.0274[/C][C]1.0136[/C][/ROW]
[ROW][C]102[/C][C]0.0163[/C][C]-0.0091[/C][C]0.0113[/C][C]0.5875[/C][C]0.9541[/C][C]0.9768[/C][/ROW]
[ROW][C]103[/C][C]0.0175[/C][C]0.0033[/C][C]0.0102[/C][C]0.0765[/C][C]0.8287[/C][C]0.9104[/C][/ROW]
[ROW][C]104[/C][C]0.0188[/C][C]-4e-04[/C][C]0.009[/C][C]0.0011[/C][C]0.7253[/C][C]0.8516[/C][/ROW]
[ROW][C]105[/C][C]0.02[/C][C]0.0062[/C][C]0.0086[/C][C]0.2712[/C][C]0.6748[/C][C]0.8215[/C][/ROW]
[ROW][C]106[/C][C]0.0212[/C][C]0.0108[/C][C]0.0089[/C][C]0.8295[/C][C]0.6903[/C][C]0.8308[/C][/ROW]
[ROW][C]107[/C][C]0.0223[/C][C]0.0126[/C][C]0.0092[/C][C]1.1261[/C][C]0.7299[/C][C]0.8544[/C][/ROW]
[ROW][C]108[/C][C]0.0235[/C][C]0.011[/C][C]0.0093[/C][C]0.861[/C][C]0.7408[/C][C]0.8607[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114669&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114669&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
970.0081-0.015201.654200
980.0109-0.01140.01330.93721.29571.1383
990.0119-0.01110.01260.88581.15911.0766
1000.0133-0.00850.01160.51880.9990.9995
1010.0149-0.01260.01181.14121.02741.0136
1020.0163-0.00910.01130.58750.95410.9768
1030.01750.00330.01020.07650.82870.9104
1040.0188-4e-040.0090.00110.72530.8516
1050.020.00620.00860.27120.67480.8215
1060.02120.01080.00890.82950.69030.8308
1070.02230.01260.00921.12610.72990.8544
1080.02350.0110.00930.8610.74080.8607



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