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, 23 Dec 2011 07:03:11 -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/2011/Dec/23/t1324641836bhzs6qnsk7am88g.htm/, Retrieved Mon, 29 Apr 2024 17:55:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=160326, Retrieved Mon, 29 Apr 2024 17:55:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact112
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Variance Reduction Matrix] [] [2011-12-06 08:04:41] [80bca13c5f9401fbb753952fd2952f4a]
- RMP   [(Partial) Autocorrelation Function] [] [2011-12-06 08:29:14] [80bca13c5f9401fbb753952fd2952f4a]
-   P     [(Partial) Autocorrelation Function] [] [2011-12-06 08:31:19] [80bca13c5f9401fbb753952fd2952f4a]
- RMP       [Variance Reduction Matrix] [] [2011-12-06 08:45:18] [80bca13c5f9401fbb753952fd2952f4a]
- RM          [ARIMA Backward Selection] [] [2011-12-06 09:03:08] [80bca13c5f9401fbb753952fd2952f4a]
- RM            [ARIMA Forecasting] [] [2011-12-06 09:14:29] [80bca13c5f9401fbb753952fd2952f4a]
-   PD              [ARIMA Forecasting] [Paper arima forec...] [2011-12-23 12:03:11] [c18e83883fa784c15a15b4fbc0636edd] [Current]
Feedback Forum

Post a new message
Dataseries X:
590865
589379
584428
573100
567456
569028
620735
628884
628232
612117
595404
597141
593408
590072
579799
574205
572775
572942
619567
625809
619916
587625
565742
557274
560576
548854
531673
525919
511038
498662
555362
564591
541657
527070
509846
514258
516922
507561
492622
490243
469357
477580
528379
533590
517945
506174
501866
516141
528222
532638
536322
536535
523597
536214
586570
596594
580523
564478
557560
575093
580112
574761
563250
551531
537034
544686
600991
604378
586111
563668
548604
551174




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.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 & 1 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160326&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]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160326&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160326&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'Herman Ole Andreas Wold' @ wold.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])
48516141-------
49528222-------
50532638-------
51536322-------
52536535-------
53523597-------
54536214-------
55586570-------
56596594-------
57580523-------
58564478-------
59557560-------
60575093-------
61580112585710.9778570111.4825601563.81080.24440.905410.9054
62574761588457.9236564865.9487612631.42990.13340.750710.8607
63563250588484.7557779.28620182.59250.05930.80190.99940.7962
64551531587614.724550191.4236626525.16590.03460.89010.9950.7359
65537034576853.9476533391.1439622375.18920.04320.86220.98910.5302
66544686586472.769536202.6462639469.47820.06110.96630.96850.6631
67600991641672.9443581972.0624704905.19260.10370.99870.95620.9805
68604378652612.1049585759.4752723845.23130.09220.92220.93840.9835
69586111639577.8219567224.7303717203.17570.08850.81290.9320.9483
70563668622976.5567545690.7798706482.99220.0820.80660.91510.8695
71548604613341.9345530888.4096703036.89530.07860.86110.88860.7984
72551174626906.2686537473.7063724719.81280.06460.94170.85040.8504

