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 computationSat, 19 Dec 2009 03:43:51 -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/19/t12612194655iwadgv0s1sbblh.htm/, Retrieved Sat, 04 May 2024 02:08:16 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69488, Retrieved Sat, 04 May 2024 02:08:16 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact164
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]
- R PD  [ARIMA Forecasting] [voorspelling van ...] [2009-12-13 20:23:46] [82d27727e9ba70a4d0e9e253f76836cf]
- R PD      [ARIMA Forecasting] [forecast aantal b...] [2009-12-19 10:43:51] [03368d751914a6c247d86aff8eac7cbf] [Current]
Feedback Forum

Post a new message
Dataseries X:
2360
2214
2825
2355
2333
3016
2155
2172
2150
2533
2058
2160
2260
2498
2695
2799
2947
2930
2318
2540
2570
2669
2450
2842
3440
2678
2981
2260
2844
2546
2456
2295
2379
2479
2057
2280
2351
2276
2548
2311
2201
2725
2408
2139
1898
2537
2069
2063
2524
2437
2189
2793
2074
2622
2278
2144
2427
2139
1828
2072
1800




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69488&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'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[49])
372351-------
382276-------
392548-------
402311-------
412201-------
422725-------
432408-------
442139-------
451898-------
462537-------
472069-------
482063-------
492524-------
5024372261.08911527.7012994.47720.31910.24110.48410.2411
5121892533.08911745.54933320.62880.19590.59450.48520.509
5227932296.08911457.88893134.28930.12260.59890.48610.297
5320742186.08911300.12053072.05770.40210.08970.48680.2274
5426222710.08911778.7993641.37920.42650.90970.48750.6523
5522782393.08911418.58313367.59510.40850.32260.4880.3962
5621442124.08911108.20393139.97430.48470.38330.48850.2202
5724271883.0891827.44542938.73280.15630.3140.4890.117
5821392522.08911428.1313616.04720.24620.56760.48930.4986
5918282054.0891923.11383185.06440.34760.44150.48970.2077
6020722048.0891881.27043214.90780.4840.64420.490.212
6118002509.08911307.49573710.68250.12370.76210.49030.4903

