Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSun, 09 Dec 2007 06:27:28 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2007/Dec/09/t11972060661nwjc3y01yxxcl8.htm/, Retrieved Wed, 08 May 2024 10:48:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2962, Retrieved Wed, 08 May 2024 10:48:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact271
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2007-12-09 13:27:28] [67794d83edd3193bd9ea9816803ddb96] [Current]
Feedback Forum

Post a new message
Dataseries X:
5329
4903
5826
6006
6552
6748
5633
5361
6631
7078
6100
6376
5571
5512
5461
5704
6420
6344
5624
5322
6098
6303
5581
5491
5108
4585
5545
5145
5888
5925
5715
5595
6160
6163
5906
5045
5130
4743
5438
5698
6333
6340
5635
5948
6199
6023
4540
4315
5161
4433
5199
5582
5936
6391
5647
5827
6101
5777
5511
5036
4468
4053
4821
5138
6102
6029
5365
5717
6150
5737
5268
5307




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2962&T=0

[TABLE]
[ROW][C]Summary of compuational 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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2962&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2962&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[60])
484315-------
495161-------
504433-------
515199-------
525582-------
535936-------
546391-------
555647-------
565827-------
576101-------
585777-------
595511-------
605036-------
6144685352.71494622.57386082.8560.00880.80240.69660.8024
6240534653.75033845.3785462.12270.07260.67380.70380.177
6348215340.50474515.49596165.51350.10860.99890.63160.7653
6451385650.214821.49146478.92860.11290.97510.56410.9268
6561026104.91515275.36126934.4690.49730.98880.65510.9942
6660296375.58015545.83777205.32240.20650.74090.48550.9992
6753655644.55744814.77256474.34230.25450.18190.49770.9247
6857175876.42825046.63376706.22270.35320.88650.54650.9764
6961506140.65925310.86256970.45590.49120.84150.53730.9955
7057375875.47355045.67646705.27070.37180.25840.5920.9763
7152685123.4244293.62675953.22130.36640.07360.180.5818
7253074748.17983918.38255577.97710.09340.10980.24830.2483

