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 13:21:13 -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/t1324664487hijmsgz2tbp6ewv.htm/, Retrieved Mon, 29 Apr 2024 19:25:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=160620, Retrieved Mon, 29 Apr 2024 19:25:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact75
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Recursive Partitioning (Regression Trees)] [] [2010-12-05 18:59:57] [b98453cac15ba1066b407e146608df68]
- R PD  [Recursive Partitioning (Regression Trees)] [Recursive Patterning] [2011-12-09 14:04:03] [74b1e5a3104ff0b2404b2865a63336ad]
-   PD    [Recursive Partitioning (Regression Trees)] [paper3-4] [2011-12-23 16:01:31] [f7a862281046b7153543b12c78921b36]
-   P       [Recursive Partitioning (Regression Trees)] [paper3-5] [2011-12-23 16:22:12] [f7a862281046b7153543b12c78921b36]
- RMPD          [ARIMA Forecasting] [paper2-12] [2011-12-23 18:21:13] [47995d3a8fac585eeb070a274b466f8c] [Current]
Feedback Forum

Post a new message
Dataseries X:
1770
2203
2836
1976
2837
2150
2180
2631
1781
2327
2260
2051
2250
2102
2957
2485
2871
2447
2570
2622
1840
2682
2369
2119
2531
2214
3206
2709
2734
2348
2702
2642
2064
2647
2534
2297
2718
2321
3112
2664
2808
2668
2934
2616
2228
2463
2416
2407
2582
2101
3305
2818
2401
3019
2507
2948
2210
2467
2596
2451




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160620&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'AstonUniversity' @ aston.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[48])
362297-------
372718-------
382321-------
393112-------
402664-------
412808-------
422668-------
432934-------
442616-------
452228-------
462463-------
472416-------
482407-------
4925822519.78812208.9162830.66030.34740.76150.10570.7615
5021012272.43221952.34582592.51870.14690.0290.38310.205
5133053224.56522903.79913545.33130.311510.75421
5228182551.82972162.0882941.57140.09041e-040.28630.7668
5324012796.77782405.87583187.67980.02360.45760.47760.9747
5430192649.31822257.09823041.53810.03230.89270.46280.887
5525072792.49332371.34143213.64510.0920.14590.25510.9636
5629482640.38292219.17793061.58790.07620.73260.54520.8613
5722102217.28181794.52722640.03640.48654e-040.48020.1895
5824672439.48822004.27492874.70140.45070.84930.45780.5582
5925962464.62872029.40072899.85660.27710.49570.58670.6024
6024512391.83721955.17252828.50180.39530.17970.47290.4729

