Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_decompose.wasp
Title produced by softwareClassical Decomposition
Date of computationSat, 26 Nov 2016 18:20:06 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Nov/26/t1480184561fxxhdfcnriapd9q.htm/, Retrieved Fri, 03 May 2024 18:55:11 +0200
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=, Retrieved Fri, 03 May 2024 18:55:11 +0200
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact0
Dataseries X:
18347,7
19372,7
22263,8
19422,9
21268,6
20310
19256
17535,9
19857,4
19628,4
19727,5
18112,2
18889,3
20516,1
22317
19768,8
20015,8
20260,5
19434,3
17910
19134,4
20880,1
19680
17493,4
19155,9
19151
21318,2
20601,3
20496,8
19834,4
20997,6
17111,1
20752,3
21600,7
19939,5
18854,1
19697,4
19865
20930,3
20873,8
20007,5
20584,9
20604,1
16956,2
21731,2
21784,8
19280,6
17912,3
17904,8
19507,1
21188,7
20405,9
19214,4
21839,1
20030,6
16596,6
19996,3
20776,6
19003,1
18620,8




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&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'Sir Maurice George Kendall' @ kendall.wessa.net







Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
118347.7NANA-894.063NA
219372.7NANA-44.3977NA
322263.8NANA1642.69NA
419422.9NANA603.183NA
521268.6NANA119.943NA
620310NANA818.291NA
7192561987519614.5260.484-618.975
817535.917253.719684.7-2431282.203
919857.420303.919734.6569.321-446.479
1019628.420926.119751.21174.96-1297.74
1119727.519582.919713.4-130.486144.586
1218112.217970.219659.1-1688.92141.979
1318889.318770.419664.5-894.063118.859
1420516.119643.119687.5-44.3977872.977
152231721315.7196731642.691001.33
1619768.820298.219695603.183-529.395
1720015.819865.119745.2119.943150.67
1820260.520535.719717.4818.291-275.216
1919434.319963.219702.7260.484-528.934
20179101722619657-2431684.024
2119134.420127.819558.5569.321-993.404
2220880.120726.519551.61174.96153.59
231968019475.819606.3-130.486204.203
2417493.417919.719608.6-1688.92-426.254
2519155.918761.919656-894.063394.009
261915119643.419687.8-44.3977-492.407
2721318.221364.619721.91642.69-46.419
2820601.320422.519819.4603.183178.751
2920496.819980.119860.2119.943516.653
3019834.42074619927.7818.291-911.603
3120997.620267.520007260.484730.146
3217111.117628.320059.3-2431-517.18
3320752.320642.220072.9569.321110.108
3421600.72124320068.11174.96357.682
3519939.519928.520059-130.48610.957
3618854.11838120069.9-1688.92473.104
3719697.419190.720084.8-894.063506.676
381986520017.520061.9-44.3977-152.54
3920930.32173920096.31642.69-808.661
4020873.820747.920144.7603.183125.888
4120007.520244.920124.9119.943-237.389
4220584.920876.520058.3818.291-291.641
4320604.120204.819944.3260.484399.3
4416956.217423.719854.7-2431-467.51
4521731.220419.919850.6569.3211311.31
4621784.821016.819841.81174.96768.007
4719280.619658.819789.3-130.486-378.21
4817912.318119.619808.5-1688.92-207.292
4917904.818942.819836.9-894.063-1038.01
5019507.119753.619798-44.3977-246.494
5121188.721353.419710.71642.69-164.711
5220405.920199.619596.4603.183206.292
5319214.419662.819542.9119.943-448.397
5421839.120379.119560.8818.2911460
5520030.6NANA260.484NA
5616596.6NANA-2431NA
5719996.3NANA569.321NA
5820776.6NANA1174.96NA
5919003.1NANA-130.486NA
6018620.8NANA-1688.92NA

