Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 21 Dec 2010 13:22:00 +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/21/t1292937584rln0dg2mjbnr29b.htm/, Retrieved Wed, 15 May 2024 01:17:02 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=113498, Retrieved Wed, 15 May 2024 01:17:02 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact165
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] [test 7] [2010-12-05 11:13:06] [74be16979710d4c4e7c6647856088456]
-   P         [ARIMA Forecasting] [W9 - Blog 9] [2010-12-06 16:23:47] [1aa8d85d6b335d32b1f6be940e33a166]
-   PD            [ARIMA Forecasting] [ARIMA forecast] [2010-12-21 13:22:00] [d41d8cd98f00b204e9800998ecf8427e] [Current]
-                   [ARIMA Forecasting] [Arima forecasting] [2010-12-21 19:49:42] [717f3d787904f94c39256c5c1fc72d4c]
-   PD              [ARIMA Forecasting] [ARIMA forecast] [2010-12-21 20:35:20] [74be16979710d4c4e7c6647856088456]
-                     [ARIMA Forecasting] [Arima forecasting] [2010-12-21 20:52:47] [717f3d787904f94c39256c5c1fc72d4c]
Feedback Forum

Post a new message
Dataseries X:
 1.3031
 1.3241
 1.2961
 1.2865
 1.2305
 1.2101
 1.2125
 1.2350
 1.2014
 1.1992
 1.1791
 1.1832
 1.2159
 1.1922
 1.2114
 1.2614
 1.2812
 1.2786
 1.2772
 1.2815
 1.2679
 1.2765
 1.3247
 1.3191
 1.3029
 1.3234
 1.3354
 1.3651
 1.3453
 1.3534
 1.3706
 1.3638
 1.4268
 1.4485
 1.4635
 1.4587
 1.4876
 1.5189
 1.5783
 1.5633
 1.5554
 1.5757
 1.5593
 1.4660
 1.4065
 1.2759
 1.2705
 1.3954
 1.2793
 1.2694
 1.3282
 1.3230
 1.4135
 1.4042
 1.4253
 1.4322
 1.4632
 1.4713
 1.5016
 1.4318




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=113498&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=113498&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=113498&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[48])
361.4587-------
371.4876-------
381.5189-------
391.5783-------
401.5633-------
411.5554-------
421.5757-------
431.5593-------
441.466-------
451.4065-------
461.2759-------
471.2705-------
481.3954-------
491.27931.38851.31391.46310.00210.42780.00460.4278
501.26941.37651.2711.4820.02330.96450.00410.3627
511.32821.35691.22771.48620.33150.90794e-040.2798
521.3231.3581.20881.50720.32270.65240.00350.3118
531.41351.36281.1961.52960.27560.67990.01180.3507
541.40421.35561.17291.53840.30120.26740.00910.3348
551.42531.35861.16121.5560.25390.32540.02310.3574
561.43221.38791.17691.59890.34040.36420.23410.4723
571.46321.39871.17491.62250.28610.38470.47280.5116
581.47131.43611.20021.6720.38490.41080.90840.6323
591.50161.4361.18851.68340.30160.38980.9050.626
601.43181.39841.13991.65680.39990.21680.5090.509

