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, 18 Dec 2009 06:03:23 -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/2009/Dec/18/t1261141477ux2q4w296469qt8.htm/, Retrieved Sat, 27 Apr 2024 08:04:07 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69302, Retrieved Sat, 27 Apr 2024 08:04:07 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact106
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
-   PD  [ARIMA Forecasting] [forecasting] [2009-12-10 15:24:18] [f7fc9270f813d017f9fa5b506fdc7682]
- R         [ARIMA Forecasting] [Testing period = 12] [2009-12-18 13:03:23] [c6e373ff11c42d4585d53e9e88ed5606] [Current]
Feedback Forum

Post a new message
Dataseries X:
593530.00
610943.00
612613.00
611324.00
594167.00
595454.00
590865.00
589379.00
584428.00
573100.00
567456.00
569028.00
620735.00
628884.00
628232.00
612117.00
595404.00
597141.00
593408.00
590072.00
579799.00
574205.00
572775.00
572942.00
619567.00
625809.00
619916.00
587625.00
565742.00
557274.00
560576.00
548854.00
531673.00
525919.00
511038.00
498662.00
555362.00
564591.00
541657.00
527070.00
509846.00
514258.00
516922.00
507561.00
492622.00
490243.00
469357.00
477580.00
528379.00
533590.00
517945.00
506174.00
501866.00
516141.00
528222.00
532638.00
536322.00
536535.00
523597.00
536214.00
586570.00
596594.00
580523.00




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69302&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' @ 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[51])
39541657-------
40527070-------
41509846-------
42514258-------
43516922-------
44507561-------
45492622-------
46490243-------
47469357-------
48477580-------
49528379-------
50533590-------
51517945-------
52506174505543.1777490570.4021520515.95330.46710.05220.00240.0522
53501866487419.3967466921.1606507917.63290.08360.03650.0160.0018
54516141492194.9229465257.0259519132.81990.04070.24080.05420.0305
55528222497303.0858462815.7739531790.39780.03940.14220.13240.1204
56532638488612.0188448242.4423528981.59520.01630.02720.17880.0772
57536322472644.5027427464.0141517824.99130.00290.00460.19310.0247
58536535470893.264420129.3402521657.18770.00560.00580.22750.0346
59523597451619.6907394995.8737508243.50770.00640.00160.26960.0108
60536214459697.6236398269521126.24710.00730.02070.28410.0315
61586570509719.6003443879.8204575559.38010.01110.21510.28930.4033
62596594515694.9307444941.1883586448.67310.01250.02480.310.4751
63580523500985.3972425429.8499576540.94450.01950.00660.330.33