\begin{tabular}{lllllllll}
\hline
Classical Decomposition by Moving Averages \tabularnewline
t & Observations & Fit & Trend & Seasonal & Random \tabularnewline
1 & 18347.7 & NA & NA & -894.063 & NA \tabularnewline
2 & 19372.7 & NA & NA & -44.3977 & NA \tabularnewline
3 & 22263.8 & NA & NA & 1642.69 & NA \tabularnewline
4 & 19422.9 & NA & NA & 603.183 & NA \tabularnewline
5 & 21268.6 & NA & NA & 119.943 & NA \tabularnewline
6 & 20310 & NA & NA & 818.291 & NA \tabularnewline
7 & 19256 & 19875 & 19614.5 & 260.484 & -618.975 \tabularnewline
8 & 17535.9 & 17253.7 & 19684.7 & -2431 & 282.203 \tabularnewline
9 & 19857.4 & 20303.9 & 19734.6 & 569.321 & -446.479 \tabularnewline
10 & 19628.4 & 20926.1 & 19751.2 & 1174.96 & -1297.74 \tabularnewline
11 & 19727.5 & 19582.9 & 19713.4 & -130.486 & 144.586 \tabularnewline
12 & 18112.2 & 17970.2 & 19659.1 & -1688.92 & 141.979 \tabularnewline
13 & 18889.3 & 18770.4 & 19664.5 & -894.063 & 118.859 \tabularnewline
14 & 20516.1 & 19643.1 & 19687.5 & -44.3977 & 872.977 \tabularnewline
15 & 22317 & 21315.7 & 19673 & 1642.69 & 1001.33 \tabularnewline
16 & 19768.8 & 20298.2 & 19695 & 603.183 & -529.395 \tabularnewline
17 & 20015.8 & 19865.1 & 19745.2 & 119.943 & 150.67 \tabularnewline
18 & 20260.5 & 20535.7 & 19717.4 & 818.291 & -275.216 \tabularnewline
19 & 19434.3 & 19963.2 & 19702.7 & 260.484 & -528.934 \tabularnewline
20 & 17910 & 17226 & 19657 & -2431 & 684.024 \tabularnewline
21 & 19134.4 & 20127.8 & 19558.5 & 569.321 & -993.404 \tabularnewline
22 & 20880.1 & 20726.5 & 19551.6 & 1174.96 & 153.59 \tabularnewline
23 & 19680 & 19475.8 & 19606.3 & -130.486 & 204.203 \tabularnewline
24 & 17493.4 & 17919.7 & 19608.6 & -1688.92 & -426.254 \tabularnewline
25 & 19155.9 & 18761.9 & 19656 & -894.063 & 394.009 \tabularnewline
26 & 19151 & 19643.4 & 19687.8 & -44.3977 & -492.407 \tabularnewline
27 & 21318.2 & 21364.6 & 19721.9 & 1642.69 & -46.419 \tabularnewline
28 & 20601.3 & 20422.5 & 19819.4 & 603.183 & 178.751 \tabularnewline
29 & 20496.8 & 19980.1 & 19860.2 & 119.943 & 516.653 \tabularnewline
30 & 19834.4 & 20746 & 19927.7 & 818.291 & -911.603 \tabularnewline
31 & 20997.6 & 20267.5 & 20007 & 260.484 & 730.146 \tabularnewline
32 & 17111.1 & 17628.3 & 20059.3 & -2431 & -517.18 \tabularnewline
33 & 20752.3 & 20642.2 & 20072.9 & 569.321 & 110.108 \tabularnewline
34 & 21600.7 & 21243 & 20068.1 & 1174.96 & 357.682 \tabularnewline
35 & 19939.5 & 19928.5 & 20059 & -130.486 & 10.957 \tabularnewline
36 & 18854.1 & 18381 & 20069.9 & -1688.92 & 473.104 \tabularnewline
37 & 19697.4 & 19190.7 & 20084.8 & -894.063 & 506.676 \tabularnewline
38 & 19865 & 20017.5 & 20061.9 & -44.3977 & -152.54 \tabularnewline
39 & 20930.3 & 21739 & 20096.3 & 1642.69 & -808.661 \tabularnewline
40 & 20873.8 & 20747.9 & 20144.7 & 603.183 & 125.888 \tabularnewline
41 & 20007.5 & 20244.9 & 20124.9 & 119.943 & -237.389 \tabularnewline
42 & 20584.9 & 20876.5 & 20058.3 & 818.291 & -291.641 \tabularnewline
43 & 20604.1 & 20204.8 & 19944.3 & 260.484 & 399.3 \tabularnewline
44 & 16956.2 & 17423.7 & 19854.7 & -2431 & -467.51 \tabularnewline
45 & 21731.2 & 20419.9 & 19850.6 & 569.321 & 1311.31 \tabularnewline
46 & 21784.8 & 21016.8 & 19841.8 & 1174.96 & 768.007 \tabularnewline
47 & 19280.6 & 19658.8 & 19789.3 & -130.486 & -378.21 \tabularnewline
48 & 17912.3 & 18119.6 & 19808.5 & -1688.92 & -207.292 \tabularnewline
49 & 17904.8 & 18942.8 & 19836.9 & -894.063 & -1038.01 \tabularnewline
50 & 19507.1 & 19753.6 & 19798 & -44.3977 & -246.494 \tabularnewline
51 & 21188.7 & 21353.4 & 19710.7 & 1642.69 & -164.711 \tabularnewline
52 & 20405.9 & 20199.6 & 19596.4 & 603.183 & 206.292 \tabularnewline
53 & 19214.4 & 19662.8 & 19542.9 & 119.943 & -448.397 \tabularnewline
54 & 21839.1 & 20379.1 & 19560.8 & 818.291 & 1460 \tabularnewline
55 & 20030.6 & NA & NA & 260.484 & NA \tabularnewline
56 & 16596.6 & NA & NA & -2431 & NA \tabularnewline
57 & 19996.3 & NA & NA & 569.321 & NA \tabularnewline
58 & 20776.6 & NA & NA & 1174.96 & NA \tabularnewline
59 & 19003.1 & NA & NA & -130.486 & NA \tabularnewline
60 & 18620.8 & NA & NA & -1688.92 & NA \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&T=1

