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 computationWed, 29 Dec 2010 12:17:38 +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/29/t12936249987em7ssdnkccb9rv.htm/, Retrieved Fri, 03 May 2024 05:44:12 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=116742, Retrieved Fri, 03 May 2024 05:44:12 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact120
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2010-12-29 12:17:38] [807767cb161ee2c684ed2293f773f12d] [Current]
Feedback Forum

Post a new message
Dataseries X:
11100
8962
9173
8738
8459
8078
8411
8291
7810
8616
8312
9692
9911
8915
9452
9112
8472
8230
8384
8625
8221
8649
8625
10443
10357
8586
8892
8329
8101
7922
8120
7838
7735
8406
8209
9451
10041
9411
10405
8467
8464
8102
7627
7513
7510
8291
8064
9383
9706
8579
9474
8318
8213
8059
9111
7708
7680
8014
8007
8718
9486
9113
9025
8476
7952
7759
7835
7600
7651
8319
8812
8630




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116742&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]1 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=116742&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116742&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 time1 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[60])
489383-------
499706-------
508579-------
519474-------
528318-------
538213-------
548059-------
559111-------
567708-------
577680-------
588014-------
598007-------
608718-------
6194869544.18868768.783210319.5940.44150.98160.34130.9816
6291138883.84348014.3149753.37270.30270.08730.7540.6457
6390259926.09769033.936910818.25830.02390.9630.83970.996
6484768358.36157460.46549256.25760.39870.07280.53510.2162
6579528336.00057436.63349235.36750.20130.38010.60570.2026
6677598072.10057172.3558971.8460.24760.60320.51140.0797
6778358237.46397337.6219137.30680.19030.85130.02850.1476
6876007590.91956691.05168490.78750.49210.29750.39940.007
6976517579.05896679.18448478.93330.43770.48180.4130.0066
7083198175.11447275.23839074.99050.3770.87320.63720.1185
7188128039.91287140.03628939.78930.04630.27160.52860.0698
7286309106.50118206.624510006.37780.14970.73940.80130.8013