\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[51]) \tabularnewline
39 & 541657 & - & - & - & - & - & - & - \tabularnewline
40 & 527070 & - & - & - & - & - & - & - \tabularnewline
41 & 509846 & - & - & - & - & - & - & - \tabularnewline
42 & 514258 & - & - & - & - & - & - & - \tabularnewline
43 & 516922 & - & - & - & - & - & - & - \tabularnewline
44 & 507561 & - & - & - & - & - & - & - \tabularnewline
45 & 492622 & - & - & - & - & - & - & - \tabularnewline
46 & 490243 & - & - & - & - & - & - & - \tabularnewline
47 & 469357 & - & - & - & - & - & - & - \tabularnewline
48 & 477580 & - & - & - & - & - & - & - \tabularnewline
49 & 528379 & - & - & - & - & - & - & - \tabularnewline
50 & 533590 & - & - & - & - & - & - & - \tabularnewline
51 & 517945 & - & - & - & - & - & - & - \tabularnewline
52 & 506174 & 505543.1777 & 490570.4021 & 520515.9533 & 0.4671 & 0.0522 & 0.0024 & 0.0522 \tabularnewline
53 & 501866 & 487419.3967 & 466921.1606 & 507917.6329 & 0.0836 & 0.0365 & 0.016 & 0.0018 \tabularnewline
54 & 516141 & 492194.9229 & 465257.0259 & 519132.8199 & 0.0407 & 0.2408 & 0.0542 & 0.0305 \tabularnewline
55 & 528222 & 497303.0858 & 462815.7739 & 531790.3978 & 0.0394 & 0.1422 & 0.1324 & 0.1204 \tabularnewline
56 & 532638 & 488612.0188 & 448242.4423 & 528981.5952 & 0.0163 & 0.0272 & 0.1788 & 0.0772 \tabularnewline
57 & 536322 & 472644.5027 & 427464.0141 & 517824.9913 & 0.0029 & 0.0046 & 0.1931 & 0.0247 \tabularnewline
58 & 536535 & 470893.264 & 420129.3402 & 521657.1877 & 0.0056 & 0.0058 & 0.2275 & 0.0346 \tabularnewline
59 & 523597 & 451619.6907 & 394995.8737 & 508243.5077 & 0.0064 & 0.0016 & 0.2696 & 0.0108 \tabularnewline
60 & 536214 & 459697.6236 & 398269 & 521126.2471 & 0.0073 & 0.0207 & 0.2841 & 0.0315 \tabularnewline
61 & 586570 & 509719.6003 & 443879.8204 & 575559.3801 & 0.0111 & 0.2151 & 0.2893 & 0.4033 \tabularnewline
62 & 596594 & 515694.9307 & 444941.1883 & 586448.6731 & 0.0125 & 0.0248 & 0.31 & 0.4751 \tabularnewline
63 & 580523 & 500985.3972 & 425429.8499 & 576540.9445 & 0.0195 & 0.0066 & 0.33 & 0.33 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69302&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[51])[/C][/ROW]
[ROW][C]39[/C][C]541657[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]527070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]509846[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]514258[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]516922[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]507561[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]492622[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]490243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]469357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]477580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]528379[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]533590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]517945[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]506174[/C][C]505543.1777[/C][C]490570.4021[/C][C]520515.9533[/C][C]0.4671[/C][C]0.0522[/C][C]0.0024[/C][C]0.0522[/C][/ROW]
[ROW][C]53[/C][C]501866[/C][C]487419.3967[/C][C]466921.1606[/C][C]507917.6329[/C][C]0.0836[/C][C]0.0365[/C][C]0.016[/C][C]0.0018[/C][/ROW]
[ROW][C]54[/C][C]516141[/C][C]492194.9229[/C][C]465257.0259[/C][C]519132.8199[/C][C]0.0407[/C][C]0.2408[/C][C]0.0542[/C][C]0.0305[/C][/ROW]
[ROW][C]55[/C][C]528222[/C][C]497303.0858[/C][C]462815.7739[/C][C]531790.3978[/C][C]0.0394[/C][C]0.1422[/C][C]0.1324[/C][C]0.1204[/C][/ROW]
[ROW][C]56[/C][C]532638[/C][C]488612.0188[/C][C]448242.4423[/C][C]528981.5952[/C][C]0.0163[/C][C]0.0272[/C][C]0.1788[/C][C]0.0772[/C][/ROW]
[ROW][C]57[/C][C]536322[/C][C]472644.5027[/C][C]427464.0141[/C][C]517824.9913[/C][C]0.0029[/C][C]0.0046[/C][C]0.1931[/C][C]0.0247[/C][/ROW]
[ROW][C]58[/C][C]536535[/C][C]470893.264[/C][C]420129.3402[/C][C]521657.1877[/C][C]0.0056[/C][C]0.0058[/C][C]0.2275[/C][C]0.0346[/C][/ROW]
[ROW][C]59[/C][C]523597[/C][C]451619.6907[/C][C]394995.8737[/C][C]508243.5077[/C][C]0.0064[/C][C]0.0016[/C][C]0.2696[/C][C]0.0108[/C][/ROW]
[ROW][C]60[/C][C]536214[/C][C]459697.6236[/C][C]398269[/C][C]521126.2471[/C][C]0.0073[/C][C]0.0207[/C][C]0.2841[/C][C]0.0315[/C][/ROW]
[ROW][C]61[/C][C]586570[/C][C]509719.6003[/C][C]443879.8204[/C][C]575559.3801[/C][C]0.0111[/C][C]0.2151[/C][C]0.2893[/C][C]0.4033[/C][/ROW]
[ROW][C]62[/C][C]596594[/C][C]515694.9307[/C][C]444941.1883[/C][C]586448.6731[/C][C]0.0125[/C][C]0.0248[/C][C]0.31[/C][C]0.4751[/C][/ROW]
[ROW][C]63[/C][C]580523[/C][C]500985.3972[/C][C]425429.8499[/C][C]576540.9445[/C][C]0.0195[/C][C]0.0066[/C][C]0.33[/C][C]0.33[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69302&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69302&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[51])
39541657-------
40527070-------
41509846-------
42514258-------
43516922-------
44507561-------
45492622-------
46490243-------
47469357-------
48477580-------
49528379-------
50533590-------
51517945-------
52506174505543.1777490570.4021520515.95330.46710.05220.00240.0522
53501866487419.3967466921.1606507917.63290.08360.03650.0160.0018
54516141492194.9229465257.0259519132.81990.04070.24080.05420.0305
55528222497303.0858462815.7739531790.39780.03940.14220.13240.1204
56532638488612.0188448242.4423528981.59520.01630.02720.17880.0772
57536322472644.5027427464.0141517824.99130.00290.00460.19310.0247
58536535470893.264420129.3402521657.18770.00560.00580.22750.0346
59523597451619.6907394995.8737508243.50770.00640.00160.26960.0108
60536214459697.6236398269521126.24710.00730.02070.28410.0315
61586570509719.6003443879.8204575559.38010.01110.21510.28930.4033
62596594515694.9307444941.1883586448.67310.01250.02480.310.4751
63580523500985.3972425429.8499576540.94450.01950.00660.330.33







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
520.01510.00120397936.777900
530.02150.02960.0154208704346.4333104551141.605610225.0253
540.02790.04870.0265573414608.1535260838963.788216150.5097
550.03540.06220.0354955979252.3381434624035.925720847.6386
560.04220.09010.04641938287023.5646735356633.453527117.4599
570.04880.13470.06114054823660.91311288601138.030135897.0909
580.0550.13940.07234308837510.95481720063477.019341473.648
590.0640.15940.08325180733052.81372152647173.993646396.6289
600.06820.16640.09245854755859.75032563992583.522150635.8824
610.06590.15080.09835905983937.79882898191718.949853834.856
620.070.15690.10366544659415.94133229688782.312756830.3509
630.07690.15880.10826326230253.84243487733904.940159057.0394

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
52 & 0.0151 & 0.0012 & 0 & 397936.7779 & 0 & 0 \tabularnewline
53 & 0.0215 & 0.0296 & 0.0154 & 208704346.4333 & 104551141.6056 & 10225.0253 \tabularnewline
54 & 0.0279 & 0.0487 & 0.0265 & 573414608.1535 & 260838963.7882 & 16150.5097 \tabularnewline
55 & 0.0354 & 0.0622 & 0.0354 & 955979252.3381 & 434624035.9257 & 20847.6386 \tabularnewline
56 & 0.0422 & 0.0901 & 0.0464 & 1938287023.5646 & 735356633.4535 & 27117.4599 \tabularnewline
57 & 0.0488 & 0.1347 & 0.0611 & 4054823660.9131 & 1288601138.0301 & 35897.0909 \tabularnewline
58 & 0.055 & 0.1394 & 0.0723 & 4308837510.9548 & 1720063477.0193 & 41473.648 \tabularnewline
59 & 0.064 & 0.1594 & 0.0832 & 5180733052.8137 & 2152647173.9936 & 46396.6289 \tabularnewline
60 & 0.0682 & 0.1664 & 0.0924 & 5854755859.7503 & 2563992583.5221 & 50635.8824 \tabularnewline
61 & 0.0659 & 0.1508 & 0.0983 & 5905983937.7988 & 2898191718.9498 & 53834.856 \tabularnewline
62 & 0.07 & 0.1569 & 0.1036 & 6544659415.9413 & 3229688782.3127 & 56830.3509 \tabularnewline
63 & 0.0769 & 0.1588 & 0.1082 & 6326230253.8424 & 3487733904.9401 & 59057.0394 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69302&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]52[/C][C]0.0151[/C][C]0.0012[/C][C]0[/C][C]397936.7779[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]53[/C][C]0.0215[/C][C]0.0296[/C][C]0.0154[/C][C]208704346.4333[/C][C]104551141.6056[/C][C]10225.0253[/C][/ROW]
[ROW][C]54[/C][C]0.0279[/C][C]0.0487[/C][C]0.0265[/C][C]573414608.1535[/C][C]260838963.7882[/C][C]16150.5097[/C][/ROW]
[ROW][C]55[/C][C]0.0354[/C][C]0.0622[/C][C]0.0354[/C][C]955979252.3381[/C][C]434624035.9257[/C][C]20847.6386[/C][/ROW]
[ROW][C]56[/C][C]0.0422[/C][C]0.0901[/C][C]0.0464[/C][C]1938287023.5646[/C][C]735356633.4535[/C][C]27117.4599[/C][/ROW]
[ROW][C]57[/C][C]0.0488[/C][C]0.1347[/C][C]0.0611[/C][C]4054823660.9131[/C][C]1288601138.0301[/C][C]35897.0909[/C][/ROW]
[ROW][C]58[/C][C]0.055[/C][C]0.1394[/C][C]0.0723[/C][C]4308837510.9548[/C][C]1720063477.0193[/C][C]41473.648[/C][/ROW]
[ROW][C]59[/C][C]0.064[/C][C]0.1594[/C][C]0.0832[/C][C]5180733052.8137[/C][C]2152647173.9936[/C][C]46396.6289[/C][/ROW]
[ROW][C]60[/C][C]0.0682[/C][C]0.1664[/C][C]0.0924[/C][C]5854755859.7503[/C][C]2563992583.5221[/C][C]50635.8824[/C][/ROW]
[ROW][C]61[/C][C]0.0659[/C][C]0.1508[/C][C]0.0983[/C][C]5905983937.7988[/C][C]2898191718.9498[/C][C]53834.856[/C][/ROW]
[ROW][C]62[/C][C]0.07[/C][C]0.1569[/C][C]0.1036[/C][C]6544659415.9413[/C][C]3229688782.3127[/C][C]56830.3509[/C][/ROW]
[ROW][C]63[/C][C]0.0769[/C][C]0.1588[/C][C]0.1082[/C][C]6326230253.8424[/C][C]3487733904.9401[/C][C]59057.0394[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69302&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69302&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
520.01510.00120397936.777900
530.02150.02960.0154208704346.4333104551141.605610225.0253
540.02790.04870.0265573414608.1535260838963.788216150.5097
550.03540.06220.0354955979252.3381434624035.925720847.6386
560.04220.09010.04641938287023.5646735356633.453527117.4599
570.04880.13470.06114054823660.91311288601138.030135897.0909
580.0550.13940.07234308837510.95481720063477.019341473.648
590.0640.15940.08325180733052.81372152647173.993646396.6289
600.06820.16640.09245854755859.75032563992583.522150635.8824
610.06590.15080.09835905983937.79882898191718.949853834.856
620.070.15690.10366544659415.94133229688782.312756830.3509
630.07690.15880.10826326230253.84243487733904.940159057.0394



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