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 10:04:34 +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/t1293185132y9oyvkcws08j5os.htm/, Retrieved Tue, 30 Apr 2024 00:44:01 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114687, Retrieved Tue, 30 Apr 2024 00:44:01 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact183
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Statistiek Paper 16] [2010-12-24 10:04:34] [97dee3ad7274585c4a7ecb4c981cc7fb] [Current]
Feedback Forum

Post a new message
Dataseries X:
5732
6938
6660
6695
6484
7716
5927
4768
7081
6947
7723
7319
6285
6655
7331
6468
7653
7330
5907
5257
7029
8885
9477
6822
8595
8738
11380
9831
10560
10336
8872
7598
9713
10858
10430
7516
8344
8623
9238
10350
9415
9550
8301
6405
10251
10082
8683
7829
6712
7354
8402
8211
8377
9133
8301
5932
9080
9459
9647
8646
7503
10000
10441
6435
8102
9983
8662
6575
9088
9336
9089




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114687&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114687&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114687&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'RServer@AstonUniversity' @ vre.aston.ac.uk







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[59])
478683-------
487829-------
496712-------
507354-------
518402-------
528211-------
538377-------
549133-------
558301-------
565932-------
579080-------
589459-------
599647-------
6086467985.74076570.89259400.58890.18020.01070.58590.0107
6175038376.16086793.24119959.08040.13980.36910.98030.0578
62100008764.93287030.149310499.71630.08140.9230.94450.1595
631044111035.09169160.708312909.4750.26720.86050.99710.9267
6464359560.49057556.20711564.77390.00110.19460.90650.4663
65810210404.16728277.90512530.42950.01690.99990.96920.7574
66998310638.99738397.383912880.61060.28310.98670.9060.8071
6786629475.18217123.869811826.49440.24890.3360.83620.4431
6865757745.82345289.706910201.940.17510.23240.92610.0646
6990889993.4897436.860812550.11720.24380.99560.75810.6047
70933611048.00528394.670113701.34030.1030.92620.87980.8496
71908911218.93028472.291113965.56920.06430.91050.8690.869

