Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 09 Jun 2023 05:35:14 +0200
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2023/Jun/09/t1686281817clb6zyoc7tfrcv1.htm/, Retrieved Tue, 25 Aug 2026 15:01:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=319914, Retrieved Tue, 25 Aug 2026 15:01:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact355
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2023-06-09 03:35:14] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
1	05
2	04
3	01
4	19
5	10
6	06
7	07
8	11
9	07
10	10
11	05
12	17
13	04
14	08
15	05
16	01
17	04
18	01
19	06
20	22
21	09
22	03
23	09
24	07
25	14
26	20
27	04
28	21
29	01
30	31
31	29
32	05
33	14
34	01
35	06
36	04
37	01
38	02
39	13
40	07
41	03
42	02
43	19
44	02
45	12
46	20
47	01
48	11
49	05
50	01
51	02
52	02
53	05
54	09
55	27
56	03
57	05
58	06
59	11
60	05
61	02
62	22
63	07
64	07
65	07
66	08
67	04
68	01
69	04
70	18
71	04
72	03
73	06
74	12
75	02
76	03
77	01
78	21
79	15
80	01
81	12
82	01
83	21
84	08
85	09
86	16
87	01
88	11
89	05
90	08
91	04
92	04
93	02
94	14
95	09
96	01
97	15
98	03
99	11
100	01
101	01
102	09
103	05
104	03
105	20
106	07
107	12
108	01
109	04
110	02
111	02
112	04
113	16
114	17
115	23
116	12
117	01
118	23
119	16
120	03
121	02
122	01
123	03
124	13
125	33
126	04
127	24
128	07
129	09
130	03
131	05
132	11
133	11
134	09
135	04
136	03
137	14
138	16
139	02
140	06
141	17
142	11
143	03
144	30
145	04
146	02
147	06
148	08
149	04
150	05
151	11
152	07
153	11
154	21
155	11
156	01
157	06
158	11
159	03
160	24
161	16
162	29
163	06
164	07
165	09
166	14
167	10
168	02
169	05
170	02
171	08
172	04
173	09
174	13
175	04
176	02
177	08
178	03
179	01
180	02
181	08
182	03
183	03
184	03
185	05
186	10
187	05
188	12
189	05
190	01
191	02
192	01
193	16
194	08
195	01
196	03
197	14
198	19
199	22
200	03
201	03
202	13
203	12
204	09
205	17
206	03
207	03
208	10
209	03
210	10
211	09
212	03
213	01
214	02
215	14
216	01
217	08
218	03
219	03
220	05
221	08
222	02
223	23
224	10
225	03
226	12
227	07
228	04
229	13
230	13
231	01
232	31
233	20
234	15
235	10
236	11
237	20
238	02
239	01
240	08
241	05
242	12
243	03
244	16
245	08
246	04
247	01
248	01
249	02
250	18
251	09
252	18
253	10
254	08
255	07
256	03
257	15
258	03
259	03
260	01
261	16
262	01
263	10
264	01
265	09
266	16
267	07
268	08
269	20
270	16
271	01
272	03
273	02
274	01
275	03
276	19
277	06
278	06
279	08
280	06
281	11
282	13
283	04
284	15
285	17
286	10
287	18
288	10
289	02
290	02
291	06
292	13
293	24
294	09
295	01
296	03
297	09
298	06
299	02
300	04
301	05
302	04
303	06
304	05
305	04
306	04
307	15
308	05
309	03
310	02
311	03
312	01
313	13
314	09
315	01
316	07
317	04
318	19
319	09
320	10
321	04
322	19
323	16
324	10
325	13
326	13
327	20
328	07
329	06
330	18
331	10
332	03
333	02
334	02
335	12
336	07
337	04
338	05
339	04
340	10
341	08
342	04
343	21
344	09
345	05
346	01
347	02
348	09
349	18
350	12
351	18
352	02
353	03
354	01
355	01
356	10
357	09
358	06
359	19
360	21
361	07
362	07
363	01
364	08
365	21
366	09
367	07
368	05
369	01
370	03
371	04
372	18
373	05
374	03
375	05
376	10
377	02
378	12
379	04
380	08
381	17
382	08
383	03
384	10
385	13
386	14
387	09
388	01
389	12
390	02
391	06
392	13
393	09
394	04
395	25
396	26
397	27
398	01
399	07
400	05
401	03
402	09
403	14
404	08
405	05
406	23
407	02
408	12
409	01
410	03
411	10
412	03
413	07
414	01
415	12
416	04
417	04
418	12
419	02
420	01
421	09
422	18
423	01
424	07
425	19
426	05
427	02
428	04
429	11
430	01
431	12
432	04
433	06
434	08
435	01
436	03
437	07
438	02
439	05
440	05
441	02
442	09
443	02
444	05
445	04
446	03
447	07
448	03
449	03
450	05
451	02
452	03
453	06
454	04
455	02
456	03
457	06
458	13
459	10
460	02
461	03
462	02
463	03
464	01
465	22
466	14
467	01
468	21
469	01
470	11
471	07
472	09
473	22
474	18
475	20
476	13
477	01
478	04
479	05
480	12
481	07
482	01
483	03
484	12
485	11
486	10
487	05
488	12
489	08
490	03
491	08
492	02
493	12
494	03
495	09
496	08
497	02
498	01
499	12
500	02
501	04
502	05
503	06
504	12
505	08
506	04
507	18
508	01
509	06
510	05
511	10
512	02
513	03
514	03
515	10
516	15
517	14
518	10
519	11
520	01
521	04
522	02
523	07
524	05
525	07
526	10
527	19
528	01
529	13
530	05
531	09
532	12
533	07
534	03
535	02
536	04
537	28
538	06
539	15
540	03
541	04
542	02
543	01
544	16
545	09
546	06
547	23
548	02
549	18
550	15
551	04
552	07
553	03
554	17
555	16
556	09
557	19
558	05
559	02
560	13
561	02
562	27
563	08
564	12
565	25
566	05
567	04
568	18
569	05
570	01
571	03
572	03
573	03
574	07
575	15
576	14
577	01
578	13
579	01
580	06
581	07
582	15
583	06
584	03
585	02
586	06
587	04
588	14
589	16
590	11
591	04
592	11
593	18
594	01
595	03
596	03
597	06
598	05
599	04
600	04
601	17
602	03
603	07
604	05
605	03
606	02
607	02
608	02
609	05
610	22
611	02
612	11
613	10
614	07
615	01
616	11
617	19
618	06
619	08
620	17
621	10
622	03
623	15
624	06
625	07
626	07
627	18
628	05
629	11
630	06
631	01
632	14
633	09
634	09
635	03
636	03
637	05
638	21
639	02
640	31
641	37
642	05
643	23
644	12
645	03
646	18
647	08
648	18
649	06
650	05
651	16
652	02
653	12
654	06
655	07
656	04
657	03
658	08
659	10
660	19
661	04
662	23
663	08
664	06
665	03
666	09
667	04
668	11
669	04
670	06
671	12
672	07
673	20
674	06
675	08
676	02
677	02
678	01
679	06
680	13
681	01
682	12
683	03
684	04
685	05
686	05
687	01
688	09
689	02
690	05
691	15
692	04
693	05
694	03
695	01
696	12
697	06
698	01
699	08
700	01
701	05
702	01
703	05
704	05
705	32
706	05
707	06
708	02
709	11
710	01
711	04
712	02
713	21
714	03
715	14
716	08
717	11
718	01
719	27
720	15
721	12
722	09
723	02
724	11
725	03
726	19
727	18
728	04
729	33
730	04
731	07
732	03
733	16
734	30
735	10
736	02
737	09
738	06
739	09
740	10
741	14
742	05
743	05
744	06
745	05
746	18
747	05
748	12
749	11
750	06
751	08
752	02
753	27
754	05
755	05
756	01
757	02
758	08
759	06
760	09
761	01
762	19
763	17
764	23
765	06
766	13
767	19
768	01
769	02
770	04
771	11
772	01
773	09
774	02
775	09
776	03
777	05
778	08
779	12
780	01
781	11
782	15
783	14
784	05
785	06
786	11
787	11
788	12
789	08
790	06
791	15
792	17
793	08
794	01
795	01
796	03
797	08
798	10
799	12
800	08
801	08
802	04
803	01
804	03
805	03
806	04
807	08
808	02
809	11
810	16
811	01
812	06
813	02
814	10
815	02
816	01
817	02
818	14
819	05
820	11
821	06
822	10
823	09
824	05
825	03
826	05
827	05
828	05
829	01
830	03
831	03
832	08
833	09
834	10
835	03
836	02
837	06
838	01
839	04
840	01
841	01
842	11
843	04
844	12
845	01
846	02
847	01
848	09
849	08
850	12
851	13
852	14
853	06
854	18
855	07
856	04
857	17
858	06
859	06
860	12
861	13
862	07
863	17
864	10
865	22
866	01
867	17
868	07
869	09
870	06
871	08
872	02
873	04
874	13
875	01
876	07
877	01
878	22
879	19
880	13
881	01
882	26
883	15
884	04
885	01
886	03
887	23
888	01




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time0 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=319914&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]0 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=319914&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=319914&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R ServerBig Analytics Cloud Computing Center



Parameters (Session):
par1 = 0 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 0 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; 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*2
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,fx))
(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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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<br />(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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')