\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 & 9383 & - & - & - & - & - & - & - \tabularnewline
49 & 9706 & - & - & - & - & - & - & - \tabularnewline
50 & 8579 & - & - & - & - & - & - & - \tabularnewline
51 & 9474 & - & - & - & - & - & - & - \tabularnewline
52 & 8318 & - & - & - & - & - & - & - \tabularnewline
53 & 8213 & - & - & - & - & - & - & - \tabularnewline
54 & 8059 & - & - & - & - & - & - & - \tabularnewline
55 & 9111 & - & - & - & - & - & - & - \tabularnewline
56 & 7708 & - & - & - & - & - & - & - \tabularnewline
57 & 7680 & - & - & - & - & - & - & - \tabularnewline
58 & 8014 & - & - & - & - & - & - & - \tabularnewline
59 & 8007 & - & - & - & - & - & - & - \tabularnewline
60 & 8718 & - & - & - & - & - & - & - \tabularnewline
61 & 9486 & 9544.1886 & 8768.7832 & 10319.594 & 0.4415 & 0.9816 & 0.3413 & 0.9816 \tabularnewline
62 & 9113 & 8883.8434 & 8014.314 & 9753.3727 & 0.3027 & 0.0873 & 0.754 & 0.6457 \tabularnewline
63 & 9025 & 9926.0976 & 9033.9369 & 10818.2583 & 0.0239 & 0.963 & 0.8397 & 0.996 \tabularnewline
64 & 8476 & 8358.3615 & 7460.4654 & 9256.2576 & 0.3987 & 0.0728 & 0.5351 & 0.2162 \tabularnewline
65 & 7952 & 8336.0005 & 7436.6334 & 9235.3675 & 0.2013 & 0.3801 & 0.6057 & 0.2026 \tabularnewline
66 & 7759 & 8072.1005 & 7172.355 & 8971.846 & 0.2476 & 0.6032 & 0.5114 & 0.0797 \tabularnewline
67 & 7835 & 8237.4639 & 7337.621 & 9137.3068 & 0.1903 & 0.8513 & 0.0285 & 0.1476 \tabularnewline
68 & 7600 & 7590.9195 & 6691.0516 & 8490.7875 & 0.4921 & 0.2975 & 0.3994 & 0.007 \tabularnewline
69 & 7651 & 7579.0589 & 6679.1844 & 8478.9333 & 0.4377 & 0.4818 & 0.413 & 0.0066 \tabularnewline
70 & 8319 & 8175.1144 & 7275.2383 & 9074.9905 & 0.377 & 0.8732 & 0.6372 & 0.1185 \tabularnewline
71 & 8812 & 8039.9128 & 7140.0362 & 8939.7893 & 0.0463 & 0.2716 & 0.5286 & 0.0698 \tabularnewline
72 & 8630 & 9106.5011 & 8206.6245 & 10006.3778 & 0.1497 & 0.7394 & 0.8013 & 0.8013 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116742&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]9383[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]9706[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]8579[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]9474[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]8318[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]8213[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]8059[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]9111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]7708[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]7680[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]8014[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]8007[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]8718[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]9486[/C][C]9544.1886[/C][C]8768.7832[/C][C]10319.594[/C][C]0.4415[/C][C]0.9816[/C][C]0.3413[/C][C]0.9816[/C][/ROW]
[ROW][C]62[/C][C]9113[/C][C]8883.8434[/C][C]8014.314[/C][C]9753.3727[/C][C]0.3027[/C][C]0.0873[/C][C]0.754[/C][C]0.6457[/C][/ROW]
[ROW][C]63[/C][C]9025[/C][C]9926.0976[/C][C]9033.9369[/C][C]10818.2583[/C][C]0.0239[/C][C]0.963[/C][C]0.8397[/C][C]0.996[/C][/ROW]
[ROW][C]64[/C][C]8476[/C][C]8358.3615[/C][C]7460.4654[/C][C]9256.2576[/C][C]0.3987[/C][C]0.0728[/C][C]0.5351[/C][C]0.2162[/C][/ROW]
[ROW][C]65[/C][C]7952[/C][C]8336.0005[/C][C]7436.6334[/C][C]9235.3675[/C][C]0.2013[/C][C]0.3801[/C][C]0.6057[/C][C]0.2026[/C][/ROW]
[ROW][C]66[/C][C]7759[/C][C]8072.1005[/C][C]7172.355[/C][C]8971.846[/C][C]0.2476[/C][C]0.6032[/C][C]0.5114[/C][C]0.0797[/C][/ROW]
[ROW][C]67[/C][C]7835[/C][C]8237.4639[/C][C]7337.621[/C][C]9137.3068[/C][C]0.1903[/C][C]0.8513[/C][C]0.0285[/C][C]0.1476[/C][/ROW]
[ROW][C]68[/C][C]7600[/C][C]7590.9195[/C][C]6691.0516[/C][C]8490.7875[/C][C]0.4921[/C][C]0.2975[/C][C]0.3994[/C][C]0.007[/C][/ROW]
[ROW][C]69[/C][C]7651[/C][C]7579.0589[/C][C]6679.1844[/C][C]8478.9333[/C][C]0.4377[/C][C]0.4818[/C][C]0.413[/C][C]0.0066[/C][/ROW]
[ROW][C]70[/C][C]8319[/C][C]8175.1144[/C][C]7275.2383[/C][C]9074.9905[/C][C]0.377[/C][C]0.8732[/C][C]0.6372[/C][C]0.1185[/C][/ROW]
[ROW][C]71[/C][C]8812[/C][C]8039.9128[/C][C]7140.0362[/C][C]8939.7893[/C][C]0.0463[/C][C]0.2716[/C][C]0.5286[/C][C]0.0698[/C][/ROW]
[ROW][C]72[/C][C]8630[/C][C]9106.5011[/C][C]8206.6245[/C][C]10006.3778[/C][C]0.1497[/C][C]0.7394[/C][C]0.8013[/C][C]0.8013[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116742&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116742&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])
489383-------
499706-------
508579-------
519474-------
528318-------
538213-------
548059-------
559111-------
567708-------
577680-------
588014-------
598007-------
608718-------
6194869544.18868768.783210319.5940.44150.98160.34130.9816
6291138883.84348014.3149753.37270.30270.08730.7540.6457
6390259926.09769033.936910818.25830.02390.9630.83970.996
6484768358.36157460.46549256.25760.39870.07280.53510.2162
6579528336.00057436.63349235.36750.20130.38010.60570.2026
6677598072.10057172.3558971.8460.24760.60320.51140.0797
6778358237.46397337.6219137.30680.19030.85130.02850.1476
6876007590.91956691.05168490.78750.49210.29750.39940.007
6976517579.05896679.18448478.93330.43770.48180.4130.0066
7083198175.11447275.23839074.99050.3770.87320.63720.1185
7188128039.91287140.03628939.78930.04630.27160.52860.0698
7286309106.50118206.624510006.37780.14970.73940.80130.8013







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0415-0.006103385.914900
620.04990.02580.015952512.75927949.3369167.1806
630.0459-0.09080.0409811976.901289291.8583537.8586
640.05480.01410.034213838.8145220428.5973469.4982
650.055-0.04610.0366147456.3595205834.1498453.6895
660.0569-0.03880.036998031.9219187867.1118433.4364
670.0557-0.04890.0386161977.1728184168.5491429.1486
680.06050.00120.03482.4549161157.7873401.4446
690.06060.00950.03125175.5243143826.4247379.2445
700.05620.01760.029920703.0655131514.0888362.6487
710.05710.0960.0359596118.6835173750.8702416.8343
720.0504-0.05230.0373227053.3189178192.7409422.1288

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0415 & -0.0061 & 0 & 3385.9149 & 0 & 0 \tabularnewline
62 & 0.0499 & 0.0258 & 0.0159 & 52512.759 & 27949.3369 & 167.1806 \tabularnewline
63 & 0.0459 & -0.0908 & 0.0409 & 811976.901 & 289291.8583 & 537.8586 \tabularnewline
64 & 0.0548 & 0.0141 & 0.0342 & 13838.8145 & 220428.5973 & 469.4982 \tabularnewline
65 & 0.055 & -0.0461 & 0.0366 & 147456.3595 & 205834.1498 & 453.6895 \tabularnewline
66 & 0.0569 & -0.0388 & 0.0369 & 98031.9219 & 187867.1118 & 433.4364 \tabularnewline
67 & 0.0557 & -0.0489 & 0.0386 & 161977.1728 & 184168.5491 & 429.1486 \tabularnewline
68 & 0.0605 & 0.0012 & 0.034 & 82.4549 & 161157.7873 & 401.4446 \tabularnewline
69 & 0.0606 & 0.0095 & 0.0312 & 5175.5243 & 143826.4247 & 379.2445 \tabularnewline
70 & 0.0562 & 0.0176 & 0.0299 & 20703.0655 & 131514.0888 & 362.6487 \tabularnewline
71 & 0.0571 & 0.096 & 0.0359 & 596118.6835 & 173750.8702 & 416.8343 \tabularnewline
72 & 0.0504 & -0.0523 & 0.0373 & 227053.3189 & 178192.7409 & 422.1288 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116742&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.0415[/C][C]-0.0061[/C][C]0[/C][C]3385.9149[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0499[/C][C]0.0258[/C][C]0.0159[/C][C]52512.759[/C][C]27949.3369[/C][C]167.1806[/C][/ROW]
[ROW][C]63[/C][C]0.0459[/C][C]-0.0908[/C][C]0.0409[/C][C]811976.901[/C][C]289291.8583[/C][C]537.8586[/C][/ROW]
[ROW][C]64[/C][C]0.0548[/C][C]0.0141[/C][C]0.0342[/C][C]13838.8145[/C][C]220428.5973[/C][C]469.4982[/C][/ROW]
[ROW][C]65[/C][C]0.055[/C][C]-0.0461[/C][C]0.0366[/C][C]147456.3595[/C][C]205834.1498[/C][C]453.6895[/C][/ROW]
[ROW][C]66[/C][C]0.0569[/C][C]-0.0388[/C][C]0.0369[/C][C]98031.9219[/C][C]187867.1118[/C][C]433.4364[/C][/ROW]
[ROW][C]67[/C][C]0.0557[/C][C]-0.0489[/C][C]0.0386[/C][C]161977.1728[/C][C]184168.5491[/C][C]429.1486[/C][/ROW]
[ROW][C]68[/C][C]0.0605[/C][C]0.0012[/C][C]0.034[/C][C]82.4549[/C][C]161157.7873[/C][C]401.4446[/C][/ROW]
[ROW][C]69[/C][C]0.0606[/C][C]0.0095[/C][C]0.0312[/C][C]5175.5243[/C][C]143826.4247[/C][C]379.2445[/C][/ROW]
[ROW][C]70[/C][C]0.0562[/C][C]0.0176[/C][C]0.0299[/C][C]20703.0655[/C][C]131514.0888[/C][C]362.6487[/C][/ROW]
[ROW][C]71[/C][C]0.0571[/C][C]0.096[/C][C]0.0359[/C][C]596118.6835[/C][C]173750.8702[/C][C]416.8343[/C][/ROW]
[ROW][C]72[/C][C]0.0504[/C][C]-0.0523[/C][C]0.0373[/C][C]227053.3189[/C][C]178192.7409[/C][C]422.1288[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116742&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116742&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.0415-0.006103385.914900
620.04990.02580.015952512.75927949.3369167.1806
630.0459-0.09080.0409811976.901289291.8583537.8586
640.05480.01410.034213838.8145220428.5973469.4982
650.055-0.04610.0366147456.3595205834.1498453.6895
660.0569-0.03880.036998031.9219187867.1118433.4364
670.0557-0.04890.0386161977.1728184168.5491429.1486
680.06050.00120.03482.4549161157.7873401.4446
690.06060.00950.03125175.5243143826.4247379.2445
700.05620.01760.029920703.0655131514.0888362.6487
710.05710.0960.0359596118.6835173750.8702416.8343
720.0504-0.05230.0373227053.3189178192.7409422.1288



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,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')