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 computationFri, 30 Nov 2012 10:48:29 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2012/Nov/30/t13542905237bqesfzdza5h9pk.htm/, Retrieved Thu, 31 Oct 2024 22:47:18 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=195122, Retrieved Thu, 31 Oct 2024 22:47:18 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact116
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]
- R PD        [ARIMA Forecasting] [] [2012-11-30 15:48:29] [00ffffaac852cc6d7cd42123567c45a2] [Current]
-   P           [ARIMA Forecasting] [WS9 Review] [2012-12-11 18:59:41] [516331a1326ffbbf54349d9c9d5f2d94]
Feedback Forum

Post a new message
Dataseries X:
2655362
873127
1107897
1555964
1671159
1493308
2957796
2638691
1305669
1280496
921900
867888
652586
913831
1108544
1555827
1699283
1509458
3268975
2425016
1312703
1365498
934453
775019
651142
843192
1146766
1652601
1465906
1652734
2922334
2702805
1458956
1410363
1019279
936574
708917
885295
1099663
1576220
1487870
1488635
2882530
2677026
1404398
1344370
936865
872705
628151
953712
1160384
1400618
1661511
1495347
2918786
2775677
1407026
1370199
964526
850851
683118
847224
1073256
1514326
1503734
1507712
2865698
2788128
1391596
1366378
946295
859626




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net

\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 & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=195122&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]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=195122&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=195122&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'Gwilym Jenkins' @ jenkins.wessa.net







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])
48872705.000000001-------
49628151.000000001-------
50953712.000000001-------
511160384-------
521400618-------
531661511-------
541495347-------
552918786-------
562775677-------
571407026-------
581370199-------
59964526.000000001-------
60850851.000000001-------
61683118642227.5976121822.11221215765.60390.44440.23790.51920.2379
62847224940669.7159386962.96081531252.85410.37820.80370.48270.6172
6310732561150927.9457581530.34341751226.31950.39990.83930.48770.8364
6415143261433184.4773847438.53322044579.61290.39740.87570.54160.969
6515037341631378.07831036196.6322249580.52330.34290.64470.46190.9933
6615077121498432.1575909428.62482112146.09920.48820.49320.50390.9807
6728656982915224.28422278620.52993566142.73910.440710.49571
6827881282757767.86342125103.12573405406.43120.46340.3720.47841
6913915961407445.9774823030.96192017903.58110.479700.50050.963
7013663781367369.004785081.95691976339.73160.49870.46890.49640.9518
71946295961727.3242406256.61691553353.22010.47960.090.49630.6433
72859626855866.5933309837.29921442065.56290.4950.38120.50670.5067