\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 & 2297 & - & - & - & - & - & - & - \tabularnewline
37 & 2718 & - & - & - & - & - & - & - \tabularnewline
38 & 2321 & - & - & - & - & - & - & - \tabularnewline
39 & 3112 & - & - & - & - & - & - & - \tabularnewline
40 & 2664 & - & - & - & - & - & - & - \tabularnewline
41 & 2808 & - & - & - & - & - & - & - \tabularnewline
42 & 2668 & - & - & - & - & - & - & - \tabularnewline
43 & 2934 & - & - & - & - & - & - & - \tabularnewline
44 & 2616 & - & - & - & - & - & - & - \tabularnewline
45 & 2228 & - & - & - & - & - & - & - \tabularnewline
46 & 2463 & - & - & - & - & - & - & - \tabularnewline
47 & 2416 & - & - & - & - & - & - & - \tabularnewline
48 & 2407 & - & - & - & - & - & - & - \tabularnewline
49 & 2582 & 2519.7881 & 2208.916 & 2830.6603 & 0.3474 & 0.7615 & 0.1057 & 0.7615 \tabularnewline
50 & 2101 & 2272.4322 & 1952.3458 & 2592.5187 & 0.1469 & 0.029 & 0.3831 & 0.205 \tabularnewline
51 & 3305 & 3224.5652 & 2903.7991 & 3545.3313 & 0.3115 & 1 & 0.7542 & 1 \tabularnewline
52 & 2818 & 2551.8297 & 2162.088 & 2941.5714 & 0.0904 & 1e-04 & 0.2863 & 0.7668 \tabularnewline
53 & 2401 & 2796.7778 & 2405.8758 & 3187.6798 & 0.0236 & 0.4576 & 0.4776 & 0.9747 \tabularnewline
54 & 3019 & 2649.3182 & 2257.0982 & 3041.5381 & 0.0323 & 0.8927 & 0.4628 & 0.887 \tabularnewline
55 & 2507 & 2792.4933 & 2371.3414 & 3213.6451 & 0.092 & 0.1459 & 0.2551 & 0.9636 \tabularnewline
56 & 2948 & 2640.3829 & 2219.1779 & 3061.5879 & 0.0762 & 0.7326 & 0.5452 & 0.8613 \tabularnewline
57 & 2210 & 2217.2818 & 1794.5272 & 2640.0364 & 0.4865 & 4e-04 & 0.4802 & 0.1895 \tabularnewline
58 & 2467 & 2439.4882 & 2004.2749 & 2874.7014 & 0.4507 & 0.8493 & 0.4578 & 0.5582 \tabularnewline
59 & 2596 & 2464.6287 & 2029.4007 & 2899.8566 & 0.2771 & 0.4957 & 0.5867 & 0.6024 \tabularnewline
60 & 2451 & 2391.8372 & 1955.1725 & 2828.5018 & 0.3953 & 0.1797 & 0.4729 & 0.4729 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160620&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]2297[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2718[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2321[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2664[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]2808[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]2668[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]2934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]2616[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]2228[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2463[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2416[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]2407[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2582[/C][C]2519.7881[/C][C]2208.916[/C][C]2830.6603[/C][C]0.3474[/C][C]0.7615[/C][C]0.1057[/C][C]0.7615[/C][/ROW]
[ROW][C]50[/C][C]2101[/C][C]2272.4322[/C][C]1952.3458[/C][C]2592.5187[/C][C]0.1469[/C][C]0.029[/C][C]0.3831[/C][C]0.205[/C][/ROW]
[ROW][C]51[/C][C]3305[/C][C]3224.5652[/C][C]2903.7991[/C][C]3545.3313[/C][C]0.3115[/C][C]1[/C][C]0.7542[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]2818[/C][C]2551.8297[/C][C]2162.088[/C][C]2941.5714[/C][C]0.0904[/C][C]1e-04[/C][C]0.2863[/C][C]0.7668[/C][/ROW]
[ROW][C]53[/C][C]2401[/C][C]2796.7778[/C][C]2405.8758[/C][C]3187.6798[/C][C]0.0236[/C][C]0.4576[/C][C]0.4776[/C][C]0.9747[/C][/ROW]
[ROW][C]54[/C][C]3019[/C][C]2649.3182[/C][C]2257.0982[/C][C]3041.5381[/C][C]0.0323[/C][C]0.8927[/C][C]0.4628[/C][C]0.887[/C][/ROW]
[ROW][C]55[/C][C]2507[/C][C]2792.4933[/C][C]2371.3414[/C][C]3213.6451[/C][C]0.092[/C][C]0.1459[/C][C]0.2551[/C][C]0.9636[/C][/ROW]
[ROW][C]56[/C][C]2948[/C][C]2640.3829[/C][C]2219.1779[/C][C]3061.5879[/C][C]0.0762[/C][C]0.7326[/C][C]0.5452[/C][C]0.8613[/C][/ROW]
[ROW][C]57[/C][C]2210[/C][C]2217.2818[/C][C]1794.5272[/C][C]2640.0364[/C][C]0.4865[/C][C]4e-04[/C][C]0.4802[/C][C]0.1895[/C][/ROW]
[ROW][C]58[/C][C]2467[/C][C]2439.4882[/C][C]2004.2749[/C][C]2874.7014[/C][C]0.4507[/C][C]0.8493[/C][C]0.4578[/C][C]0.5582[/C][/ROW]
[ROW][C]59[/C][C]2596[/C][C]2464.6287[/C][C]2029.4007[/C][C]2899.8566[/C][C]0.2771[/C][C]0.4957[/C][C]0.5867[/C][C]0.6024[/C][/ROW]
[ROW][C]60[/C][C]2451[/C][C]2391.8372[/C][C]1955.1725[/C][C]2828.5018[/C][C]0.3953[/C][C]0.1797[/C][C]0.4729[/C][C]0.4729[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160620&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160620&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])
362297-------
372718-------
382321-------
393112-------
402664-------
412808-------
422668-------
432934-------
442616-------
452228-------
462463-------
472416-------
482407-------
4925822519.78812208.9162830.66030.34740.76150.10570.7615
5021012272.43221952.34582592.51870.14690.0290.38310.205
5133053224.56522903.79913545.33130.311510.75421
5228182551.82972162.0882941.57140.09041e-040.28630.7668
5324012796.77782405.87583187.67980.02360.45760.47760.9747
5430192649.31822257.09823041.53810.03230.89270.46280.887
5525072792.49332371.34143213.64510.0920.14590.25510.9636
5629482640.38292219.17793061.58790.07620.73260.54520.8613
5722102217.28181794.52722640.03640.48654e-040.48020.1895
5824672439.48822004.27492874.70140.45070.84930.45780.5582
5925962464.62872029.40072899.85660.27710.49570.58670.6024
6024512391.83721955.17252828.50180.39530.17970.47290.4729







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.06290.024703870.317900
500.0719-0.07540.050129389.014116629.666128.9561
510.05080.02490.04176469.752913243.0283115.0784
520.07790.10430.057370846.651427643.9341166.2647
530.0713-0.14150.0742156640.07353443.1618231.1778
540.07550.13950.0851136664.656267313.4109259.4483
550.0769-0.10220.087581506.406969340.9818263.3268
560.08140.11650.091194628.306672501.8974269.2618
570.0973-0.00330.081453.024864452.0226253.874
580.0910.01130.0744756.901258082.5105241.0031
590.09010.05330.072517258.430954371.2305233.1764
600.09310.02470.06853500.239950131.9813223.9017

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0629 & 0.0247 & 0 & 3870.3179 & 0 & 0 \tabularnewline
50 & 0.0719 & -0.0754 & 0.0501 & 29389.0141 & 16629.666 & 128.9561 \tabularnewline
51 & 0.0508 & 0.0249 & 0.0417 & 6469.7529 & 13243.0283 & 115.0784 \tabularnewline
52 & 0.0779 & 0.1043 & 0.0573 & 70846.6514 & 27643.9341 & 166.2647 \tabularnewline
53 & 0.0713 & -0.1415 & 0.0742 & 156640.073 & 53443.1618 & 231.1778 \tabularnewline
54 & 0.0755 & 0.1395 & 0.0851 & 136664.6562 & 67313.4109 & 259.4483 \tabularnewline
55 & 0.0769 & -0.1022 & 0.0875 & 81506.4069 & 69340.9818 & 263.3268 \tabularnewline
56 & 0.0814 & 0.1165 & 0.0911 & 94628.3066 & 72501.8974 & 269.2618 \tabularnewline
57 & 0.0973 & -0.0033 & 0.0814 & 53.0248 & 64452.0226 & 253.874 \tabularnewline
58 & 0.091 & 0.0113 & 0.0744 & 756.9012 & 58082.5105 & 241.0031 \tabularnewline
59 & 0.0901 & 0.0533 & 0.0725 & 17258.4309 & 54371.2305 & 233.1764 \tabularnewline
60 & 0.0931 & 0.0247 & 0.0685 & 3500.2399 & 50131.9813 & 223.9017 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160620&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.0629[/C][C]0.0247[/C][C]0[/C][C]3870.3179[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0719[/C][C]-0.0754[/C][C]0.0501[/C][C]29389.0141[/C][C]16629.666[/C][C]128.9561[/C][/ROW]
[ROW][C]51[/C][C]0.0508[/C][C]0.0249[/C][C]0.0417[/C][C]6469.7529[/C][C]13243.0283[/C][C]115.0784[/C][/ROW]
[ROW][C]52[/C][C]0.0779[/C][C]0.1043[/C][C]0.0573[/C][C]70846.6514[/C][C]27643.9341[/C][C]166.2647[/C][/ROW]
[ROW][C]53[/C][C]0.0713[/C][C]-0.1415[/C][C]0.0742[/C][C]156640.073[/C][C]53443.1618[/C][C]231.1778[/C][/ROW]
[ROW][C]54[/C][C]0.0755[/C][C]0.1395[/C][C]0.0851[/C][C]136664.6562[/C][C]67313.4109[/C][C]259.4483[/C][/ROW]
[ROW][C]55[/C][C]0.0769[/C][C]-0.1022[/C][C]0.0875[/C][C]81506.4069[/C][C]69340.9818[/C][C]263.3268[/C][/ROW]
[ROW][C]56[/C][C]0.0814[/C][C]0.1165[/C][C]0.0911[/C][C]94628.3066[/C][C]72501.8974[/C][C]269.2618[/C][/ROW]
[ROW][C]57[/C][C]0.0973[/C][C]-0.0033[/C][C]0.0814[/C][C]53.0248[/C][C]64452.0226[/C][C]253.874[/C][/ROW]
[ROW][C]58[/C][C]0.091[/C][C]0.0113[/C][C]0.0744[/C][C]756.9012[/C][C]58082.5105[/C][C]241.0031[/C][/ROW]
[ROW][C]59[/C][C]0.0901[/C][C]0.0533[/C][C]0.0725[/C][C]17258.4309[/C][C]54371.2305[/C][C]233.1764[/C][/ROW]
[ROW][C]60[/C][C]0.0931[/C][C]0.0247[/C][C]0.0685[/C][C]3500.2399[/C][C]50131.9813[/C][C]223.9017[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160620&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160620&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.06290.024703870.317900
500.0719-0.07540.050129389.014116629.666128.9561
510.05080.02490.04176469.752913243.0283115.0784
520.07790.10430.057370846.651427643.9341166.2647
530.0713-0.14150.0742156640.07353443.1618231.1778
540.07550.13950.0851136664.656267313.4109259.4483
550.0769-0.10220.087581506.406969340.9818263.3268
560.08140.11650.091194628.306672501.8974269.2618
570.0973-0.00330.081453.024864452.0226253.874
580.0910.01130.0744756.901258082.5105241.0031
590.09010.05330.072517258.430954371.2305233.1764
600.09310.02470.06853500.239950131.9813223.9017



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