Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 15 Dec 2007 05:12:24 -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/15/t1197720715l793737w3higerl.htm/, Retrieved Fri, 03 May 2024 03:03:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4027, Retrieved Fri, 03 May 2024 03:03:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact241
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecast in...] [2007-12-15 12:12:24] [c5caf8a1e3802eaf41184f28719e74c9] [Current]
Feedback Forum

Post a new message
Dataseries X:
36845
35338
35022
34777
26887
23970
22780
17351
21382
24561
17409
11514
31514
27071
29462
26105
22397
23843
21705
18089
20764
25316
17704
15548
28029
29383
36438
32034
22679
24319
18004
17537
20366
22782
19169
13807
29743
25591
29096
26482
22405
27044
17970
18730
19684
19785
18479
10698
31956
29506
34506
27165
26736
23691
18157
17328
18205
20995
17382
9367




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4027&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]4 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=4027&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4027&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 time4 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[48])
3613807-------
3729743-------
3825591-------
3929096-------
4026482-------
4122405-------
4227044-------
4317970-------
4418730-------
4519684-------
4619785-------
4718479-------
4810698-------
493195630229.224224181.286942386.72950.39040.99920.53120.9992
502950622671.314519448.901427675.21580.00371e-040.12641
513450625228.082320923.465932751.96440.00780.13260.15680.9999
522716524189.68420131.582731194.01020.20250.00190.26060.9999
532673619685.890317121.185423492.2541e-041e-040.08071
542369126045.389221059.262235645.10610.31540.44390.41920.9991
551815718717.372716315.357322256.5360.37820.00290.66051
561732818757.206116304.603822403.63910.22120.62650.50581
571820519974.634617135.354124383.73190.21570.88030.55141
582099521717.570418291.477327384.0350.40130.88780.74810.9999
591738218448.308416056.337321990.07710.27760.07940.49321
60936714007.245312735.935415652.00030011