\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 & 872705.000000001 & - & - & - & - & - & - & - \tabularnewline
49 & 628151.000000001 & - & - & - & - & - & - & - \tabularnewline
50 & 953712.000000001 & - & - & - & - & - & - & - \tabularnewline
51 & 1160384 & - & - & - & - & - & - & - \tabularnewline
52 & 1400618 & - & - & - & - & - & - & - \tabularnewline
53 & 1661511 & - & - & - & - & - & - & - \tabularnewline
54 & 1495347 & - & - & - & - & - & - & - \tabularnewline
55 & 2918786 & - & - & - & - & - & - & - \tabularnewline
56 & 2775677 & - & - & - & - & - & - & - \tabularnewline
57 & 1407026 & - & - & - & - & - & - & - \tabularnewline
58 & 1370199 & - & - & - & - & - & - & - \tabularnewline
59 & 964526.000000001 & - & - & - & - & - & - & - \tabularnewline
60 & 850851.000000001 & - & - & - & - & - & - & - \tabularnewline
61 & 683118 & 642227.5976 & 121822.1122 & 1215765.6039 & 0.4444 & 0.2379 & 0.5192 & 0.2379 \tabularnewline
62 & 847224 & 940669.7159 & 386962.9608 & 1531252.8541 & 0.3782 & 0.8037 & 0.4827 & 0.6172 \tabularnewline
63 & 1073256 & 1150927.9457 & 581530.3434 & 1751226.3195 & 0.3999 & 0.8393 & 0.4877 & 0.8364 \tabularnewline
64 & 1514326 & 1433184.4773 & 847438.5332 & 2044579.6129 & 0.3974 & 0.8757 & 0.5416 & 0.969 \tabularnewline
65 & 1503734 & 1631378.0783 & 1036196.632 & 2249580.5233 & 0.3429 & 0.6447 & 0.4619 & 0.9933 \tabularnewline
66 & 1507712 & 1498432.1575 & 909428.6248 & 2112146.0992 & 0.4882 & 0.4932 & 0.5039 & 0.9807 \tabularnewline
67 & 2865698 & 2915224.2842 & 2278620.5299 & 3566142.7391 & 0.4407 & 1 & 0.4957 & 1 \tabularnewline
68 & 2788128 & 2757767.8634 & 2125103.1257 & 3405406.4312 & 0.4634 & 0.372 & 0.4784 & 1 \tabularnewline
69 & 1391596 & 1407445.9774 & 823030.9619 & 2017903.5811 & 0.4797 & 0 & 0.5005 & 0.963 \tabularnewline
70 & 1366378 & 1367369.004 & 785081.9569 & 1976339.7316 & 0.4987 & 0.4689 & 0.4964 & 0.9518 \tabularnewline
71 & 946295 & 961727.3242 & 406256.6169 & 1553353.2201 & 0.4796 & 0.09 & 0.4963 & 0.6433 \tabularnewline
72 & 859626 & 855866.5933 & 309837.2992 & 1442065.5629 & 0.495 & 0.3812 & 0.5067 & 0.5067 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=195122&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]872705.000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]628151.000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]953712.000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]1160384[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]1400618[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]1661511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]1495347[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]2918786[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]2775677[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]1407026[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]1370199[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]964526.000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]850851.000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]683118[/C][C]642227.5976[/C][C]121822.1122[/C][C]1215765.6039[/C][C]0.4444[/C][C]0.2379[/C][C]0.5192[/C][C]0.2379[/C][/ROW]
[ROW][C]62[/C][C]847224[/C][C]940669.7159[/C][C]386962.9608[/C][C]1531252.8541[/C][C]0.3782[/C][C]0.8037[/C][C]0.4827[/C][C]0.6172[/C][/ROW]
[ROW][C]63[/C][C]1073256[/C][C]1150927.9457[/C][C]581530.3434[/C][C]1751226.3195[/C][C]0.3999[/C][C]0.8393[/C][C]0.4877[/C][C]0.8364[/C][/ROW]
[ROW][C]64[/C][C]1514326[/C][C]1433184.4773[/C][C]847438.5332[/C][C]2044579.6129[/C][C]0.3974[/C][C]0.8757[/C][C]0.5416[/C][C]0.969[/C][/ROW]
[ROW][C]65[/C][C]1503734[/C][C]1631378.0783[/C][C]1036196.632[/C][C]2249580.5233[/C][C]0.3429[/C][C]0.6447[/C][C]0.4619[/C][C]0.9933[/C][/ROW]
[ROW][C]66[/C][C]1507712[/C][C]1498432.1575[/C][C]909428.6248[/C][C]2112146.0992[/C][C]0.4882[/C][C]0.4932[/C][C]0.5039[/C][C]0.9807[/C][/ROW]
[ROW][C]67[/C][C]2865698[/C][C]2915224.2842[/C][C]2278620.5299[/C][C]3566142.7391[/C][C]0.4407[/C][C]1[/C][C]0.4957[/C][C]1[/C][/ROW]
[ROW][C]68[/C][C]2788128[/C][C]2757767.8634[/C][C]2125103.1257[/C][C]3405406.4312[/C][C]0.4634[/C][C]0.372[/C][C]0.4784[/C][C]1[/C][/ROW]
[ROW][C]69[/C][C]1391596[/C][C]1407445.9774[/C][C]823030.9619[/C][C]2017903.5811[/C][C]0.4797[/C][C]0[/C][C]0.5005[/C][C]0.963[/C][/ROW]
[ROW][C]70[/C][C]1366378[/C][C]1367369.004[/C][C]785081.9569[/C][C]1976339.7316[/C][C]0.4987[/C][C]0.4689[/C][C]0.4964[/C][C]0.9518[/C][/ROW]
[ROW][C]71[/C][C]946295[/C][C]961727.3242[/C][C]406256.6169[/C][C]1553353.2201[/C][C]0.4796[/C][C]0.09[/C][C]0.4963[/C][C]0.6433[/C][/ROW]
[ROW][C]72[/C][C]859626[/C][C]855866.5933[/C][C]309837.2992[/C][C]1442065.5629[/C][C]0.495[/C][C]0.3812[/C][C]0.5067[/C][C]0.5067[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=195122&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=195122&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])
48872705.000000001-------
49628151.000000001-------
50953712.000000001-------
511160384-------
521400618-------
531661511-------
541495347-------
552918786-------
562775677-------
571407026-------
581370199-------
59964526.000000001-------
60850851.000000001-------
61683118642227.5976121822.11221215765.60390.44440.23790.51920.2379
62847224940669.7159386962.96081531252.85410.37820.80370.48270.6172
6310732561150927.9457581530.34341751226.31950.39990.83930.48770.8364
6415143261433184.4773847438.53322044579.61290.39740.87570.54160.969
6515037341631378.07831036196.6322249580.52330.34290.64470.46190.9933
6615077121498432.1575909428.62482112146.09920.48820.49320.50390.9807
6728656982915224.28422278620.52993566142.73910.440710.49571
6827881282757767.86342125103.12573405406.43120.46340.3720.47841
6913915961407445.9774823030.96192017903.58110.479700.50050.963
7013663781367369.004785081.95691976339.73160.49870.46890.49640.9518
71946295961727.3242406256.61691553353.22010.47960.090.49630.6433
72859626855866.5933309837.29921442065.56290.4950.38120.50670.5067







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.45560.063701672025007.14100
620.3203-0.09930.08158732101815.0365202063411.088572125.3313
630.2661-0.06750.07686032931147.4495479019323.208774020.398
640.21770.05660.07186583946704.59125755251168.554375863.3717
650.1933-0.07820.073116293010717.02327862803078.248188672.4482
660.2090.00620.061986115477.73576566688478.162781035.1065
670.1139-0.0170.05552452852828.58715978997671.080577323.9786
680.11980.0110.0499921737897.24955346840199.351673122.091
690.2213-0.01130.0456251221783.88594780660375.41169142.3197
700.2272-7e-040.0412982088.93634302692546.763565594.9125
710.3139-0.0160.0389238156631.06263933189281.699862715.144
720.34940.00440.03614133138.78173606601269.789960054.9854

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.4556 & 0.0637 & 0 & 1672025007.141 & 0 & 0 \tabularnewline
62 & 0.3203 & -0.0993 & 0.0815 & 8732101815.036 & 5202063411.0885 & 72125.3313 \tabularnewline
63 & 0.2661 & -0.0675 & 0.0768 & 6032931147.449 & 5479019323.2087 & 74020.398 \tabularnewline
64 & 0.2177 & 0.0566 & 0.0718 & 6583946704.5912 & 5755251168.5543 & 75863.3717 \tabularnewline
65 & 0.1933 & -0.0782 & 0.0731 & 16293010717.0232 & 7862803078.2481 & 88672.4482 \tabularnewline
66 & 0.209 & 0.0062 & 0.0619 & 86115477.7357 & 6566688478.1627 & 81035.1065 \tabularnewline
67 & 0.1139 & -0.017 & 0.0555 & 2452852828.5871 & 5978997671.0805 & 77323.9786 \tabularnewline
68 & 0.1198 & 0.011 & 0.0499 & 921737897.2495 & 5346840199.3516 & 73122.091 \tabularnewline
69 & 0.2213 & -0.0113 & 0.0456 & 251221783.8859 & 4780660375.411 & 69142.3197 \tabularnewline
70 & 0.2272 & -7e-04 & 0.0412 & 982088.9363 & 4302692546.7635 & 65594.9125 \tabularnewline
71 & 0.3139 & -0.016 & 0.0389 & 238156631.0626 & 3933189281.6998 & 62715.144 \tabularnewline
72 & 0.3494 & 0.0044 & 0.036 & 14133138.7817 & 3606601269.7899 & 60054.9854 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=195122&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.4556[/C][C]0.0637[/C][C]0[/C][C]1672025007.141[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.3203[/C][C]-0.0993[/C][C]0.0815[/C][C]8732101815.036[/C][C]5202063411.0885[/C][C]72125.3313[/C][/ROW]
[ROW][C]63[/C][C]0.2661[/C][C]-0.0675[/C][C]0.0768[/C][C]6032931147.449[/C][C]5479019323.2087[/C][C]74020.398[/C][/ROW]
[ROW][C]64[/C][C]0.2177[/C][C]0.0566[/C][C]0.0718[/C][C]6583946704.5912[/C][C]5755251168.5543[/C][C]75863.3717[/C][/ROW]
[ROW][C]65[/C][C]0.1933[/C][C]-0.0782[/C][C]0.0731[/C][C]16293010717.0232[/C][C]7862803078.2481[/C][C]88672.4482[/C][/ROW]
[ROW][C]66[/C][C]0.209[/C][C]0.0062[/C][C]0.0619[/C][C]86115477.7357[/C][C]6566688478.1627[/C][C]81035.1065[/C][/ROW]
[ROW][C]67[/C][C]0.1139[/C][C]-0.017[/C][C]0.0555[/C][C]2452852828.5871[/C][C]5978997671.0805[/C][C]77323.9786[/C][/ROW]
[ROW][C]68[/C][C]0.1198[/C][C]0.011[/C][C]0.0499[/C][C]921737897.2495[/C][C]5346840199.3516[/C][C]73122.091[/C][/ROW]
[ROW][C]69[/C][C]0.2213[/C][C]-0.0113[/C][C]0.0456[/C][C]251221783.8859[/C][C]4780660375.411[/C][C]69142.3197[/C][/ROW]
[ROW][C]70[/C][C]0.2272[/C][C]-7e-04[/C][C]0.0412[/C][C]982088.9363[/C][C]4302692546.7635[/C][C]65594.9125[/C][/ROW]
[ROW][C]71[/C][C]0.3139[/C][C]-0.016[/C][C]0.0389[/C][C]238156631.0626[/C][C]3933189281.6998[/C][C]62715.144[/C][/ROW]
[ROW][C]72[/C][C]0.3494[/C][C]0.0044[/C][C]0.036[/C][C]14133138.7817[/C][C]3606601269.7899[/C][C]60054.9854[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=195122&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=195122&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.45560.063701672025007.14100
620.3203-0.09930.08158732101815.0365202063411.088572125.3313
630.2661-0.06750.07686032931147.4495479019323.208774020.398
640.21770.05660.07186583946704.59125755251168.554375863.3717
650.1933-0.07820.073116293010717.02327862803078.248188672.4482
660.2090.00620.061986115477.73576566688478.162781035.1065
670.1139-0.0170.05552452852828.58715978997671.080577323.9786
680.11980.0110.0499921737897.24955346840199.351673122.091
690.2213-0.01130.0456251221783.88594780660375.41169142.3197
700.2272-7e-040.0412982088.93634302692546.763565594.9125
710.3139-0.0160.0389238156631.06263933189281.699862715.144
720.34940.00440.03614133138.78173606601269.789960054.9854



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