[TABLE]
[ROW][C]Classical Decomposition by Moving Averages[/C][/ROW]
[ROW][C]t[/C][C]Observations[/C][C]Fit[/C][C]Trend[/C][C]Seasonal[/C][C]Random[/C][/ROW]
[ROW][C]1[/C][C]18347.7[/C][C]NA[/C][C]NA[/C][C]-894.063[/C][C]NA[/C][/ROW]
[ROW][C]2[/C][C]19372.7[/C][C]NA[/C][C]NA[/C][C]-44.3977[/C][C]NA[/C][/ROW]
[ROW][C]3[/C][C]22263.8[/C][C]NA[/C][C]NA[/C][C]1642.69[/C][C]NA[/C][/ROW]
[ROW][C]4[/C][C]19422.9[/C][C]NA[/C][C]NA[/C][C]603.183[/C][C]NA[/C][/ROW]
[ROW][C]5[/C][C]21268.6[/C][C]NA[/C][C]NA[/C][C]119.943[/C][C]NA[/C][/ROW]
[ROW][C]6[/C][C]20310[/C][C]NA[/C][C]NA[/C][C]818.291[/C][C]NA[/C][/ROW]
[ROW][C]7[/C][C]19256[/C][C]19875[/C][C]19614.5[/C][C]260.484[/C][C]-618.975[/C][/ROW]
[ROW][C]8[/C][C]17535.9[/C][C]17253.7[/C][C]19684.7[/C][C]-2431[/C][C]282.203[/C][/ROW]
[ROW][C]9[/C][C]19857.4[/C][C]20303.9[/C][C]19734.6[/C][C]569.321[/C][C]-446.479[/C][/ROW]
[ROW][C]10[/C][C]19628.4[/C][C]20926.1[/C][C]19751.2[/C][C]1174.96[/C][C]-1297.74[/C][/ROW]
[ROW][C]11[/C][C]19727.5[/C][C]19582.9[/C][C]19713.4[/C][C]-130.486[/C][C]144.586[/C][/ROW]
[ROW][C]12[/C][C]18112.2[/C][C]17970.2[/C][C]19659.1[/C][C]-1688.92[/C][C]141.979[/C][/ROW]
[ROW][C]13[/C][C]18889.3[/C][C]18770.4[/C][C]19664.5[/C][C]-894.063[/C][C]118.859[/C][/ROW]
[ROW][C]14[/C][C]20516.1[/C][C]19643.1[/C][C]19687.5[/C][C]-44.3977[/C][C]872.977[/C][/ROW]
[ROW][C]15[/C][C]22317[/C][C]21315.7[/C][C]19673[/C][C]1642.69[/C][C]1001.33[/C][/ROW]
[ROW][C]16[/C][C]19768.8[/C][C]20298.2[/C][C]19695[/C][C]603.183[/C][C]-529.395[/C][/ROW]
[ROW][C]17[/C][C]20015.8[/C][C]19865.1[/C][C]19745.2[/C][C]119.943[/C][C]150.67[/C][/ROW]
[ROW][C]18[/C][C]20260.5[/C][C]20535.7[/C][C]19717.4[/C][C]818.291[/C][C]-275.216[/C][/ROW]
[ROW][C]19[/C][C]19434.3[/C][C]19963.2[/C][C]19702.7[/C][C]260.484[/C][C]-528.934[/C][/ROW]
[ROW][C]20[/C][C]17910[/C][C]17226[/C][C]19657[/C][C]-2431[/C][C]684.024[/C][/ROW]
[ROW][C]21[/C][C]19134.4[/C][C]20127.8[/C][C]19558.5[/C][C]569.321[/C][C]-993.404[/C][/ROW]
[ROW][C]22[/C][C]20880.1[/C][C]20726.5[/C][C]19551.6[/C][C]1174.96[/C][C]153.59[/C][/ROW]
[ROW][C]23[/C][C]19680[/C][C]19475.8[/C][C]19606.3[/C][C]-130.486[/C][C]204.203[/C][/ROW]
[ROW][C]24[/C][C]17493.4[/C][C]17919.7[/C][C]19608.6[/C][C]-1688.92[/C][C]-426.254[/C][/ROW]
[ROW][C]25[/C][C]19155.9[/C][C]18761.9[/C][C]19656[/C][C]-894.063[/C][C]394.009[/C][/ROW]
[ROW][C]26[/C][C]19151[/C][C]19643.4[/C][C]19687.8[/C][C]-44.3977[/C][C]-492.407[/C][/ROW]
[ROW][C]27[/C][C]21318.2[/C][C]21364.6[/C][C]19721.9[/C][C]1642.69[/C][C]-46.419[/C][/ROW]
[ROW][C]28[/C][C]20601.3[/C][C]20422.5[/C][C]19819.4[/C][C]603.183[/C][C]178.751[/C][/ROW]
[ROW][C]29[/C][C]20496.8[/C][C]19980.1[/C][C]19860.2[/C][C]119.943[/C][C]516.653[/C][/ROW]
[ROW][C]30[/C][C]19834.4[/C][C]20746[/C][C]19927.7[/C][C]818.291[/C][C]-911.603[/C][/ROW]
[ROW][C]31[/C][C]20997.6[/C][C]20267.5[/C][C]20007[/C][C]260.484[/C][C]730.146[/C][/ROW]
[ROW][C]32[/C][C]17111.1[/C][C]17628.3[/C][C]20059.3[/C][C]-2431[/C][C]-517.18[/C][/ROW]
[ROW][C]33[/C][C]20752.3[/C][C]20642.2[/C][C]20072.9[/C][C]569.321[/C][C]110.108[/C][/ROW]
[ROW][C]34[/C][C]21600.7[/C][C]21243[/C][C]20068.1[/C][C]1174.96[/C][C]357.682[/C][/ROW]
[ROW][C]35[/C][C]19939.5[/C][C]19928.5[/C][C]20059[/C][C]-130.486[/C][C]10.957[/C][/ROW]
[ROW][C]36[/C][C]18854.1[/C][C]18381[/C][C]20069.9[/C][C]-1688.92[/C][C]473.104[/C][/ROW]
[ROW][C]37[/C][C]19697.4[/C][C]19190.7[/C][C]20084.8[/C][C]-894.063[/C][C]506.676[/C][/ROW]
[ROW][C]38[/C][C]19865[/C][C]20017.5[/C][C]20061.9[/C][C]-44.3977[/C][C]-152.54[/C][/ROW]
[ROW][C]39[/C][C]20930.3[/C][C]21739[/C][C]20096.3[/C][C]1642.69[/C][C]-808.661[/C][/ROW]
[ROW][C]40[/C][C]20873.8[/C][C]20747.9[/C][C]20144.7[/C][C]603.183[/C][C]125.888[/C][/ROW]
[ROW][C]41[/C][C]20007.5[/C][C]20244.9[/C][C]20124.9[/C][C]119.943[/C][C]-237.389[/C][/ROW]
[ROW][C]42[/C][C]20584.9[/C][C]20876.5[/C][C]20058.3[/C][C]818.291[/C][C]-291.641[/C][/ROW]
[ROW][C]43[/C][C]20604.1[/C][C]20204.8[/C][C]19944.3[/C][C]260.484[/C][C]399.3[/C][/ROW]
[ROW][C]44[/C][C]16956.2[/C][C]17423.7[/C][C]19854.7[/C][C]-2431[/C][C]-467.51[/C][/ROW]
[ROW][C]45[/C][C]21731.2[/C][C]20419.9[/C][C]19850.6[/C][C]569.321[/C][C]1311.31[/C][/ROW]
[ROW][C]46[/C][C]21784.8[/C][C]21016.8[/C][C]19841.8[/C][C]1174.96[/C][C]768.007[/C][/ROW]
[ROW][C]47[/C][C]19280.6[/C][C]19658.8[/C][C]19789.3[/C][C]-130.486[/C][C]-378.21[/C][/ROW]
[ROW][C]48[/C][C]17912.3[/C][C]18119.6[/C][C]19808.5[/C][C]-1688.92[/C][C]-207.292[/C][/ROW]
[ROW][C]49[/C][C]17904.8[/C][C]18942.8[/C][C]19836.9[/C][C]-894.063[/C][C]-1038.01[/C][/ROW]
[ROW][C]50[/C][C]19507.1[/C][C]19753.6[/C][C]19798[/C][C]-44.3977[/C][C]-246.494[/C][/ROW]
[ROW][C]51[/C][C]21188.7[/C][C]21353.4[/C][C]19710.7[/C][C]1642.69[/C][C]-164.711[/C][/ROW]
[ROW][C]52[/C][C]20405.9[/C][C]20199.6[/C][C]19596.4[/C][C]603.183[/C][C]206.292[/C][/ROW]
[ROW][C]53[/C][C]19214.4[/C][C]19662.8[/C][C]19542.9[/C][C]119.943[/C][C]-448.397[/C][/ROW]
[ROW][C]54[/C][C]21839.1[/C][C]20379.1[/C][C]19560.8[/C][C]818.291[/C][C]1460[/C][/ROW]
[ROW][C]55[/C][C]20030.6[/C][C]NA[/C][C]NA[/C][C]260.484[/C][C]NA[/C][/ROW]
[ROW][C]56[/C][C]16596.6[/C][C]NA[/C][C]NA[/C][C]-2431[/C][C]NA[/C][/ROW]
[ROW][C]57[/C][C]19996.3[/C][C]NA[/C][C]NA[/C][C]569.321[/C][C]NA[/C][/ROW]
[ROW][C]58[/C][C]20776.6[/C][C]NA[/C][C]NA[/C][C]1174.96[/C][C]NA[/C][/ROW]
[ROW][C]59[/C][C]19003.1[/C][C]NA[/C][C]NA[/C][C]-130.486[/C][C]NA[/C][/ROW]
[ROW][C]60[/C][C]18620.8[/C][C]NA[/C][C]NA[/C][C]-1688.92[/C][C]NA[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
118347.7NANA-894.063NA
219372.7NANA-44.3977NA
322263.8NANA1642.69NA
419422.9NANA603.183NA
521268.6NANA119.943NA
620310NANA818.291NA
7192561987519614.5260.484-618.975
817535.917253.719684.7-2431282.203
919857.420303.919734.6569.321-446.479
1019628.420926.119751.21174.96-1297.74
1119727.519582.919713.4-130.486144.586
1218112.217970.219659.1-1688.92141.979
1318889.318770.419664.5-894.063118.859
1420516.119643.119687.5-44.3977872.977
152231721315.7196731642.691001.33
1619768.820298.219695603.183-529.395
1720015.819865.119745.2119.943150.67
1820260.520535.719717.4818.291-275.216
1919434.319963.219702.7260.484-528.934
20179101722619657-2431684.024
2119134.420127.819558.5569.321-993.404
2220880.120726.519551.61174.96153.59
231968019475.819606.3-130.486204.203
2417493.417919.719608.6-1688.92-426.254
2519155.918761.919656-894.063394.009
261915119643.419687.8-44.3977-492.407
2721318.221364.619721.91642.69-46.419
2820601.320422.519819.4603.183178.751
2920496.819980.119860.2119.943516.653
3019834.42074619927.7818.291-911.603
3120997.620267.520007260.484730.146
3217111.117628.320059.3-2431-517.18
3320752.320642.220072.9569.321110.108
3421600.72124320068.11174.96357.682
3519939.519928.520059-130.48610.957
3618854.11838120069.9-1688.92473.104
3719697.419190.720084.8-894.063506.676
381986520017.520061.9-44.3977-152.54
3920930.32173920096.31642.69-808.661
4020873.820747.920144.7603.183125.888
4120007.520244.920124.9119.943-237.389
4220584.920876.520058.3818.291-291.641
4320604.120204.819944.3260.484399.3
4416956.217423.719854.7-2431-467.51
4521731.220419.919850.6569.3211311.31
4621784.821016.819841.81174.96768.007
4719280.619658.819789.3-130.486-378.21
4817912.318119.619808.5-1688.92-207.292
4917904.818942.819836.9-894.063-1038.01
5019507.119753.619798-44.3977-246.494
5121188.721353.419710.71642.69-164.711
5220405.920199.619596.4603.183206.292
5319214.419662.819542.9119.943-448.397
5421839.120379.119560.8818.2911460
5520030.6NANA260.484NA
5616596.6NANA-2431NA
5719996.3NANA569.321NA
5820776.6NANA1174.96NA
5919003.1NANA-130.486NA
6018620.8NANA-1688.92NA



Parameters (Session):
par1 = additive ; par2 = 12 ;
Parameters (R input):
par1 = additive ; par2 = 12 ;
R code (references can be found in the software module):
par2 <- '12'
par1 <- 'additive'
par2 <- as.numeric(par2)
x <- ts(x,freq=par2)
m <- decompose(x,type=par1)
m$figure
bitmap(file='test1.png')
plot(m)
dev.off()
mylagmax <- length(x)/2
bitmap(file='test2.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(x),lag.max = mylagmax,main='Observed')
acf(as.numeric(m$trend),na.action=na.pass,lag.max = mylagmax,main='Trend')
acf(as.numeric(m$seasonal),na.action=na.pass,lag.max = mylagmax,main='Seasonal')
acf(as.numeric(m$random),na.action=na.pass,lag.max = mylagmax,main='Random')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
spectrum(as.numeric(x),main='Observed')
spectrum(as.numeric(m$trend[!is.na(m$trend)]),main='Trend')
spectrum(as.numeric(m$seasonal[!is.na(m$seasonal)]),main='Seasonal')
spectrum(as.numeric(m$random[!is.na(m$random)]),main='Random')
par(op)
dev.off()
bitmap(file='test4.png')
op <- par(mfrow = c(2,2))
cpgram(as.numeric(x),main='Observed')
cpgram(as.numeric(m$trend[!is.na(m$trend)]),main='Trend')
cpgram(as.numeric(m$seasonal[!is.na(m$seasonal)]),main='Seasonal')
cpgram(as.numeric(m$random[!is.na(m$random)]),main='Random')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Classical Decomposition by Moving Averages',6,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Observations',header=TRUE)
a<-table.element(a,'Fit',header=TRUE)
a<-table.element(a,'Trend',header=TRUE)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,'Random',header=TRUE)
a<-table.row.end(a)
for (i in 1:length(m$trend)) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
if (par1 == 'additive') a<-table.element(a,signif(m$trend[i]+m$seasonal[i],6)) else a<-table.element(a,signif(m$trend[i]*m$seasonal[i],6))
a<-table.element(a,signif(m$trend[i],6))
a<-table.element(a,signif(m$seasonal[i],6))
a<-table.element(a,signif(m$random[i],6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')