\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 & 1.4587 & - & - & - & - & - & - & - \tabularnewline
37 & 1.4876 & - & - & - & - & - & - & - \tabularnewline
38 & 1.5189 & - & - & - & - & - & - & - \tabularnewline
39 & 1.5783 & - & - & - & - & - & - & - \tabularnewline
40 & 1.5633 & - & - & - & - & - & - & - \tabularnewline
41 & 1.5554 & - & - & - & - & - & - & - \tabularnewline
42 & 1.5757 & - & - & - & - & - & - & - \tabularnewline
43 & 1.5593 & - & - & - & - & - & - & - \tabularnewline
44 & 1.466 & - & - & - & - & - & - & - \tabularnewline
45 & 1.4065 & - & - & - & - & - & - & - \tabularnewline
46 & 1.2759 & - & - & - & - & - & - & - \tabularnewline
47 & 1.2705 & - & - & - & - & - & - & - \tabularnewline
48 & 1.3954 & - & - & - & - & - & - & - \tabularnewline
49 & 1.2793 & 1.3885 & 1.3139 & 1.4631 & 0.0021 & 0.4278 & 0.0046 & 0.4278 \tabularnewline
50 & 1.2694 & 1.3765 & 1.271 & 1.482 & 0.0233 & 0.9645 & 0.0041 & 0.3627 \tabularnewline
51 & 1.3282 & 1.3569 & 1.2277 & 1.4862 & 0.3315 & 0.9079 & 4e-04 & 0.2798 \tabularnewline
52 & 1.323 & 1.358 & 1.2088 & 1.5072 & 0.3227 & 0.6524 & 0.0035 & 0.3118 \tabularnewline
53 & 1.4135 & 1.3628 & 1.196 & 1.5296 & 0.2756 & 0.6799 & 0.0118 & 0.3507 \tabularnewline
54 & 1.4042 & 1.3556 & 1.1729 & 1.5384 & 0.3012 & 0.2674 & 0.0091 & 0.3348 \tabularnewline
55 & 1.4253 & 1.3586 & 1.1612 & 1.556 & 0.2539 & 0.3254 & 0.0231 & 0.3574 \tabularnewline
56 & 1.4322 & 1.3879 & 1.1769 & 1.5989 & 0.3404 & 0.3642 & 0.2341 & 0.4723 \tabularnewline
57 & 1.4632 & 1.3987 & 1.1749 & 1.6225 & 0.2861 & 0.3847 & 0.4728 & 0.5116 \tabularnewline
58 & 1.4713 & 1.4361 & 1.2002 & 1.672 & 0.3849 & 0.4108 & 0.9084 & 0.6323 \tabularnewline
59 & 1.5016 & 1.436 & 1.1885 & 1.6834 & 0.3016 & 0.3898 & 0.905 & 0.626 \tabularnewline
60 & 1.4318 & 1.3984 & 1.1399 & 1.6568 & 0.3999 & 0.2168 & 0.509 & 0.509 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=113498&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]1.4587[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]1.4876[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]1.5189[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]1.5783[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]1.5633[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]1.5554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]1.5757[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]1.5593[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]1.466[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1.4065[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]1.2759[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]1.2705[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]1.3954[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]1.2793[/C][C]1.3885[/C][C]1.3139[/C][C]1.4631[/C][C]0.0021[/C][C]0.4278[/C][C]0.0046[/C][C]0.4278[/C][/ROW]
[ROW][C]50[/C][C]1.2694[/C][C]1.3765[/C][C]1.271[/C][C]1.482[/C][C]0.0233[/C][C]0.9645[/C][C]0.0041[/C][C]0.3627[/C][/ROW]
[ROW][C]51[/C][C]1.3282[/C][C]1.3569[/C][C]1.2277[/C][C]1.4862[/C][C]0.3315[/C][C]0.9079[/C][C]4e-04[/C][C]0.2798[/C][/ROW]
[ROW][C]52[/C][C]1.323[/C][C]1.358[/C][C]1.2088[/C][C]1.5072[/C][C]0.3227[/C][C]0.6524[/C][C]0.0035[/C][C]0.3118[/C][/ROW]
[ROW][C]53[/C][C]1.4135[/C][C]1.3628[/C][C]1.196[/C][C]1.5296[/C][C]0.2756[/C][C]0.6799[/C][C]0.0118[/C][C]0.3507[/C][/ROW]
[ROW][C]54[/C][C]1.4042[/C][C]1.3556[/C][C]1.1729[/C][C]1.5384[/C][C]0.3012[/C][C]0.2674[/C][C]0.0091[/C][C]0.3348[/C][/ROW]
[ROW][C]55[/C][C]1.4253[/C][C]1.3586[/C][C]1.1612[/C][C]1.556[/C][C]0.2539[/C][C]0.3254[/C][C]0.0231[/C][C]0.3574[/C][/ROW]
[ROW][C]56[/C][C]1.4322[/C][C]1.3879[/C][C]1.1769[/C][C]1.5989[/C][C]0.3404[/C][C]0.3642[/C][C]0.2341[/C][C]0.4723[/C][/ROW]
[ROW][C]57[/C][C]1.4632[/C][C]1.3987[/C][C]1.1749[/C][C]1.6225[/C][C]0.2861[/C][C]0.3847[/C][C]0.4728[/C][C]0.5116[/C][/ROW]
[ROW][C]58[/C][C]1.4713[/C][C]1.4361[/C][C]1.2002[/C][C]1.672[/C][C]0.3849[/C][C]0.4108[/C][C]0.9084[/C][C]0.6323[/C][/ROW]
[ROW][C]59[/C][C]1.5016[/C][C]1.436[/C][C]1.1885[/C][C]1.6834[/C][C]0.3016[/C][C]0.3898[/C][C]0.905[/C][C]0.626[/C][/ROW]
[ROW][C]60[/C][C]1.4318[/C][C]1.3984[/C][C]1.1399[/C][C]1.6568[/C][C]0.3999[/C][C]0.2168[/C][C]0.509[/C][C]0.509[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=113498&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=113498&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])
361.4587-------
371.4876-------
381.5189-------
391.5783-------
401.5633-------
411.5554-------
421.5757-------
431.5593-------
441.466-------
451.4065-------
461.2759-------
471.2705-------
481.3954-------
491.27931.38851.31391.46310.00210.42780.00460.4278
501.26941.37651.2711.4820.02330.96450.00410.3627
511.32821.35691.22771.48620.33150.90794e-040.2798
521.3231.3581.20881.50720.32270.65240.00350.3118
531.41351.36281.1961.52960.27560.67990.01180.3507
541.40421.35561.17291.53840.30120.26740.00910.3348
551.42531.35861.16121.5560.25390.32540.02310.3574
561.43221.38791.17691.59890.34040.36420.23410.4723
571.46321.39871.17491.62250.28610.38470.47280.5116
581.47131.43611.20021.6720.38490.41080.90840.6323
591.50161.4361.18851.68340.30160.38980.9050.626
601.43181.39841.13991.65680.39990.21680.5090.509







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0274-0.078600.011900
500.0391-0.07780.07820.01150.01170.1081
510.0486-0.02120.05928e-040.00810.0898
520.0561-0.02580.05090.00120.00640.0798
530.06250.03720.04810.00260.00560.0749
540.06880.03580.04610.00240.00510.0712
550.07410.04910.04650.00440.0050.0705
560.07760.03190.04470.0020.00460.0678
570.08160.04610.04480.00420.00450.0674
580.08380.02450.04280.00120.00420.0649
590.08790.04570.04310.00430.00420.065
600.09430.02390.04150.00110.0040.063

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0274 & -0.0786 & 0 & 0.0119 & 0 & 0 \tabularnewline
50 & 0.0391 & -0.0778 & 0.0782 & 0.0115 & 0.0117 & 0.1081 \tabularnewline
51 & 0.0486 & -0.0212 & 0.0592 & 8e-04 & 0.0081 & 0.0898 \tabularnewline
52 & 0.0561 & -0.0258 & 0.0509 & 0.0012 & 0.0064 & 0.0798 \tabularnewline
53 & 0.0625 & 0.0372 & 0.0481 & 0.0026 & 0.0056 & 0.0749 \tabularnewline
54 & 0.0688 & 0.0358 & 0.0461 & 0.0024 & 0.0051 & 0.0712 \tabularnewline
55 & 0.0741 & 0.0491 & 0.0465 & 0.0044 & 0.005 & 0.0705 \tabularnewline
56 & 0.0776 & 0.0319 & 0.0447 & 0.002 & 0.0046 & 0.0678 \tabularnewline
57 & 0.0816 & 0.0461 & 0.0448 & 0.0042 & 0.0045 & 0.0674 \tabularnewline
58 & 0.0838 & 0.0245 & 0.0428 & 0.0012 & 0.0042 & 0.0649 \tabularnewline
59 & 0.0879 & 0.0457 & 0.0431 & 0.0043 & 0.0042 & 0.065 \tabularnewline
60 & 0.0943 & 0.0239 & 0.0415 & 0.0011 & 0.004 & 0.063 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=113498&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]0.0274[/C][C]-0.0786[/C][C]0[/C][C]0.0119[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0391[/C][C]-0.0778[/C][C]0.0782[/C][C]0.0115[/C][C]0.0117[/C][C]0.1081[/C][/ROW]
[ROW][C]51[/C][C]0.0486[/C][C]-0.0212[/C][C]0.0592[/C][C]8e-04[/C][C]0.0081[/C][C]0.0898[/C][/ROW]
[ROW][C]52[/C][C]0.0561[/C][C]-0.0258[/C][C]0.0509[/C][C]0.0012[/C][C]0.0064[/C][C]0.0798[/C][/ROW]
[ROW][C]53[/C][C]0.0625[/C][C]0.0372[/C][C]0.0481[/C][C]0.0026[/C][C]0.0056[/C][C]0.0749[/C][/ROW]
[ROW][C]54[/C][C]0.0688[/C][C]0.0358[/C][C]0.0461[/C][C]0.0024[/C][C]0.0051[/C][C]0.0712[/C][/ROW]
[ROW][C]55[/C][C]0.0741[/C][C]0.0491[/C][C]0.0465[/C][C]0.0044[/C][C]0.005[/C][C]0.0705[/C][/ROW]
[ROW][C]56[/C][C]0.0776[/C][C]0.0319[/C][C]0.0447[/C][C]0.002[/C][C]0.0046[/C][C]0.0678[/C][/ROW]
[ROW][C]57[/C][C]0.0816[/C][C]0.0461[/C][C]0.0448[/C][C]0.0042[/C][C]0.0045[/C][C]0.0674[/C][/ROW]
[ROW][C]58[/C][C]0.0838[/C][C]0.0245[/C][C]0.0428[/C][C]0.0012[/C][C]0.0042[/C][C]0.0649[/C][/ROW]
[ROW][C]59[/C][C]0.0879[/C][C]0.0457[/C][C]0.0431[/C][C]0.0043[/C][C]0.0042[/C][C]0.065[/C][/ROW]
[ROW][C]60[/C][C]0.0943[/C][C]0.0239[/C][C]0.0415[/C][C]0.0011[/C][C]0.004[/C][C]0.063[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=113498&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=113498&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
490.0274-0.078600.011900
500.0391-0.07780.07820.01150.01170.1081
510.0486-0.02120.05928e-040.00810.0898
520.0561-0.02580.05090.00120.00640.0798
530.06250.03720.04810.00260.00560.0749
540.06880.03580.04610.00240.00510.0712
550.07410.04910.04650.00440.0050.0705
560.07760.03190.04470.0020.00460.0678
570.08160.04610.04480.00420.00450.0674
580.08380.02450.04280.00120.00420.0649
590.08790.04570.04310.00430.00420.065
600.09430.02390.04150.00110.0040.063



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