Home » date » 2011 » May » 20 »

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Fri, 20 May 2011 04:44:20 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu.htm/, Retrieved Fri, 20 May 2011 06:42:14 +0200
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
KDGP2W92
 
Dataseries X:
» Textbox « » Textfile « » CSV «
116 111 104 100 93 91 119 139 134 124 113 109 109 106 101 98 93 91 122 139 140 132 117 114 113 110 107 103 98 98 137 148 147 139 130 128 127 123 118 114 108 111 151 159 158 148 138 137 136 133 126 120 114 116 153 162 161 149 139 135 130 127 122 117 112 113 149 157 157 147 137 132 125 123 117 114 111 112 144 150 149 134 123 116 117 111 105 102 95 93 124 130 124 115 106 105 105 101 95 93 84 87 116 120 117 109 105 107 109 109 108 107 99 103 131 137 135 124 118 121 121 118 113 107 100 102 130 136 133 120 112 109 110
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ www.wessa.org


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1116NANA-2.22951388888888NA
2111NANA-5.36284722222222NA
3104NANA-10.2461805555556NA
4100NANA-13.9253472222222NA
593NANA-20.0045138888889NA
691NANA-18.8003472222222NA
7119126.753819444444112.45833333333314.2954861111111-7.75381944444443
8139132.937152777778111.95833333333320.97881944444446.06284722222223
9134133.153819444444111.62521.52881944444440.846180555555563
10124123.291319444444111.41666666666711.87465277777780.708680555555546
11113113.762152777778111.3333333333332.42881944444445-0.762152777777771
12109110.795486111111111.333333333333-0.537847222222224-1.7954861111111
13109109.228819444444111.458333333333-2.22951388888888-0.228819444444426
14106106.220486111111111.583333333333-5.36284722222222-0.220486111111114
15101101.587152777778111.833333333333-10.2461805555556-0.58715277777776
169898.4913194444444112.416666666667-13.9253472222222-0.491319444444429
179392.9121527777778112.916666666667-20.00451388888890.087847222222237
189194.4913194444444113.291666666667-18.8003472222222-3.49131944444444
19122127.962152777778113.66666666666714.2954861111111-5.96215277777777
20139134.97881944444411420.97881944444444.02118055555555
21140135.945486111111114.41666666666721.52881944444444.05451388888889
22132126.749652777778114.87511.87465277777785.25034722222223
23117117.720486111111115.2916666666672.42881944444445-0.7204861111111
24114115.253819444444115.791666666667-0.537847222222224-1.25381944444445
25113114.478819444444116.708333333333-2.22951388888888-1.47881944444444
26110112.345486111111117.708333333333-5.36284722222222-2.34548611111113
27107108.128819444444118.375-10.2461805555556-1.12881944444443
28103105.032986111111118.958333333333-13.9253472222222-2.03298611111111
299899.7871527777778119.791666666667-20.0045138888889-1.78715277777778
3098102.116319444444120.916666666667-18.8003472222222-4.11631944444444
31137136.378819444444122.08333333333314.29548611111110.621180555555554
32148144.187152777778123.20833333333320.97881944444443.81284722222223
33147145.737152777778124.20833333333321.52881944444441.26284722222222
34139136.999652777778125.12511.87465277777782.00034722222222
35130128.4288194444441262.428819444444451.57118055555557
36128126.420486111111126.958333333333-0.5378472222222241.5795138888889
37127125.853819444444128.083333333333-2.229513888888881.14618055555556
38123123.762152777778129.125-5.36284722222222-0.762152777777743
39118119.795486111111130.041666666667-10.2461805555556-1.7954861111111
40114116.949652777778130.875-13.9253472222222-2.94965277777774
41108111.578819444444131.583333333333-20.0045138888889-3.57881944444443
42111113.491319444444132.291666666667-18.8003472222222-2.49131944444443
43151147.337152777778133.04166666666714.29548611111113.66284722222224
44159154.812152777778133.83333333333320.97881944444444.18784722222222
45158156.112152777778134.58333333333321.52881944444441.88784722222223
46148147.041319444444135.16666666666711.87465277777780.95868055555556
47138138.095486111111135.6666666666672.42881944444445-0.0954861111110858
48137135.587152777778136.125-0.5378472222222241.41284722222221
49136134.187152777778136.416666666667-2.229513888888881.81284722222222
50133131.262152777778136.625-5.362847222222221.73784722222223
51126126.628819444444136.875-10.2461805555556-0.628819444444446
52120123.116319444444137.041666666667-13.9253472222222-3.11631944444443
53114117.120486111111137.125-20.0045138888889-3.12048611111112
54116118.282986111111137.083333333333-18.8003472222222-2.28298611111111
55153151.045486111111136.7514.29548611111111.9545138888889
56162157.228819444444136.2520.97881944444444.77118055555559
57161157.362152777778135.83333333333321.52881944444443.63784722222223
58149147.416319444444135.54166666666711.87465277777781.58368055555553
59139137.762152777778135.3333333333332.428819444444451.2378472222222
60135134.587152777778135.125-0.5378472222222240.412847222222211
61130132.603819444444134.833333333333-2.22951388888888-2.60381944444444
62127129.095486111111134.458333333333-5.36284722222222-2.09548611111109
63122123.837152777778134.083333333333-10.2461805555556-1.83715277777776
64117119.907986111111133.833333333333-13.9253472222222-2.90798611111109
65112113.662152777778133.666666666667-20.0045138888889-1.66215277777778
66113114.657986111111133.458333333333-18.8003472222222-1.65798611111109
67149147.420486111111133.12514.29548611111111.5795138888889
68157153.728819444444132.7520.97881944444443.27118055555556
69157153.903819444444132.37521.52881944444443.09618055555555
70147143.916319444444132.04166666666711.87465277777783.08368055555556
71137134.303819444444131.8752.428819444444452.69618055555554
72132131.253819444444131.791666666667-0.5378472222222240.746180555555554
73125129.312152777778131.541666666667-2.22951388888888-4.31215277777777
74123125.678819444444131.041666666667-5.36284722222222-2.67881944444443
75117120.170486111111130.416666666667-10.2461805555556-3.1704861111111
76114115.616319444444129.541666666667-13.9253472222222-1.61631944444446
77111108.412152777778128.416666666667-20.00451388888892.58784722222222
78112108.366319444444127.166666666667-18.80034722222223.63368055555556
79144140.462152777778126.16666666666714.29548611111113.53784722222224
80150146.312152777778125.33333333333320.97881944444443.68784722222223
81149145.862152777778124.33333333333321.52881944444443.13784722222222
82134135.207986111111123.33333333333311.8746527777778-1.20798611111111
83123124.595486111111122.1666666666672.42881944444445-1.5954861111111
84116120.170486111111120.708333333333-0.537847222222224-4.17048611111112
85117116.853819444444119.083333333333-2.229513888888880.146180555555546
86111112.053819444444117.416666666667-5.36284722222222-1.05381944444446
87105105.295486111111115.541666666667-10.2461805555556-0.295486111111117
8810299.7829861111111113.708333333333-13.92534722222222.21701388888891
899592.2038194444444112.208333333333-20.00451388888892.79618055555557
909392.2413194444444111.041666666667-18.80034722222220.758680555555571
91124124.378819444444110.08333333333314.2954861111111-0.378819444444431
92130130.145486111111109.16666666666720.9788194444444-0.145486111111097
93124129.862152777778108.33333333333321.5288194444444-5.86215277777777
94115119.416319444444107.54166666666711.8746527777778-4.41631944444443
95106109.137152777778106.7083333333332.42881944444445-3.13715277777774
96105105.462152777778106-0.537847222222224-0.462152777777746
97105103.187152777778105.416666666667-2.229513888888881.81284722222223
9810199.3038194444444104.666666666667-5.362847222222221.69618055555556
999593.7121527777778103.958333333333-10.24618055555561.28784722222223
1009389.4913194444444103.416666666667-13.92534722222223.50868055555557
1018483.1204861111111103.125-20.00451388888890.87951388888888
1028784.3663194444444103.166666666667-18.80034722222222.63368055555556
103116117.712152777778103.41666666666714.2954861111111-1.71215277777777
104120124.895486111111103.91666666666720.9788194444444-4.89548611111111
105117126.320486111111104.79166666666721.5288194444444-9.32048611111111
106109117.791319444444105.91666666666711.8746527777778-8.79131944444445
107105109.553819444444107.1252.42881944444445-4.55381944444444
108107107.878819444444108.416666666667-0.537847222222224-0.878819444444431
109109107.478819444444109.708333333333-2.229513888888881.52118055555557
110109105.678819444444111.041666666667-5.362847222222223.32118055555556
111108102.253819444444112.5-10.24618055555565.74618055555557
11210799.9496527777778113.875-13.92534722222227.05034722222223
1139995.0371527777778115.041666666667-20.00451388888893.96284722222224
11410397.3663194444444116.166666666667-18.80034722222225.63368055555559
115131131.545486111111117.2514.2954861111111-0.545486111111089
116137139.103819444444118.12520.9788194444444-2.10381944444444
117135140.237152777778118.70833333333321.5288194444444-5.23715277777778
118124130.791319444444118.91666666666711.8746527777778-6.79131944444444
119118121.387152777778118.9583333333332.42881944444445-3.38715277777776
120121118.420486111111118.958333333333-0.5378472222222242.5795138888889
121121116.645486111111118.875-2.229513888888884.35451388888892
122118113.428819444444118.791666666667-5.362847222222224.57118055555559
123113108.420486111111118.666666666667-10.24618055555564.57951388888893
124107104.491319444444118.416666666667-13.92534722222222.50868055555559
12510097.9954861111111118-20.00451388888892.00451388888891
12610298.4496527777778117.25-18.80034722222223.55034722222224
127130130.587152777778116.29166666666714.2954861111111-0.58715277777776
128136NANA20.9788194444444NA
129133NANA21.5288194444444NA
130120NANA11.8746527777778NA
131112NANA2.42881944444445NA
132109NANA-0.537847222222224NA
133110NANANANA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu/1zllg1305866656.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu/1zllg1305866656.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu/2z65d1305866656.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu/2z65d1305866656.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu/3b1f91305866656.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu/3b1f91305866656.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu/47lz81305866656.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/20/t1305866530zmj39ejoan930gu/47lz81305866656.ps (open in new window)


 
Parameters (Session):
par1 = additive ; par2 = 12 ;
 
Parameters (R input):
par1 = additive ; par2 = 12 ;
 
R code (references can be found in the software module):
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,m$trend[i]+m$seasonal[i]) else a<-table.element(a,m$trend[i]*m$seasonal[i])
a<-table.element(a,m$trend[i])
a<-table.element(a,m$seasonal[i])
a<-table.element(a,m$random[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by