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 computationSun, 12 Dec 2010 08:24:17 +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/12/t129214216057psphaetqc1gvv.htm/, Retrieved Tue, 07 May 2024 23:45:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=108327, Retrieved Tue, 07 May 2024 23:45:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact180
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima forecasting...] [2010-12-12 08:24:17] [60147a93d53c93401a082f47876e6cb5] [Current]
-   P     [ARIMA Forecasting] [Arima forecasting...] [2010-12-14 19:29:10] [05ab9592748364013445d860bb938e43]
Feedback Forum

Post a new message
Dataseries X:
4143
4429
5219
4929
5761
5592
4163
4962
5208
4755
4491
5732
5731
5040
6102
4904
5369
5578
4619
4731
5011
5299
4146
4625
4736
4219
5116
4205
4121
5103
4300
4578
3809
5657
4248
3830
4736
4839
4411
4570
4104
4801
3953
3828
4440
4026
4109
4785
3224
3552
3940
3913
3681
4309
3830
4143
4087
3818
3380
3430
3458
3970
5260
5024
5634
6549
4676




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time16 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 16 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=108327&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]16 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=108327&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=108327&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 time16 seconds
R Server'George Udny Yule' @ 72.249.76.132







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[55])
433953-------
443828-------
454440-------
464026-------
474109-------
484785-------
493224-------
503552-------
513940-------
523913-------
533681-------
544309-------
553830-------
5641433817.71542859.88324775.54760.25280.490.49160.49
5740873933.54982970.51834896.58130.37740.3350.15130.5835
5838184029.19543064.47814993.91280.33390.45330.50260.6572
5933803907.34552849.91944964.77160.16420.56580.35430.557
6034304072.18522994.97535149.3950.12130.89610.09730.6703
6134583973.45522888.3635058.54730.17590.83690.91210.6022
6239703986.33472865.34265107.32680.48860.82220.77620.6077
6352603956.98662813.46465100.50860.01280.49110.51160.5862
6450243964.29152804.03495124.5480.03670.01430.53450.5897
6556343838.34212653.74135022.94280.00150.02490.60270.5055
6665493976.33932770.18995182.488700.00350.29440.594
6746763884.0392659.1515108.92710.102500.53450.5345