\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 & 516141 & - & - & - & - & - & - & - \tabularnewline
49 & 528222 & - & - & - & - & - & - & - \tabularnewline
50 & 532638 & - & - & - & - & - & - & - \tabularnewline
51 & 536322 & - & - & - & - & - & - & - \tabularnewline
52 & 536535 & - & - & - & - & - & - & - \tabularnewline
53 & 523597 & - & - & - & - & - & - & - \tabularnewline
54 & 536214 & - & - & - & - & - & - & - \tabularnewline
55 & 586570 & - & - & - & - & - & - & - \tabularnewline
56 & 596594 & - & - & - & - & - & - & - \tabularnewline
57 & 580523 & - & - & - & - & - & - & - \tabularnewline
58 & 564478 & - & - & - & - & - & - & - \tabularnewline
59 & 557560 & - & - & - & - & - & - & - \tabularnewline
60 & 575093 & - & - & - & - & - & - & - \tabularnewline
61 & 580112 & 585710.9778 & 570111.4825 & 601563.8108 & 0.2444 & 0.9054 & 1 & 0.9054 \tabularnewline
62 & 574761 & 588457.9236 & 564865.9487 & 612631.4299 & 0.1334 & 0.7507 & 1 & 0.8607 \tabularnewline
63 & 563250 & 588484.7 & 557779.28 & 620182.5925 & 0.0593 & 0.8019 & 0.9994 & 0.7962 \tabularnewline
64 & 551531 & 587614.724 & 550191.4236 & 626525.1659 & 0.0346 & 0.8901 & 0.995 & 0.7359 \tabularnewline
65 & 537034 & 576853.9476 & 533391.1439 & 622375.1892 & 0.0432 & 0.8622 & 0.9891 & 0.5302 \tabularnewline
66 & 544686 & 586472.769 & 536202.6462 & 639469.4782 & 0.0611 & 0.9663 & 0.9685 & 0.6631 \tabularnewline
67 & 600991 & 641672.9443 & 581972.0624 & 704905.1926 & 0.1037 & 0.9987 & 0.9562 & 0.9805 \tabularnewline
68 & 604378 & 652612.1049 & 585759.4752 & 723845.2313 & 0.0922 & 0.9222 & 0.9384 & 0.9835 \tabularnewline
69 & 586111 & 639577.8219 & 567224.7303 & 717203.1757 & 0.0885 & 0.8129 & 0.932 & 0.9483 \tabularnewline
70 & 563668 & 622976.5567 & 545690.7798 & 706482.9922 & 0.082 & 0.8066 & 0.9151 & 0.8695 \tabularnewline
71 & 548604 & 613341.9345 & 530888.4096 & 703036.8953 & 0.0786 & 0.8611 & 0.8886 & 0.7984 \tabularnewline
72 & 551174 & 626906.2686 & 537473.7063 & 724719.8128 & 0.0646 & 0.9417 & 0.8504 & 0.8504 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160326&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]516141[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]528222[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]532638[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]536322[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]536535[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]523597[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]536214[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]586570[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]596594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]580523[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]564478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]557560[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]575093[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]580112[/C][C]585710.9778[/C][C]570111.4825[/C][C]601563.8108[/C][C]0.2444[/C][C]0.9054[/C][C]1[/C][C]0.9054[/C][/ROW]
[ROW][C]62[/C][C]574761[/C][C]588457.9236[/C][C]564865.9487[/C][C]612631.4299[/C][C]0.1334[/C][C]0.7507[/C][C]1[/C][C]0.8607[/C][/ROW]
[ROW][C]63[/C][C]563250[/C][C]588484.7[/C][C]557779.28[/C][C]620182.5925[/C][C]0.0593[/C][C]0.8019[/C][C]0.9994[/C][C]0.7962[/C][/ROW]
[ROW][C]64[/C][C]551531[/C][C]587614.724[/C][C]550191.4236[/C][C]626525.1659[/C][C]0.0346[/C][C]0.8901[/C][C]0.995[/C][C]0.7359[/C][/ROW]
[ROW][C]65[/C][C]537034[/C][C]576853.9476[/C][C]533391.1439[/C][C]622375.1892[/C][C]0.0432[/C][C]0.8622[/C][C]0.9891[/C][C]0.5302[/C][/ROW]
[ROW][C]66[/C][C]544686[/C][C]586472.769[/C][C]536202.6462[/C][C]639469.4782[/C][C]0.0611[/C][C]0.9663[/C][C]0.9685[/C][C]0.6631[/C][/ROW]
[ROW][C]67[/C][C]600991[/C][C]641672.9443[/C][C]581972.0624[/C][C]704905.1926[/C][C]0.1037[/C][C]0.9987[/C][C]0.9562[/C][C]0.9805[/C][/ROW]
[ROW][C]68[/C][C]604378[/C][C]652612.1049[/C][C]585759.4752[/C][C]723845.2313[/C][C]0.0922[/C][C]0.9222[/C][C]0.9384[/C][C]0.9835[/C][/ROW]
[ROW][C]69[/C][C]586111[/C][C]639577.8219[/C][C]567224.7303[/C][C]717203.1757[/C][C]0.0885[/C][C]0.8129[/C][C]0.932[/C][C]0.9483[/C][/ROW]
[ROW][C]70[/C][C]563668[/C][C]622976.5567[/C][C]545690.7798[/C][C]706482.9922[/C][C]0.082[/C][C]0.8066[/C][C]0.9151[/C][C]0.8695[/C][/ROW]
[ROW][C]71[/C][C]548604[/C][C]613341.9345[/C][C]530888.4096[/C][C]703036.8953[/C][C]0.0786[/C][C]0.8611[/C][C]0.8886[/C][C]0.7984[/C][/ROW]
[ROW][C]72[/C][C]551174[/C][C]626906.2686[/C][C]537473.7063[/C][C]724719.8128[/C][C]0.0646[/C][C]0.9417[/C][C]0.8504[/C][C]0.8504[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160326&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160326&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])
48516141-------
49528222-------
50532638-------
51536322-------
52536535-------
53523597-------
54536214-------
55586570-------
56596594-------
57580523-------
58564478-------
59557560-------
60575093-------
61580112585710.9778570111.4825601563.81080.24440.905410.9054
62574761588457.9236564865.9487612631.42990.13340.750710.8607
63563250588484.7557779.28620182.59250.05930.80190.99940.7962
64551531587614.724550191.4236626525.16590.03460.89010.9950.7359
65537034576853.9476533391.1439622375.18920.04320.86220.98910.5302
66544686586472.769536202.6462639469.47820.06110.96630.96850.6631
67600991641672.9443581972.0624704905.19260.10370.99870.95620.9805
68604378652612.1049585759.4752723845.23130.09220.92220.93840.9835
69586111639577.8219567224.7303717203.17570.08850.81290.9320.9483
70563668622976.5567545690.7798706482.99220.0820.80660.91510.8695
71548604613341.9345530888.4096703036.89530.07860.86110.88860.7984
72551174626906.2686537473.7063724719.81280.06460.94170.85040.8504







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0138-0.0096031348552.042300
620.021-0.02330.0164187605716.4302109477134.236310463.1321
630.0275-0.04290.0252636790083.1442285248117.205616889.29
640.0338-0.06140.03431302035136.9868539444872.150923225.9526
650.0403-0.0690.04121585628229.4966748681543.6227362.0457
660.0461-0.07130.04621746134060.2392914923629.723230247.7045
670.0503-0.06340.04871655020590.10941020651766.921231947.641
680.0557-0.07390.05182326528874.28121183886405.341234407.6504
690.0619-0.08360.05542858701048.31821369976921.227637013.1993
700.0684-0.09520.05943517504893.32791584729718.437639808.6639
710.0746-0.10550.06364191000166.10671821663395.498442680.9489
720.0796-0.12080.06835735376501.56652147806154.337446344.4296

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0138 & -0.0096 & 0 & 31348552.0423 & 0 & 0 \tabularnewline
62 & 0.021 & -0.0233 & 0.0164 & 187605716.4302 & 109477134.2363 & 10463.1321 \tabularnewline
63 & 0.0275 & -0.0429 & 0.0252 & 636790083.1442 & 285248117.2056 & 16889.29 \tabularnewline
64 & 0.0338 & -0.0614 & 0.0343 & 1302035136.9868 & 539444872.1509 & 23225.9526 \tabularnewline
65 & 0.0403 & -0.069 & 0.0412 & 1585628229.4966 & 748681543.62 & 27362.0457 \tabularnewline
66 & 0.0461 & -0.0713 & 0.0462 & 1746134060.2392 & 914923629.7232 & 30247.7045 \tabularnewline
67 & 0.0503 & -0.0634 & 0.0487 & 1655020590.1094 & 1020651766.9212 & 31947.641 \tabularnewline
68 & 0.0557 & -0.0739 & 0.0518 & 2326528874.2812 & 1183886405.3412 & 34407.6504 \tabularnewline
69 & 0.0619 & -0.0836 & 0.0554 & 2858701048.3182 & 1369976921.2276 & 37013.1993 \tabularnewline
70 & 0.0684 & -0.0952 & 0.0594 & 3517504893.3279 & 1584729718.4376 & 39808.6639 \tabularnewline
71 & 0.0746 & -0.1055 & 0.0636 & 4191000166.1067 & 1821663395.4984 & 42680.9489 \tabularnewline
72 & 0.0796 & -0.1208 & 0.0683 & 5735376501.5665 & 2147806154.3374 & 46344.4296 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160326&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.0138[/C][C]-0.0096[/C][C]0[/C][C]31348552.0423[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.021[/C][C]-0.0233[/C][C]0.0164[/C][C]187605716.4302[/C][C]109477134.2363[/C][C]10463.1321[/C][/ROW]
[ROW][C]63[/C][C]0.0275[/C][C]-0.0429[/C][C]0.0252[/C][C]636790083.1442[/C][C]285248117.2056[/C][C]16889.29[/C][/ROW]
[ROW][C]64[/C][C]0.0338[/C][C]-0.0614[/C][C]0.0343[/C][C]1302035136.9868[/C][C]539444872.1509[/C][C]23225.9526[/C][/ROW]
[ROW][C]65[/C][C]0.0403[/C][C]-0.069[/C][C]0.0412[/C][C]1585628229.4966[/C][C]748681543.62[/C][C]27362.0457[/C][/ROW]
[ROW][C]66[/C][C]0.0461[/C][C]-0.0713[/C][C]0.0462[/C][C]1746134060.2392[/C][C]914923629.7232[/C][C]30247.7045[/C][/ROW]
[ROW][C]67[/C][C]0.0503[/C][C]-0.0634[/C][C]0.0487[/C][C]1655020590.1094[/C][C]1020651766.9212[/C][C]31947.641[/C][/ROW]
[ROW][C]68[/C][C]0.0557[/C][C]-0.0739[/C][C]0.0518[/C][C]2326528874.2812[/C][C]1183886405.3412[/C][C]34407.6504[/C][/ROW]
[ROW][C]69[/C][C]0.0619[/C][C]-0.0836[/C][C]0.0554[/C][C]2858701048.3182[/C][C]1369976921.2276[/C][C]37013.1993[/C][/ROW]
[ROW][C]70[/C][C]0.0684[/C][C]-0.0952[/C][C]0.0594[/C][C]3517504893.3279[/C][C]1584729718.4376[/C][C]39808.6639[/C][/ROW]
[ROW][C]71[/C][C]0.0746[/C][C]-0.1055[/C][C]0.0636[/C][C]4191000166.1067[/C][C]1821663395.4984[/C][C]42680.9489[/C][/ROW]
[ROW][C]72[/C][C]0.0796[/C][C]-0.1208[/C][C]0.0683[/C][C]5735376501.5665[/C][C]2147806154.3374[/C][C]46344.4296[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160326&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160326&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.0138-0.0096031348552.042300
620.021-0.02330.0164187605716.4302109477134.236310463.1321
630.0275-0.04290.0252636790083.1442285248117.205616889.29
640.0338-0.06140.03431302035136.9868539444872.150923225.9526
650.0403-0.0690.04121585628229.4966748681543.6227362.0457
660.0461-0.07130.04621746134060.2392914923629.723230247.7045
670.0503-0.06340.04871655020590.10941020651766.921231947.641
680.0557-0.07390.05182326528874.28121183886405.341234407.6504
690.0619-0.08360.05542858701048.31821369976921.227637013.1993
700.0684-0.09520.05943517504893.32791584729718.437639808.6639
710.0746-0.10550.06364191000166.10671821663395.498442680.9489
720.0796-0.12080.06835735376501.56652147806154.337446344.4296



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