\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[49]) \tabularnewline
37 & 2351 & - & - & - & - & - & - & - \tabularnewline
38 & 2276 & - & - & - & - & - & - & - \tabularnewline
39 & 2548 & - & - & - & - & - & - & - \tabularnewline
40 & 2311 & - & - & - & - & - & - & - \tabularnewline
41 & 2201 & - & - & - & - & - & - & - \tabularnewline
42 & 2725 & - & - & - & - & - & - & - \tabularnewline
43 & 2408 & - & - & - & - & - & - & - \tabularnewline
44 & 2139 & - & - & - & - & - & - & - \tabularnewline
45 & 1898 & - & - & - & - & - & - & - \tabularnewline
46 & 2537 & - & - & - & - & - & - & - \tabularnewline
47 & 2069 & - & - & - & - & - & - & - \tabularnewline
48 & 2063 & - & - & - & - & - & - & - \tabularnewline
49 & 2524 & - & - & - & - & - & - & - \tabularnewline
50 & 2437 & 2261.0891 & 1527.701 & 2994.4772 & 0.3191 & 0.2411 & 0.4841 & 0.2411 \tabularnewline
51 & 2189 & 2533.0891 & 1745.5493 & 3320.6288 & 0.1959 & 0.5945 & 0.4852 & 0.509 \tabularnewline
52 & 2793 & 2296.0891 & 1457.8889 & 3134.2893 & 0.1226 & 0.5989 & 0.4861 & 0.297 \tabularnewline
53 & 2074 & 2186.0891 & 1300.1205 & 3072.0577 & 0.4021 & 0.0897 & 0.4868 & 0.2274 \tabularnewline
54 & 2622 & 2710.0891 & 1778.799 & 3641.3792 & 0.4265 & 0.9097 & 0.4875 & 0.6523 \tabularnewline
55 & 2278 & 2393.0891 & 1418.5831 & 3367.5951 & 0.4085 & 0.3226 & 0.488 & 0.3962 \tabularnewline
56 & 2144 & 2124.0891 & 1108.2039 & 3139.9743 & 0.4847 & 0.3833 & 0.4885 & 0.2202 \tabularnewline
57 & 2427 & 1883.0891 & 827.4454 & 2938.7328 & 0.1563 & 0.314 & 0.489 & 0.117 \tabularnewline
58 & 2139 & 2522.0891 & 1428.131 & 3616.0472 & 0.2462 & 0.5676 & 0.4893 & 0.4986 \tabularnewline
59 & 1828 & 2054.0891 & 923.1138 & 3185.0644 & 0.3476 & 0.4415 & 0.4897 & 0.2077 \tabularnewline
60 & 2072 & 2048.0891 & 881.2704 & 3214.9078 & 0.484 & 0.6442 & 0.49 & 0.212 \tabularnewline
61 & 1800 & 2509.0891 & 1307.4957 & 3710.6825 & 0.1237 & 0.7621 & 0.4903 & 0.4903 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69488&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[49])[/C][/ROW]
[ROW][C]37[/C][C]2351[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2276[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]2548[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2311[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]2201[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]2725[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]2408[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]2139[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1898[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2537[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2069[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]2063[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2524[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]2437[/C][C]2261.0891[/C][C]1527.701[/C][C]2994.4772[/C][C]0.3191[/C][C]0.2411[/C][C]0.4841[/C][C]0.2411[/C][/ROW]
[ROW][C]51[/C][C]2189[/C][C]2533.0891[/C][C]1745.5493[/C][C]3320.6288[/C][C]0.1959[/C][C]0.5945[/C][C]0.4852[/C][C]0.509[/C][/ROW]
[ROW][C]52[/C][C]2793[/C][C]2296.0891[/C][C]1457.8889[/C][C]3134.2893[/C][C]0.1226[/C][C]0.5989[/C][C]0.4861[/C][C]0.297[/C][/ROW]
[ROW][C]53[/C][C]2074[/C][C]2186.0891[/C][C]1300.1205[/C][C]3072.0577[/C][C]0.4021[/C][C]0.0897[/C][C]0.4868[/C][C]0.2274[/C][/ROW]
[ROW][C]54[/C][C]2622[/C][C]2710.0891[/C][C]1778.799[/C][C]3641.3792[/C][C]0.4265[/C][C]0.9097[/C][C]0.4875[/C][C]0.6523[/C][/ROW]
[ROW][C]55[/C][C]2278[/C][C]2393.0891[/C][C]1418.5831[/C][C]3367.5951[/C][C]0.4085[/C][C]0.3226[/C][C]0.488[/C][C]0.3962[/C][/ROW]
[ROW][C]56[/C][C]2144[/C][C]2124.0891[/C][C]1108.2039[/C][C]3139.9743[/C][C]0.4847[/C][C]0.3833[/C][C]0.4885[/C][C]0.2202[/C][/ROW]
[ROW][C]57[/C][C]2427[/C][C]1883.0891[/C][C]827.4454[/C][C]2938.7328[/C][C]0.1563[/C][C]0.314[/C][C]0.489[/C][C]0.117[/C][/ROW]
[ROW][C]58[/C][C]2139[/C][C]2522.0891[/C][C]1428.131[/C][C]3616.0472[/C][C]0.2462[/C][C]0.5676[/C][C]0.4893[/C][C]0.4986[/C][/ROW]
[ROW][C]59[/C][C]1828[/C][C]2054.0891[/C][C]923.1138[/C][C]3185.0644[/C][C]0.3476[/C][C]0.4415[/C][C]0.4897[/C][C]0.2077[/C][/ROW]
[ROW][C]60[/C][C]2072[/C][C]2048.0891[/C][C]881.2704[/C][C]3214.9078[/C][C]0.484[/C][C]0.6442[/C][C]0.49[/C][C]0.212[/C][/ROW]
[ROW][C]61[/C][C]1800[/C][C]2509.0891[/C][C]1307.4957[/C][C]3710.6825[/C][C]0.1237[/C][C]0.7621[/C][C]0.4903[/C][C]0.4903[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69488&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69488&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[49])
372351-------
382276-------
392548-------
402311-------
412201-------
422725-------
432408-------
442139-------
451898-------
462537-------
472069-------
482063-------
492524-------
5024372261.08911527.7012994.47720.31910.24110.48410.2411
5121892533.08911745.54933320.62880.19590.59450.48520.509
5227932296.08911457.88893134.28930.12260.59890.48610.297
5320742186.08911300.12053072.05770.40210.08970.48680.2274
5426222710.08911778.7993641.37920.42650.90970.48750.6523
5522782393.08911418.58313367.59510.40850.32260.4880.3962
5621442124.08911108.20393139.97430.48470.38330.48850.2202
5724271883.0891827.44542938.73280.15630.3140.4890.117
5821392522.08911428.1313616.04720.24620.56760.48930.4986
5918282054.0891923.11383185.06440.34760.44150.48970.2077
6020722048.0891881.27043214.90780.4840.64420.490.212
6118002509.08911307.49573710.68250.12370.76210.49030.4903







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.16550.0778030944.649400
510.1586-0.13580.1068118397.299574670.9745273.2599
520.18630.21640.1434246920.4558132087.4683363.4384
530.2068-0.05130.120312563.9633102206.592319.6977
540.1753-0.03250.10287759.687283317.2111288.6472
550.2078-0.04810.093713245.497971638.5922267.6539
560.2440.00940.0816396.444561461.1425247.9136
570.2860.28880.1075295839.081790758.3849301.2613
580.2213-0.15190.1124146757.248396980.4808311.4169
590.2809-0.11010.112251116.275192394.0603303.9639
600.29070.01170.1031571.731884046.5759289.9079
610.2443-0.28260.118502807.3328118943.3056344.8816

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.1655 & 0.0778 & 0 & 30944.6494 & 0 & 0 \tabularnewline
51 & 0.1586 & -0.1358 & 0.1068 & 118397.2995 & 74670.9745 & 273.2599 \tabularnewline
52 & 0.1863 & 0.2164 & 0.1434 & 246920.4558 & 132087.4683 & 363.4384 \tabularnewline
53 & 0.2068 & -0.0513 & 0.1203 & 12563.9633 & 102206.592 & 319.6977 \tabularnewline
54 & 0.1753 & -0.0325 & 0.1028 & 7759.6872 & 83317.2111 & 288.6472 \tabularnewline
55 & 0.2078 & -0.0481 & 0.0937 & 13245.4979 & 71638.5922 & 267.6539 \tabularnewline
56 & 0.244 & 0.0094 & 0.0816 & 396.4445 & 61461.1425 & 247.9136 \tabularnewline
57 & 0.286 & 0.2888 & 0.1075 & 295839.0817 & 90758.3849 & 301.2613 \tabularnewline
58 & 0.2213 & -0.1519 & 0.1124 & 146757.2483 & 96980.4808 & 311.4169 \tabularnewline
59 & 0.2809 & -0.1101 & 0.1122 & 51116.2751 & 92394.0603 & 303.9639 \tabularnewline
60 & 0.2907 & 0.0117 & 0.1031 & 571.7318 & 84046.5759 & 289.9079 \tabularnewline
61 & 0.2443 & -0.2826 & 0.118 & 502807.3328 & 118943.3056 & 344.8816 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69488&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]50[/C][C]0.1655[/C][C]0.0778[/C][C]0[/C][C]30944.6494[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.1586[/C][C]-0.1358[/C][C]0.1068[/C][C]118397.2995[/C][C]74670.9745[/C][C]273.2599[/C][/ROW]
[ROW][C]52[/C][C]0.1863[/C][C]0.2164[/C][C]0.1434[/C][C]246920.4558[/C][C]132087.4683[/C][C]363.4384[/C][/ROW]
[ROW][C]53[/C][C]0.2068[/C][C]-0.0513[/C][C]0.1203[/C][C]12563.9633[/C][C]102206.592[/C][C]319.6977[/C][/ROW]
[ROW][C]54[/C][C]0.1753[/C][C]-0.0325[/C][C]0.1028[/C][C]7759.6872[/C][C]83317.2111[/C][C]288.6472[/C][/ROW]
[ROW][C]55[/C][C]0.2078[/C][C]-0.0481[/C][C]0.0937[/C][C]13245.4979[/C][C]71638.5922[/C][C]267.6539[/C][/ROW]
[ROW][C]56[/C][C]0.244[/C][C]0.0094[/C][C]0.0816[/C][C]396.4445[/C][C]61461.1425[/C][C]247.9136[/C][/ROW]
[ROW][C]57[/C][C]0.286[/C][C]0.2888[/C][C]0.1075[/C][C]295839.0817[/C][C]90758.3849[/C][C]301.2613[/C][/ROW]
[ROW][C]58[/C][C]0.2213[/C][C]-0.1519[/C][C]0.1124[/C][C]146757.2483[/C][C]96980.4808[/C][C]311.4169[/C][/ROW]
[ROW][C]59[/C][C]0.2809[/C][C]-0.1101[/C][C]0.1122[/C][C]51116.2751[/C][C]92394.0603[/C][C]303.9639[/C][/ROW]
[ROW][C]60[/C][C]0.2907[/C][C]0.0117[/C][C]0.1031[/C][C]571.7318[/C][C]84046.5759[/C][C]289.9079[/C][/ROW]
[ROW][C]61[/C][C]0.2443[/C][C]-0.2826[/C][C]0.118[/C][C]502807.3328[/C][C]118943.3056[/C][C]344.8816[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69488&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69488&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
500.16550.0778030944.649400
510.1586-0.13580.1068118397.299574670.9745273.2599
520.18630.21640.1434246920.4558132087.4683363.4384
530.2068-0.05130.120312563.9633102206.592319.6977
540.1753-0.03250.10287759.687283317.2111288.6472
550.2078-0.04810.093713245.497971638.5922267.6539
560.2440.00940.0816396.444561461.1425247.9136
570.2860.28880.1075295839.081790758.3849301.2613
580.2213-0.15190.1124146757.248396980.4808311.4169
590.2809-0.11010.112251116.275192394.0603303.9639
600.29070.01170.1031571.731884046.5759289.9079
610.2443-0.28260.118502807.3328118943.3056344.8816



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