\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[59]) \tabularnewline
47 & 8683 & - & - & - & - & - & - & - \tabularnewline
48 & 7829 & - & - & - & - & - & - & - \tabularnewline
49 & 6712 & - & - & - & - & - & - & - \tabularnewline
50 & 7354 & - & - & - & - & - & - & - \tabularnewline
51 & 8402 & - & - & - & - & - & - & - \tabularnewline
52 & 8211 & - & - & - & - & - & - & - \tabularnewline
53 & 8377 & - & - & - & - & - & - & - \tabularnewline
54 & 9133 & - & - & - & - & - & - & - \tabularnewline
55 & 8301 & - & - & - & - & - & - & - \tabularnewline
56 & 5932 & - & - & - & - & - & - & - \tabularnewline
57 & 9080 & - & - & - & - & - & - & - \tabularnewline
58 & 9459 & - & - & - & - & - & - & - \tabularnewline
59 & 9647 & - & - & - & - & - & - & - \tabularnewline
60 & 8646 & 7985.7407 & 6570.8925 & 9400.5889 & 0.1802 & 0.0107 & 0.5859 & 0.0107 \tabularnewline
61 & 7503 & 8376.1608 & 6793.2411 & 9959.0804 & 0.1398 & 0.3691 & 0.9803 & 0.0578 \tabularnewline
62 & 10000 & 8764.9328 & 7030.1493 & 10499.7163 & 0.0814 & 0.923 & 0.9445 & 0.1595 \tabularnewline
63 & 10441 & 11035.0916 & 9160.7083 & 12909.475 & 0.2672 & 0.8605 & 0.9971 & 0.9267 \tabularnewline
64 & 6435 & 9560.4905 & 7556.207 & 11564.7739 & 0.0011 & 0.1946 & 0.9065 & 0.4663 \tabularnewline
65 & 8102 & 10404.1672 & 8277.905 & 12530.4295 & 0.0169 & 0.9999 & 0.9692 & 0.7574 \tabularnewline
66 & 9983 & 10638.9973 & 8397.3839 & 12880.6106 & 0.2831 & 0.9867 & 0.906 & 0.8071 \tabularnewline
67 & 8662 & 9475.1821 & 7123.8698 & 11826.4944 & 0.2489 & 0.336 & 0.8362 & 0.4431 \tabularnewline
68 & 6575 & 7745.8234 & 5289.7069 & 10201.94 & 0.1751 & 0.2324 & 0.9261 & 0.0646 \tabularnewline
69 & 9088 & 9993.489 & 7436.8608 & 12550.1172 & 0.2438 & 0.9956 & 0.7581 & 0.6047 \tabularnewline
70 & 9336 & 11048.0052 & 8394.6701 & 13701.3403 & 0.103 & 0.9262 & 0.8798 & 0.8496 \tabularnewline
71 & 9089 & 11218.9302 & 8472.2911 & 13965.5692 & 0.0643 & 0.9105 & 0.869 & 0.869 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114687&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[59])[/C][/ROW]
[ROW][C]47[/C][C]8683[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]7829[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]6712[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]7354[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]8402[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]8211[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]8377[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]9133[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]8301[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]5932[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]9080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]9459[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]9647[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]8646[/C][C]7985.7407[/C][C]6570.8925[/C][C]9400.5889[/C][C]0.1802[/C][C]0.0107[/C][C]0.5859[/C][C]0.0107[/C][/ROW]
[ROW][C]61[/C][C]7503[/C][C]8376.1608[/C][C]6793.2411[/C][C]9959.0804[/C][C]0.1398[/C][C]0.3691[/C][C]0.9803[/C][C]0.0578[/C][/ROW]
[ROW][C]62[/C][C]10000[/C][C]8764.9328[/C][C]7030.1493[/C][C]10499.7163[/C][C]0.0814[/C][C]0.923[/C][C]0.9445[/C][C]0.1595[/C][/ROW]
[ROW][C]63[/C][C]10441[/C][C]11035.0916[/C][C]9160.7083[/C][C]12909.475[/C][C]0.2672[/C][C]0.8605[/C][C]0.9971[/C][C]0.9267[/C][/ROW]
[ROW][C]64[/C][C]6435[/C][C]9560.4905[/C][C]7556.207[/C][C]11564.7739[/C][C]0.0011[/C][C]0.1946[/C][C]0.9065[/C][C]0.4663[/C][/ROW]
[ROW][C]65[/C][C]8102[/C][C]10404.1672[/C][C]8277.905[/C][C]12530.4295[/C][C]0.0169[/C][C]0.9999[/C][C]0.9692[/C][C]0.7574[/C][/ROW]
[ROW][C]66[/C][C]9983[/C][C]10638.9973[/C][C]8397.3839[/C][C]12880.6106[/C][C]0.2831[/C][C]0.9867[/C][C]0.906[/C][C]0.8071[/C][/ROW]
[ROW][C]67[/C][C]8662[/C][C]9475.1821[/C][C]7123.8698[/C][C]11826.4944[/C][C]0.2489[/C][C]0.336[/C][C]0.8362[/C][C]0.4431[/C][/ROW]
[ROW][C]68[/C][C]6575[/C][C]7745.8234[/C][C]5289.7069[/C][C]10201.94[/C][C]0.1751[/C][C]0.2324[/C][C]0.9261[/C][C]0.0646[/C][/ROW]
[ROW][C]69[/C][C]9088[/C][C]9993.489[/C][C]7436.8608[/C][C]12550.1172[/C][C]0.2438[/C][C]0.9956[/C][C]0.7581[/C][C]0.6047[/C][/ROW]
[ROW][C]70[/C][C]9336[/C][C]11048.0052[/C][C]8394.6701[/C][C]13701.3403[/C][C]0.103[/C][C]0.9262[/C][C]0.8798[/C][C]0.8496[/C][/ROW]
[ROW][C]71[/C][C]9089[/C][C]11218.9302[/C][C]8472.2911[/C][C]13965.5692[/C][C]0.0643[/C][C]0.9105[/C][C]0.869[/C][C]0.869[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114687&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114687&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[59])
478683-------
487829-------
496712-------
507354-------
518402-------
528211-------
538377-------
549133-------
558301-------
565932-------
579080-------
589459-------
599647-------
6086467985.74076570.89259400.58890.18020.01070.58590.0107
6175038376.16086793.24119959.08040.13980.36910.98030.0578
62100008764.93287030.149310499.71630.08140.9230.94450.1595
631044111035.09169160.708312909.4750.26720.86050.99710.9267
6464359560.49057556.20711564.77390.00110.19460.90650.4663
65810210404.16728277.90512530.42950.01690.99990.96920.7574
66998310638.99738397.383912880.61060.28310.98670.9060.8071
6786629475.18217123.869811826.49440.24890.3360.83620.4431
6865757745.82345289.706910201.940.17510.23240.92610.0646
6990889993.4897436.860812550.11720.24380.99560.75810.6047
70933611048.00528394.670113701.34030.1030.92620.87980.8496
71908911218.93028472.291113965.56920.06430.91050.8690.869







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
600.09040.08270435942.375300
610.0964-0.10420.0935762409.7384599176.0569774.0646
620.1010.14090.10931525391.0958907914.4032952.8454
630.0867-0.05380.0954352944.8771769172.0216877.0245
640.107-0.32690.14179768690.64622569075.74661602.8337
650.1043-0.22130.1555299973.99753024225.45511739.03
660.1075-0.06170.1416430332.42612653669.30811629.0087
670.1266-0.08580.1347661265.19182404618.79351550.6833
680.1618-0.15120.13651370827.50642289753.0951513.193
690.1305-0.09060.1319819910.31472142768.81691463.8199
700.1225-0.1550.1342930961.78862214422.72341488.0937
710.1249-0.18990.13874536602.47572407937.70281551.7531

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
60 & 0.0904 & 0.0827 & 0 & 435942.3753 & 0 & 0 \tabularnewline
61 & 0.0964 & -0.1042 & 0.0935 & 762409.7384 & 599176.0569 & 774.0646 \tabularnewline
62 & 0.101 & 0.1409 & 0.1093 & 1525391.0958 & 907914.4032 & 952.8454 \tabularnewline
63 & 0.0867 & -0.0538 & 0.0954 & 352944.8771 & 769172.0216 & 877.0245 \tabularnewline
64 & 0.107 & -0.3269 & 0.1417 & 9768690.6462 & 2569075.7466 & 1602.8337 \tabularnewline
65 & 0.1043 & -0.2213 & 0.155 & 5299973.9975 & 3024225.4551 & 1739.03 \tabularnewline
66 & 0.1075 & -0.0617 & 0.1416 & 430332.4261 & 2653669.3081 & 1629.0087 \tabularnewline
67 & 0.1266 & -0.0858 & 0.1347 & 661265.1918 & 2404618.7935 & 1550.6833 \tabularnewline
68 & 0.1618 & -0.1512 & 0.1365 & 1370827.5064 & 2289753.095 & 1513.193 \tabularnewline
69 & 0.1305 & -0.0906 & 0.1319 & 819910.3147 & 2142768.8169 & 1463.8199 \tabularnewline
70 & 0.1225 & -0.155 & 0.134 & 2930961.7886 & 2214422.7234 & 1488.0937 \tabularnewline
71 & 0.1249 & -0.1899 & 0.1387 & 4536602.4757 & 2407937.7028 & 1551.7531 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114687&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]60[/C][C]0.0904[/C][C]0.0827[/C][C]0[/C][C]435942.3753[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]61[/C][C]0.0964[/C][C]-0.1042[/C][C]0.0935[/C][C]762409.7384[/C][C]599176.0569[/C][C]774.0646[/C][/ROW]
[ROW][C]62[/C][C]0.101[/C][C]0.1409[/C][C]0.1093[/C][C]1525391.0958[/C][C]907914.4032[/C][C]952.8454[/C][/ROW]
[ROW][C]63[/C][C]0.0867[/C][C]-0.0538[/C][C]0.0954[/C][C]352944.8771[/C][C]769172.0216[/C][C]877.0245[/C][/ROW]
[ROW][C]64[/C][C]0.107[/C][C]-0.3269[/C][C]0.1417[/C][C]9768690.6462[/C][C]2569075.7466[/C][C]1602.8337[/C][/ROW]
[ROW][C]65[/C][C]0.1043[/C][C]-0.2213[/C][C]0.155[/C][C]5299973.9975[/C][C]3024225.4551[/C][C]1739.03[/C][/ROW]
[ROW][C]66[/C][C]0.1075[/C][C]-0.0617[/C][C]0.1416[/C][C]430332.4261[/C][C]2653669.3081[/C][C]1629.0087[/C][/ROW]
[ROW][C]67[/C][C]0.1266[/C][C]-0.0858[/C][C]0.1347[/C][C]661265.1918[/C][C]2404618.7935[/C][C]1550.6833[/C][/ROW]
[ROW][C]68[/C][C]0.1618[/C][C]-0.1512[/C][C]0.1365[/C][C]1370827.5064[/C][C]2289753.095[/C][C]1513.193[/C][/ROW]
[ROW][C]69[/C][C]0.1305[/C][C]-0.0906[/C][C]0.1319[/C][C]819910.3147[/C][C]2142768.8169[/C][C]1463.8199[/C][/ROW]
[ROW][C]70[/C][C]0.1225[/C][C]-0.155[/C][C]0.134[/C][C]2930961.7886[/C][C]2214422.7234[/C][C]1488.0937[/C][/ROW]
[ROW][C]71[/C][C]0.1249[/C][C]-0.1899[/C][C]0.1387[/C][C]4536602.4757[/C][C]2407937.7028[/C][C]1551.7531[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114687&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114687&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
600.09040.08270435942.375300
610.0964-0.10420.0935762409.7384599176.0569774.0646
620.1010.14090.10931525391.0958907914.4032952.8454
630.0867-0.05380.0954352944.8771769172.0216877.0245
640.107-0.32690.14179768690.64622569075.74661602.8337
650.1043-0.22130.1555299973.99753024225.45511739.03
660.1075-0.06170.1416430332.42612653669.30811629.0087
670.1266-0.08580.1347661265.19182404618.79351550.6833
680.1618-0.15120.13651370827.50642289753.0951513.193
690.1305-0.09060.1319819910.31472142768.81691463.8199
700.1225-0.1550.1342930961.78862214422.72341488.0937
710.1249-0.18990.13874536602.47572407937.70281551.7531



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