\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[60]) \tabularnewline
48 & 4315 & - & - & - & - & - & - & - \tabularnewline
49 & 5161 & - & - & - & - & - & - & - \tabularnewline
50 & 4433 & - & - & - & - & - & - & - \tabularnewline
51 & 5199 & - & - & - & - & - & - & - \tabularnewline
52 & 5582 & - & - & - & - & - & - & - \tabularnewline
53 & 5936 & - & - & - & - & - & - & - \tabularnewline
54 & 6391 & - & - & - & - & - & - & - \tabularnewline
55 & 5647 & - & - & - & - & - & - & - \tabularnewline
56 & 5827 & - & - & - & - & - & - & - \tabularnewline
57 & 6101 & - & - & - & - & - & - & - \tabularnewline
58 & 5777 & - & - & - & - & - & - & - \tabularnewline
59 & 5511 & - & - & - & - & - & - & - \tabularnewline
60 & 5036 & - & - & - & - & - & - & - \tabularnewline
61 & 4468 & 5352.7149 & 4622.5738 & 6082.856 & 0.0088 & 0.8024 & 0.6966 & 0.8024 \tabularnewline
62 & 4053 & 4653.7503 & 3845.378 & 5462.1227 & 0.0726 & 0.6738 & 0.7038 & 0.177 \tabularnewline
63 & 4821 & 5340.5047 & 4515.4959 & 6165.5135 & 0.1086 & 0.9989 & 0.6316 & 0.7653 \tabularnewline
64 & 5138 & 5650.21 & 4821.4914 & 6478.9286 & 0.1129 & 0.9751 & 0.5641 & 0.9268 \tabularnewline
65 & 6102 & 6104.9151 & 5275.3612 & 6934.469 & 0.4973 & 0.9888 & 0.6551 & 0.9942 \tabularnewline
66 & 6029 & 6375.5801 & 5545.8377 & 7205.3224 & 0.2065 & 0.7409 & 0.4855 & 0.9992 \tabularnewline
67 & 5365 & 5644.5574 & 4814.7725 & 6474.3423 & 0.2545 & 0.1819 & 0.4977 & 0.9247 \tabularnewline
68 & 5717 & 5876.4282 & 5046.6337 & 6706.2227 & 0.3532 & 0.8865 & 0.5465 & 0.9764 \tabularnewline
69 & 6150 & 6140.6592 & 5310.8625 & 6970.4559 & 0.4912 & 0.8415 & 0.5373 & 0.9955 \tabularnewline
70 & 5737 & 5875.4735 & 5045.6764 & 6705.2707 & 0.3718 & 0.2584 & 0.592 & 0.9763 \tabularnewline
71 & 5268 & 5123.424 & 4293.6267 & 5953.2213 & 0.3664 & 0.0736 & 0.18 & 0.5818 \tabularnewline
72 & 5307 & 4748.1798 & 3918.3825 & 5577.9771 & 0.0934 & 0.1098 & 0.2483 & 0.2483 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2962&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[60])[/C][/ROW]
[ROW][C]48[/C][C]4315[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]5161[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]4433[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]5199[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]5582[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]5936[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]6391[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]5647[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]5827[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]6101[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]5777[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]5511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]5036[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]4468[/C][C]5352.7149[/C][C]4622.5738[/C][C]6082.856[/C][C]0.0088[/C][C]0.8024[/C][C]0.6966[/C][C]0.8024[/C][/ROW]
[ROW][C]62[/C][C]4053[/C][C]4653.7503[/C][C]3845.378[/C][C]5462.1227[/C][C]0.0726[/C][C]0.6738[/C][C]0.7038[/C][C]0.177[/C][/ROW]
[ROW][C]63[/C][C]4821[/C][C]5340.5047[/C][C]4515.4959[/C][C]6165.5135[/C][C]0.1086[/C][C]0.9989[/C][C]0.6316[/C][C]0.7653[/C][/ROW]
[ROW][C]64[/C][C]5138[/C][C]5650.21[/C][C]4821.4914[/C][C]6478.9286[/C][C]0.1129[/C][C]0.9751[/C][C]0.5641[/C][C]0.9268[/C][/ROW]
[ROW][C]65[/C][C]6102[/C][C]6104.9151[/C][C]5275.3612[/C][C]6934.469[/C][C]0.4973[/C][C]0.9888[/C][C]0.6551[/C][C]0.9942[/C][/ROW]
[ROW][C]66[/C][C]6029[/C][C]6375.5801[/C][C]5545.8377[/C][C]7205.3224[/C][C]0.2065[/C][C]0.7409[/C][C]0.4855[/C][C]0.9992[/C][/ROW]
[ROW][C]67[/C][C]5365[/C][C]5644.5574[/C][C]4814.7725[/C][C]6474.3423[/C][C]0.2545[/C][C]0.1819[/C][C]0.4977[/C][C]0.9247[/C][/ROW]
[ROW][C]68[/C][C]5717[/C][C]5876.4282[/C][C]5046.6337[/C][C]6706.2227[/C][C]0.3532[/C][C]0.8865[/C][C]0.5465[/C][C]0.9764[/C][/ROW]
[ROW][C]69[/C][C]6150[/C][C]6140.6592[/C][C]5310.8625[/C][C]6970.4559[/C][C]0.4912[/C][C]0.8415[/C][C]0.5373[/C][C]0.9955[/C][/ROW]
[ROW][C]70[/C][C]5737[/C][C]5875.4735[/C][C]5045.6764[/C][C]6705.2707[/C][C]0.3718[/C][C]0.2584[/C][C]0.592[/C][C]0.9763[/C][/ROW]
[ROW][C]71[/C][C]5268[/C][C]5123.424[/C][C]4293.6267[/C][C]5953.2213[/C][C]0.3664[/C][C]0.0736[/C][C]0.18[/C][C]0.5818[/C][/ROW]
[ROW][C]72[/C][C]5307[/C][C]4748.1798[/C][C]3918.3825[/C][C]5577.9771[/C][C]0.0934[/C][C]0.1098[/C][C]0.2483[/C][C]0.2483[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2962&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2962&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[60])
484315-------
495161-------
504433-------
515199-------
525582-------
535936-------
546391-------
555647-------
565827-------
576101-------
585777-------
595511-------
605036-------
6144685352.71494622.57386082.8560.00880.80240.69660.8024
6240534653.75033845.3785462.12270.07260.67380.70380.177
6348215340.50474515.49596165.51350.10860.99890.63160.7653
6451385650.214821.49146478.92860.11290.97510.56410.9268
6561026104.91515275.36126934.4690.49730.98880.65510.9942
6660296375.58015545.83777205.32240.20650.74090.48550.9992
6753655644.55744814.77256474.34230.25450.18190.49770.9247
6857175876.42825046.63376706.22270.35320.88650.54650.9764
6961506140.65925310.86256970.45590.49120.84150.53730.9955
7057375875.47355045.67646705.27070.37180.25840.5920.9763
7152685123.4244293.62675953.22130.36640.07360.180.5818
7253074748.17983918.38255577.97710.09340.10980.24830.2483







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0696-0.16530.0138782720.413665226.7011255.3952
620.0886-0.12910.0108360900.976730075.0814173.4217
630.0788-0.09730.0081269885.176422490.4314149.9681
640.0748-0.09070.0076262359.1121863.2592147.8623
650.0693-5e-0408.4980.70820.8415
660.0664-0.05440.0045120117.732910009.8111100.049
670.075-0.04950.004178152.3496512.695780.7013
680.072-0.02710.002325417.36222118.113546.023
690.06890.00151e-0487.25077.27092.6965
700.0721-0.02360.00219174.9191597.909939.9739
710.08260.02820.002420902.21891741.851641.7355
720.08920.11770.0098312279.97226023.331161.3175

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0696 & -0.1653 & 0.0138 & 782720.4136 & 65226.7011 & 255.3952 \tabularnewline
62 & 0.0886 & -0.1291 & 0.0108 & 360900.9767 & 30075.0814 & 173.4217 \tabularnewline
63 & 0.0788 & -0.0973 & 0.0081 & 269885.1764 & 22490.4314 & 149.9681 \tabularnewline
64 & 0.0748 & -0.0907 & 0.0076 & 262359.11 & 21863.2592 & 147.8623 \tabularnewline
65 & 0.0693 & -5e-04 & 0 & 8.498 & 0.7082 & 0.8415 \tabularnewline
66 & 0.0664 & -0.0544 & 0.0045 & 120117.7329 & 10009.8111 & 100.049 \tabularnewline
67 & 0.075 & -0.0495 & 0.0041 & 78152.349 & 6512.6957 & 80.7013 \tabularnewline
68 & 0.072 & -0.0271 & 0.0023 & 25417.3622 & 2118.1135 & 46.023 \tabularnewline
69 & 0.0689 & 0.0015 & 1e-04 & 87.2507 & 7.2709 & 2.6965 \tabularnewline
70 & 0.0721 & -0.0236 & 0.002 & 19174.919 & 1597.9099 & 39.9739 \tabularnewline
71 & 0.0826 & 0.0282 & 0.0024 & 20902.2189 & 1741.8516 & 41.7355 \tabularnewline
72 & 0.0892 & 0.1177 & 0.0098 & 312279.972 & 26023.331 & 161.3175 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2962&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]61[/C][C]0.0696[/C][C]-0.1653[/C][C]0.0138[/C][C]782720.4136[/C][C]65226.7011[/C][C]255.3952[/C][/ROW]
[ROW][C]62[/C][C]0.0886[/C][C]-0.1291[/C][C]0.0108[/C][C]360900.9767[/C][C]30075.0814[/C][C]173.4217[/C][/ROW]
[ROW][C]63[/C][C]0.0788[/C][C]-0.0973[/C][C]0.0081[/C][C]269885.1764[/C][C]22490.4314[/C][C]149.9681[/C][/ROW]
[ROW][C]64[/C][C]0.0748[/C][C]-0.0907[/C][C]0.0076[/C][C]262359.11[/C][C]21863.2592[/C][C]147.8623[/C][/ROW]
[ROW][C]65[/C][C]0.0693[/C][C]-5e-04[/C][C]0[/C][C]8.498[/C][C]0.7082[/C][C]0.8415[/C][/ROW]
[ROW][C]66[/C][C]0.0664[/C][C]-0.0544[/C][C]0.0045[/C][C]120117.7329[/C][C]10009.8111[/C][C]100.049[/C][/ROW]
[ROW][C]67[/C][C]0.075[/C][C]-0.0495[/C][C]0.0041[/C][C]78152.349[/C][C]6512.6957[/C][C]80.7013[/C][/ROW]
[ROW][C]68[/C][C]0.072[/C][C]-0.0271[/C][C]0.0023[/C][C]25417.3622[/C][C]2118.1135[/C][C]46.023[/C][/ROW]
[ROW][C]69[/C][C]0.0689[/C][C]0.0015[/C][C]1e-04[/C][C]87.2507[/C][C]7.2709[/C][C]2.6965[/C][/ROW]
[ROW][C]70[/C][C]0.0721[/C][C]-0.0236[/C][C]0.002[/C][C]19174.919[/C][C]1597.9099[/C][C]39.9739[/C][/ROW]
[ROW][C]71[/C][C]0.0826[/C][C]0.0282[/C][C]0.0024[/C][C]20902.2189[/C][C]1741.8516[/C][C]41.7355[/C][/ROW]
[ROW][C]72[/C][C]0.0892[/C][C]0.1177[/C][C]0.0098[/C][C]312279.972[/C][C]26023.331[/C][C]161.3175[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2962&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2962&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
610.0696-0.16530.0138782720.413665226.7011255.3952
620.0886-0.12910.0108360900.976730075.0814173.4217
630.0788-0.09730.0081269885.176422490.4314149.9681
640.0748-0.09070.0076262359.1121863.2592147.8623
650.0693-5e-0408.4980.70820.8415
660.0664-0.05440.0045120117.732910009.8111100.049
670.075-0.04950.004178152.3496512.695780.7013
680.072-0.02710.002325417.36222118.113546.023
690.06890.00151e-0487.25077.27092.6965
700.0721-0.02360.00219174.9191597.909939.9739
710.08260.02820.002420902.21891741.851641.7355
720.08920.11770.0098312279.97226023.331161.3175



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 0 ; par8 = 1 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 0 ; 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,fx))
(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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')