\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[55]) \tabularnewline
43 & 3953 & - & - & - & - & - & - & - \tabularnewline
44 & 3828 & - & - & - & - & - & - & - \tabularnewline
45 & 4440 & - & - & - & - & - & - & - \tabularnewline
46 & 4026 & - & - & - & - & - & - & - \tabularnewline
47 & 4109 & - & - & - & - & - & - & - \tabularnewline
48 & 4785 & - & - & - & - & - & - & - \tabularnewline
49 & 3224 & - & - & - & - & - & - & - \tabularnewline
50 & 3552 & - & - & - & - & - & - & - \tabularnewline
51 & 3940 & - & - & - & - & - & - & - \tabularnewline
52 & 3913 & - & - & - & - & - & - & - \tabularnewline
53 & 3681 & - & - & - & - & - & - & - \tabularnewline
54 & 4309 & - & - & - & - & - & - & - \tabularnewline
55 & 3830 & - & - & - & - & - & - & - \tabularnewline
56 & 4143 & 3817.7154 & 2859.8832 & 4775.5476 & 0.2528 & 0.49 & 0.4916 & 0.49 \tabularnewline
57 & 4087 & 3933.5498 & 2970.5183 & 4896.5813 & 0.3774 & 0.335 & 0.1513 & 0.5835 \tabularnewline
58 & 3818 & 4029.1954 & 3064.4781 & 4993.9128 & 0.3339 & 0.4533 & 0.5026 & 0.6572 \tabularnewline
59 & 3380 & 3907.3455 & 2849.9194 & 4964.7716 & 0.1642 & 0.5658 & 0.3543 & 0.557 \tabularnewline
60 & 3430 & 4072.1852 & 2994.9753 & 5149.395 & 0.1213 & 0.8961 & 0.0973 & 0.6703 \tabularnewline
61 & 3458 & 3973.4552 & 2888.363 & 5058.5473 & 0.1759 & 0.8369 & 0.9121 & 0.6022 \tabularnewline
62 & 3970 & 3986.3347 & 2865.3426 & 5107.3268 & 0.4886 & 0.8222 & 0.7762 & 0.6077 \tabularnewline
63 & 5260 & 3956.9866 & 2813.4646 & 5100.5086 & 0.0128 & 0.4911 & 0.5116 & 0.5862 \tabularnewline
64 & 5024 & 3964.2915 & 2804.0349 & 5124.548 & 0.0367 & 0.0143 & 0.5345 & 0.5897 \tabularnewline
65 & 5634 & 3838.3421 & 2653.7413 & 5022.9428 & 0.0015 & 0.0249 & 0.6027 & 0.5055 \tabularnewline
66 & 6549 & 3976.3393 & 2770.1899 & 5182.4887 & 0 & 0.0035 & 0.2944 & 0.594 \tabularnewline
67 & 4676 & 3884.039 & 2659.151 & 5108.9271 & 0.1025 & 0 & 0.5345 & 0.5345 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=108327&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[55])[/C][/ROW]
[ROW][C]43[/C][C]3953[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3828[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4440[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4026[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4109[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4785[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]3224[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]3552[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]3940[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]3913[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]3681[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]4309[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]3830[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]4143[/C][C]3817.7154[/C][C]2859.8832[/C][C]4775.5476[/C][C]0.2528[/C][C]0.49[/C][C]0.4916[/C][C]0.49[/C][/ROW]
[ROW][C]57[/C][C]4087[/C][C]3933.5498[/C][C]2970.5183[/C][C]4896.5813[/C][C]0.3774[/C][C]0.335[/C][C]0.1513[/C][C]0.5835[/C][/ROW]
[ROW][C]58[/C][C]3818[/C][C]4029.1954[/C][C]3064.4781[/C][C]4993.9128[/C][C]0.3339[/C][C]0.4533[/C][C]0.5026[/C][C]0.6572[/C][/ROW]
[ROW][C]59[/C][C]3380[/C][C]3907.3455[/C][C]2849.9194[/C][C]4964.7716[/C][C]0.1642[/C][C]0.5658[/C][C]0.3543[/C][C]0.557[/C][/ROW]
[ROW][C]60[/C][C]3430[/C][C]4072.1852[/C][C]2994.9753[/C][C]5149.395[/C][C]0.1213[/C][C]0.8961[/C][C]0.0973[/C][C]0.6703[/C][/ROW]
[ROW][C]61[/C][C]3458[/C][C]3973.4552[/C][C]2888.363[/C][C]5058.5473[/C][C]0.1759[/C][C]0.8369[/C][C]0.9121[/C][C]0.6022[/C][/ROW]
[ROW][C]62[/C][C]3970[/C][C]3986.3347[/C][C]2865.3426[/C][C]5107.3268[/C][C]0.4886[/C][C]0.8222[/C][C]0.7762[/C][C]0.6077[/C][/ROW]
[ROW][C]63[/C][C]5260[/C][C]3956.9866[/C][C]2813.4646[/C][C]5100.5086[/C][C]0.0128[/C][C]0.4911[/C][C]0.5116[/C][C]0.5862[/C][/ROW]
[ROW][C]64[/C][C]5024[/C][C]3964.2915[/C][C]2804.0349[/C][C]5124.548[/C][C]0.0367[/C][C]0.0143[/C][C]0.5345[/C][C]0.5897[/C][/ROW]
[ROW][C]65[/C][C]5634[/C][C]3838.3421[/C][C]2653.7413[/C][C]5022.9428[/C][C]0.0015[/C][C]0.0249[/C][C]0.6027[/C][C]0.5055[/C][/ROW]
[ROW][C]66[/C][C]6549[/C][C]3976.3393[/C][C]2770.1899[/C][C]5182.4887[/C][C]0[/C][C]0.0035[/C][C]0.2944[/C][C]0.594[/C][/ROW]
[ROW][C]67[/C][C]4676[/C][C]3884.039[/C][C]2659.151[/C][C]5108.9271[/C][C]0.1025[/C][C]0[/C][C]0.5345[/C][C]0.5345[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=108327&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=108327&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[55])
433953-------
443828-------
454440-------
464026-------
474109-------
484785-------
493224-------
503552-------
513940-------
523913-------
533681-------
544309-------
553830-------
5641433817.71542859.88324775.54760.25280.490.49160.49
5740873933.54982970.51834896.58130.37740.3350.15130.5835
5838184029.19543064.47814993.91280.33390.45330.50260.6572
5933803907.34552849.91944964.77160.16420.56580.35430.557
6034304072.18522994.97535149.3950.12130.89610.09730.6703
6134583973.45522888.3635058.54730.17590.83690.91210.6022
6239703986.33472865.34265107.32680.48860.82220.77620.6077
6352603956.98662813.46465100.50860.01280.49110.51160.5862
6450243964.29152804.03495124.5480.03670.01430.53450.5897
6556343838.34212653.74135022.94280.00150.02490.60270.5055
6665493976.33932770.18995182.488700.00350.29440.594
6746763884.0392659.1515108.92710.102500.53450.5345







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.1280.08520105810.061700
570.12490.0390.062123546.958864678.5102254.3197
580.1222-0.05240.058944603.516257986.8455240.8046
590.1381-0.1350.0779278093.2955113013.458336.1747
600.135-0.15770.0939412401.7869172891.1238415.8018
610.1393-0.12970.0998265694.0414188358.2767434.0026
620.1435-0.00410.0862266.8221161488.0689401.8558
630.14740.32930.11661697843.856353532.5423594.586
640.14930.26730.13331122982.192439026.9478662.5911
650.15750.46780.16683224387.4097717562.994847.0909
660.15480.6470.21046618583.28851254019.38441119.8301
670.16090.20390.2099627202.16361201784.6161096.2594

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.128 & 0.0852 & 0 & 105810.0617 & 0 & 0 \tabularnewline
57 & 0.1249 & 0.039 & 0.0621 & 23546.9588 & 64678.5102 & 254.3197 \tabularnewline
58 & 0.1222 & -0.0524 & 0.0589 & 44603.5162 & 57986.8455 & 240.8046 \tabularnewline
59 & 0.1381 & -0.135 & 0.0779 & 278093.2955 & 113013.458 & 336.1747 \tabularnewline
60 & 0.135 & -0.1577 & 0.0939 & 412401.7869 & 172891.1238 & 415.8018 \tabularnewline
61 & 0.1393 & -0.1297 & 0.0998 & 265694.0414 & 188358.2767 & 434.0026 \tabularnewline
62 & 0.1435 & -0.0041 & 0.0862 & 266.8221 & 161488.0689 & 401.8558 \tabularnewline
63 & 0.1474 & 0.3293 & 0.1166 & 1697843.856 & 353532.5423 & 594.586 \tabularnewline
64 & 0.1493 & 0.2673 & 0.1333 & 1122982.192 & 439026.9478 & 662.5911 \tabularnewline
65 & 0.1575 & 0.4678 & 0.1668 & 3224387.4097 & 717562.994 & 847.0909 \tabularnewline
66 & 0.1548 & 0.647 & 0.2104 & 6618583.2885 & 1254019.3844 & 1119.8301 \tabularnewline
67 & 0.1609 & 0.2039 & 0.2099 & 627202.1636 & 1201784.616 & 1096.2594 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=108327&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]56[/C][C]0.128[/C][C]0.0852[/C][C]0[/C][C]105810.0617[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]0.1249[/C][C]0.039[/C][C]0.0621[/C][C]23546.9588[/C][C]64678.5102[/C][C]254.3197[/C][/ROW]
[ROW][C]58[/C][C]0.1222[/C][C]-0.0524[/C][C]0.0589[/C][C]44603.5162[/C][C]57986.8455[/C][C]240.8046[/C][/ROW]
[ROW][C]59[/C][C]0.1381[/C][C]-0.135[/C][C]0.0779[/C][C]278093.2955[/C][C]113013.458[/C][C]336.1747[/C][/ROW]
[ROW][C]60[/C][C]0.135[/C][C]-0.1577[/C][C]0.0939[/C][C]412401.7869[/C][C]172891.1238[/C][C]415.8018[/C][/ROW]
[ROW][C]61[/C][C]0.1393[/C][C]-0.1297[/C][C]0.0998[/C][C]265694.0414[/C][C]188358.2767[/C][C]434.0026[/C][/ROW]
[ROW][C]62[/C][C]0.1435[/C][C]-0.0041[/C][C]0.0862[/C][C]266.8221[/C][C]161488.0689[/C][C]401.8558[/C][/ROW]
[ROW][C]63[/C][C]0.1474[/C][C]0.3293[/C][C]0.1166[/C][C]1697843.856[/C][C]353532.5423[/C][C]594.586[/C][/ROW]
[ROW][C]64[/C][C]0.1493[/C][C]0.2673[/C][C]0.1333[/C][C]1122982.192[/C][C]439026.9478[/C][C]662.5911[/C][/ROW]
[ROW][C]65[/C][C]0.1575[/C][C]0.4678[/C][C]0.1668[/C][C]3224387.4097[/C][C]717562.994[/C][C]847.0909[/C][/ROW]
[ROW][C]66[/C][C]0.1548[/C][C]0.647[/C][C]0.2104[/C][C]6618583.2885[/C][C]1254019.3844[/C][C]1119.8301[/C][/ROW]
[ROW][C]67[/C][C]0.1609[/C][C]0.2039[/C][C]0.2099[/C][C]627202.1636[/C][C]1201784.616[/C][C]1096.2594[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=108327&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=108327&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
560.1280.08520105810.061700
570.12490.0390.062123546.958864678.5102254.3197
580.1222-0.05240.058944603.516257986.8455240.8046
590.1381-0.1350.0779278093.2955113013.458336.1747
600.135-0.15770.0939412401.7869172891.1238415.8018
610.1393-0.12970.0998265694.0414188358.2767434.0026
620.1435-0.00410.0862266.8221161488.0689401.8558
630.14740.32930.11661697843.856353532.5423594.586
640.14930.26730.13331122982.192439026.9478662.5911
650.15750.46780.16683224387.4097717562.994847.0909
660.15480.6470.21046618583.28851254019.38441119.8301
670.16090.20390.2099627202.16361201784.6161096.2594



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