\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 & 13807 & - & - & - & - & - & - & - \tabularnewline
37 & 29743 & - & - & - & - & - & - & - \tabularnewline
38 & 25591 & - & - & - & - & - & - & - \tabularnewline
39 & 29096 & - & - & - & - & - & - & - \tabularnewline
40 & 26482 & - & - & - & - & - & - & - \tabularnewline
41 & 22405 & - & - & - & - & - & - & - \tabularnewline
42 & 27044 & - & - & - & - & - & - & - \tabularnewline
43 & 17970 & - & - & - & - & - & - & - \tabularnewline
44 & 18730 & - & - & - & - & - & - & - \tabularnewline
45 & 19684 & - & - & - & - & - & - & - \tabularnewline
46 & 19785 & - & - & - & - & - & - & - \tabularnewline
47 & 18479 & - & - & - & - & - & - & - \tabularnewline
48 & 10698 & - & - & - & - & - & - & - \tabularnewline
49 & 31956 & 30229.2242 & 24181.2869 & 42386.7295 & 0.3904 & 0.9992 & 0.5312 & 0.9992 \tabularnewline
50 & 29506 & 22671.3145 & 19448.9014 & 27675.2158 & 0.0037 & 1e-04 & 0.1264 & 1 \tabularnewline
51 & 34506 & 25228.0823 & 20923.4659 & 32751.9644 & 0.0078 & 0.1326 & 0.1568 & 0.9999 \tabularnewline
52 & 27165 & 24189.684 & 20131.5827 & 31194.0102 & 0.2025 & 0.0019 & 0.2606 & 0.9999 \tabularnewline
53 & 26736 & 19685.8903 & 17121.1854 & 23492.254 & 1e-04 & 1e-04 & 0.0807 & 1 \tabularnewline
54 & 23691 & 26045.3892 & 21059.2622 & 35645.1061 & 0.3154 & 0.4439 & 0.4192 & 0.9991 \tabularnewline
55 & 18157 & 18717.3727 & 16315.3573 & 22256.536 & 0.3782 & 0.0029 & 0.6605 & 1 \tabularnewline
56 & 17328 & 18757.2061 & 16304.6038 & 22403.6391 & 0.2212 & 0.6265 & 0.5058 & 1 \tabularnewline
57 & 18205 & 19974.6346 & 17135.3541 & 24383.7319 & 0.2157 & 0.8803 & 0.5514 & 1 \tabularnewline
58 & 20995 & 21717.5704 & 18291.4773 & 27384.035 & 0.4013 & 0.8878 & 0.7481 & 0.9999 \tabularnewline
59 & 17382 & 18448.3084 & 16056.3373 & 21990.0771 & 0.2776 & 0.0794 & 0.4932 & 1 \tabularnewline
60 & 9367 & 14007.2453 & 12735.9354 & 15652.0003 & 0 & 0 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4027&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]13807[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]29743[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]25591[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]29096[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]26482[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]22405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]27044[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]17970[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]18730[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]19684[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]19785[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]18479[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]10698[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]31956[/C][C]30229.2242[/C][C]24181.2869[/C][C]42386.7295[/C][C]0.3904[/C][C]0.9992[/C][C]0.5312[/C][C]0.9992[/C][/ROW]
[ROW][C]50[/C][C]29506[/C][C]22671.3145[/C][C]19448.9014[/C][C]27675.2158[/C][C]0.0037[/C][C]1e-04[/C][C]0.1264[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]34506[/C][C]25228.0823[/C][C]20923.4659[/C][C]32751.9644[/C][C]0.0078[/C][C]0.1326[/C][C]0.1568[/C][C]0.9999[/C][/ROW]
[ROW][C]52[/C][C]27165[/C][C]24189.684[/C][C]20131.5827[/C][C]31194.0102[/C][C]0.2025[/C][C]0.0019[/C][C]0.2606[/C][C]0.9999[/C][/ROW]
[ROW][C]53[/C][C]26736[/C][C]19685.8903[/C][C]17121.1854[/C][C]23492.254[/C][C]1e-04[/C][C]1e-04[/C][C]0.0807[/C][C]1[/C][/ROW]
[ROW][C]54[/C][C]23691[/C][C]26045.3892[/C][C]21059.2622[/C][C]35645.1061[/C][C]0.3154[/C][C]0.4439[/C][C]0.4192[/C][C]0.9991[/C][/ROW]
[ROW][C]55[/C][C]18157[/C][C]18717.3727[/C][C]16315.3573[/C][C]22256.536[/C][C]0.3782[/C][C]0.0029[/C][C]0.6605[/C][C]1[/C][/ROW]
[ROW][C]56[/C][C]17328[/C][C]18757.2061[/C][C]16304.6038[/C][C]22403.6391[/C][C]0.2212[/C][C]0.6265[/C][C]0.5058[/C][C]1[/C][/ROW]
[ROW][C]57[/C][C]18205[/C][C]19974.6346[/C][C]17135.3541[/C][C]24383.7319[/C][C]0.2157[/C][C]0.8803[/C][C]0.5514[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]20995[/C][C]21717.5704[/C][C]18291.4773[/C][C]27384.035[/C][C]0.4013[/C][C]0.8878[/C][C]0.7481[/C][C]0.9999[/C][/ROW]
[ROW][C]59[/C][C]17382[/C][C]18448.3084[/C][C]16056.3373[/C][C]21990.0771[/C][C]0.2776[/C][C]0.0794[/C][C]0.4932[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]9367[/C][C]14007.2453[/C][C]12735.9354[/C][C]15652.0003[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4027&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4027&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])
3613807-------
3729743-------
3825591-------
3929096-------
4026482-------
4122405-------
4227044-------
4317970-------
4418730-------
4519684-------
4619785-------
4718479-------
4810698-------
493195630229.224224181.286942386.72950.39040.99920.53120.9992
502950622671.314519448.901427675.21580.00371e-040.12641
513450625228.082320923.465932751.96440.00780.13260.15680.9999
522716524189.68420131.582731194.01020.20250.00190.26060.9999
532673619685.890317121.185423492.2541e-041e-040.08071
542369126045.389221059.262235645.10610.31540.44390.41920.9991
551815718717.372716315.357322256.5360.37820.00290.66051
561732818757.206116304.603822403.63910.22120.62650.50581
571820519974.634617135.354124383.73190.21570.88030.55141
582099521717.570418291.477327384.0350.40130.88780.74810.9999
591738218448.308416056.337321990.07710.27760.07940.49321
60936714007.245312735.935415652.00030011







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.20520.05710.00482981754.7794248479.565498.4772
500.11260.30150.025146712925.32233892743.77691973.0037
510.15220.36780.030686079757.51247173313.1262678.3042
520.14770.1230.01028852505.4684737708.789858.8998
530.09870.35810.029849704046.12274142003.84362035.1914
540.188-0.09040.00755543148.5969461929.0497679.6536
550.0965-0.02990.0025314017.507326168.1256161.7657
560.0992-0.07620.00632042630.0001170219.1667412.5763
570.1126-0.08860.00743131606.7158260967.2263510.8495
580.1331-0.03330.0028522107.95143508.9959208.5881
590.098-0.05780.00481137013.603994751.1337307.8167
600.0599-0.33130.027621531876.81561794323.0681339.5234

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.2052 & 0.0571 & 0.0048 & 2981754.7794 & 248479.565 & 498.4772 \tabularnewline
50 & 0.1126 & 0.3015 & 0.0251 & 46712925.3223 & 3892743.7769 & 1973.0037 \tabularnewline
51 & 0.1522 & 0.3678 & 0.0306 & 86079757.5124 & 7173313.126 & 2678.3042 \tabularnewline
52 & 0.1477 & 0.123 & 0.0102 & 8852505.4684 & 737708.789 & 858.8998 \tabularnewline
53 & 0.0987 & 0.3581 & 0.0298 & 49704046.1227 & 4142003.8436 & 2035.1914 \tabularnewline
54 & 0.188 & -0.0904 & 0.0075 & 5543148.5969 & 461929.0497 & 679.6536 \tabularnewline
55 & 0.0965 & -0.0299 & 0.0025 & 314017.5073 & 26168.1256 & 161.7657 \tabularnewline
56 & 0.0992 & -0.0762 & 0.0063 & 2042630.0001 & 170219.1667 & 412.5763 \tabularnewline
57 & 0.1126 & -0.0886 & 0.0074 & 3131606.7158 & 260967.2263 & 510.8495 \tabularnewline
58 & 0.1331 & -0.0333 & 0.0028 & 522107.951 & 43508.9959 & 208.5881 \tabularnewline
59 & 0.098 & -0.0578 & 0.0048 & 1137013.6039 & 94751.1337 & 307.8167 \tabularnewline
60 & 0.0599 & -0.3313 & 0.0276 & 21531876.8156 & 1794323.068 & 1339.5234 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4027&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.2052[/C][C]0.0571[/C][C]0.0048[/C][C]2981754.7794[/C][C]248479.565[/C][C]498.4772[/C][/ROW]
[ROW][C]50[/C][C]0.1126[/C][C]0.3015[/C][C]0.0251[/C][C]46712925.3223[/C][C]3892743.7769[/C][C]1973.0037[/C][/ROW]
[ROW][C]51[/C][C]0.1522[/C][C]0.3678[/C][C]0.0306[/C][C]86079757.5124[/C][C]7173313.126[/C][C]2678.3042[/C][/ROW]
[ROW][C]52[/C][C]0.1477[/C][C]0.123[/C][C]0.0102[/C][C]8852505.4684[/C][C]737708.789[/C][C]858.8998[/C][/ROW]
[ROW][C]53[/C][C]0.0987[/C][C]0.3581[/C][C]0.0298[/C][C]49704046.1227[/C][C]4142003.8436[/C][C]2035.1914[/C][/ROW]
[ROW][C]54[/C][C]0.188[/C][C]-0.0904[/C][C]0.0075[/C][C]5543148.5969[/C][C]461929.0497[/C][C]679.6536[/C][/ROW]
[ROW][C]55[/C][C]0.0965[/C][C]-0.0299[/C][C]0.0025[/C][C]314017.5073[/C][C]26168.1256[/C][C]161.7657[/C][/ROW]
[ROW][C]56[/C][C]0.0992[/C][C]-0.0762[/C][C]0.0063[/C][C]2042630.0001[/C][C]170219.1667[/C][C]412.5763[/C][/ROW]
[ROW][C]57[/C][C]0.1126[/C][C]-0.0886[/C][C]0.0074[/C][C]3131606.7158[/C][C]260967.2263[/C][C]510.8495[/C][/ROW]
[ROW][C]58[/C][C]0.1331[/C][C]-0.0333[/C][C]0.0028[/C][C]522107.951[/C][C]43508.9959[/C][C]208.5881[/C][/ROW]
[ROW][C]59[/C][C]0.098[/C][C]-0.0578[/C][C]0.0048[/C][C]1137013.6039[/C][C]94751.1337[/C][C]307.8167[/C][/ROW]
[ROW][C]60[/C][C]0.0599[/C][C]-0.3313[/C][C]0.0276[/C][C]21531876.8156[/C][C]1794323.068[/C][C]1339.5234[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4027&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4027&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.20520.05710.00482981754.7794248479.565498.4772
500.11260.30150.025146712925.32233892743.77691973.0037
510.15220.36780.030686079757.51247173313.1262678.3042
520.14770.1230.01028852505.4684737708.789858.8998
530.09870.35810.029849704046.12274142003.84362035.1914
540.188-0.09040.00755543148.5969461929.0497679.6536
550.0965-0.02990.0025314017.507326168.1256161.7657
560.0992-0.07620.00632042630.0001170219.1667412.5763
570.1126-0.08860.00743131606.7158260967.2263510.8495
580.1331-0.03330.0028522107.95143508.9959208.5881
590.098-0.05780.00481137013.603994751.1337307.8167
600.0599-0.33130.027621531876.81561794323.0681339.5234



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