Home » date » 2010 » Aug » 05 »

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Thu, 05 Aug 2010 13:53:53 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4.htm/, Retrieved Thu, 05 Aug 2010 15:58:13 +0200
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
390 389 388 386 406 405 390 380 381 381 382 384 394 393 388 381 399 396 378 368 369 373 374 379 385 385 395 387 400 390 365 350 365 374 367 375 382 380 378 363 375 366 341 326 338 345 336 342 347 360 360 334 347 336 305 289 303 308 294 299 306 313 321 287 296 283 248 235 241 244 237 241 251 259 264 229 237 228 197 182 182 176 172 175 185 195 206 175 185 174 140 130 133 130 131 136 149 155 161 131 145 134 93 87 86 80 79 91 108 105 112 78 87 74 32 25 26 25 22 36
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1390NANA8.64351851851852NA
2389NANA16.1666666666667NA
3388NANA23.8981481481482NA
4386NANA2.74537037037038NA
5406NANA17.837962962963NA
6405NANA11.1157407407407NA
7390374.736111111111388.666666666667-13.930555555555615.2638888888889
8380365.467592592593389-23.532407407407414.5324074074074
9381373.893518518519389.166666666667-15.27314814814827.10648148148147
10381377.833333333333388.958333333333-11.1253.16666666666669
11382375.902777777778388.458333333333-12.55555555555566.09722222222223
12384383.800925925926387.791666666667-3.990740740740750.199074074074076
13394395.560185185185386.9166666666678.64351851851852-1.56018518518516
14393402.083333333333385.91666666666716.1666666666667-9.08333333333326
15388408.814814814815384.91666666666723.8981481481482-20.8148148148148
16381386.828703703704384.0833333333332.74537037037038-5.82870370370364
17399401.25462962963383.41666666666717.837962962963-2.25462962962962
18396393.990740740741382.87511.11574074074072.0092592592593
19378368.361111111111382.291666666667-13.93055555555569.63888888888891
20368358.050925925926381.583333333333-23.53240740740749.94907407407408
21369366.268518518519381.541666666667-15.27314814814822.73148148148147
22373370.958333333333382.083333333333-11.1252.04166666666669
23374369.819444444444382.375-12.55555555555564.18055555555554
24379378.175925925926382.166666666667-3.990740740740750.824074074074133
25385390.018518518518381.3758.64351851851852-5.01851851851848
26385396.25380.08333333333316.1666666666667-11.2499999999999
27395403.064814814815379.16666666666723.8981481481482-8.06481481481478
28387381.787037037037379.0416666666672.745370370370385.21296296296299
29400396.62962962963378.79166666666717.8379629629633.37037037037044
30390389.449074074074378.33333333333311.11574074074070.550925925925924
31365364.111111111111378.041666666667-13.93055555555560.888888888888914
32350354.175925925926377.708333333333-23.5324074074074-4.17592592592592
33365361.518518518518376.791666666667-15.27314814814823.48148148148152
34374363.958333333333375.083333333333-11.12510.0416666666667
35367360.486111111111373.041666666667-12.55555555555566.51388888888886
36375367.009259259259371-3.990740740740757.9907407407407
37382377.6435185185193698.643518518518524.35648148148147
38380383.16666666666736716.1666666666667-3.16666666666669
39378388.773148148148364.87523.8981481481482-10.7731481481481
40363365.287037037037362.5416666666672.74537037037038-2.28703703703701
41375377.87962962963360.04166666666717.837962962963-2.87962962962962
42366368.490740740741357.37511.1157407407407-2.49074074074076
43341340.611111111111354.541666666667-13.93055555555560.388888888888857
44326328.717592592593352.25-23.5324074074074-2.71759259259255
45338335.393518518518350.666666666667-15.27314814814822.60648148148152
46345337.583333333333348.708333333333-11.1257.41666666666669
47336333.777777777778346.333333333333-12.55555555555562.22222222222229
48342339.925925925926343.916666666667-3.990740740740752.07407407407408
49347349.810185185185341.1666666666678.64351851851852-2.81018518518522
50360354.291666666667338.12516.16666666666675.70833333333331
51360359.023148148148335.12523.89814814814820.976851851851904
52334334.87037037037332.1252.74537037037038-0.870370370370381
53347346.671296296296328.83333333333317.8379629629630.328703703703695
54336336.407407407407325.29166666666711.1157407407407-0.407407407407447
55305307.861111111111321.791666666667-13.9305555555556-2.86111111111109
56289294.592592592593318.125-23.5324074074074-5.59259259259261
57303299.268518518518314.541666666667-15.27314814814823.73148148148152
58308299.833333333333310.958333333333-11.1258.16666666666663
59294294.319444444444306.875-12.5555555555556-0.3194444444444
60299298.550925925926302.541666666667-3.990740740740750.449074074074133
61306306.601851851852297.9583333333338.64351851851852-0.601851851851791
62313309.5293.33333333333316.16666666666673.5
63321312.398148148148288.523.89814814814828.60185185185185
64287285.99537037037283.252.745370370370381.00462962962968
65296296.046296296296278.20833333333317.837962962963-0.0462962962963047
66283284.532407407407273.41666666666711.1157407407407-1.53240740740739
67248254.777777777778268.708333333333-13.9305555555556-6.77777777777777
68235240.634259259259264.166666666667-23.5324074074074-5.63425925925924
69241244.268518518518259.541666666667-15.2731481481482-3.26851851851848
70244243.625254.75-11.1250.375
71237237.319444444444249.875-12.5555555555556-0.3194444444444
72241241.134259259259245.125-3.99074074074075-0.134259259259238
73251249.351851851852240.7083333333338.643518518518521.64814814814812
74259252.541666666667236.37516.16666666666676.45833333333331
75264255.606481481481231.70833333333323.89814814814828.39351851851853
76229229.162037037037226.4166666666672.74537037037038-0.162037037037038
77237238.712962962963220.87517.837962962963-1.71296296296296
78228226.532407407407215.41666666666711.11574074074071.46759259259261
79197195.986111111111209.916666666667-13.93055555555561.01388888888889
80182180.967592592593204.5-23.53240740740741.03240740740739
81182184.143518518519199.416666666667-15.2731481481482-2.14351851851853
82176183.625194.75-11.125-7.62499999999997
83172177.777777777778190.333333333333-12.5555555555556-5.77777777777771
84175181.925925925926185.916666666667-3.99074074074075-6.92592592592587
85185189.935185185185181.2916666666678.64351851851852-4.93518518518516
86195192.916666666667176.7516.16666666666672.08333333333331
87206196.439814814815172.54166666666723.89814814814829.5601851851852
88175171.328703703704168.5833333333332.745370370370383.67129629629628
89185182.796296296296164.95833333333317.8379629629632.20370370370372
90174172.740740740741161.62511.11574074074071.2592592592593
91140144.569444444444158.5-13.9305555555556-4.56944444444443
92130131.800925925926155.333333333333-23.5324074074074-1.80092592592592
93133136.518518518519151.791666666667-15.2731481481482-3.51851851851853
94130136.958333333333148.083333333333-11.125-6.95833333333331
95131132.027777777778144.583333333333-12.5555555555556-1.02777777777774
96136137.259259259259141.25-3.99074074074075-1.25925925925921
97149146.268518518519137.6258.643518518518522.7314814814815
98155150.041666666667133.87516.16666666666674.95833333333331
99161154.023148148148130.12523.89814814814826.97685185185185
100131128.828703703704126.0833333333332.745370370370382.17129629629628
101145139.671296296296121.83333333333317.8379629629635.32870370370368
102134128.907407407407117.79166666666711.11574074074075.09259259259258
10393100.277777777778114.208333333333-13.9305555555556-7.27777777777777
1048786.8842592592593110.416666666667-23.53240740740740.115740740740733
1058691.0185185185185106.291666666667-15.2731481481482-5.0185185185185
1068090.9166666666667102.041666666667-11.125-10.9166666666667
1077984.861111111111197.4166666666667-12.5555555555556-5.86111111111109
1089188.509259259259392.5-3.990740740740752.49074074074075
10910896.101851851851987.45833333333338.6435185185185211.8981481481481
11010598.582.333333333333316.16666666666676.49999999999999
111112101.14814814814877.2523.898148148148210.8518518518518
1127875.203703703703772.45833333333332.745370370370382.79629629629629
1138785.629629629629667.791666666666717.8379629629631.37037037037035
1147474.240740740740763.12511.1157407407407-0.240740740740733
11532NANA-13.9305555555556NA
11625NANA-23.5324074074074NA
11726NANA-15.2731481481482NA
11825NANA-11.125NA
11922NANA-12.5555555555556NA
12036NANA-3.99074074074075NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4/1t45m1281016428.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4/1t45m1281016428.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4/2t45m1281016428.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4/2t45m1281016428.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4/33v5p1281016428.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4/33v5p1281016428.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4/43v5p1281016428.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/05/t1281016691xln57cgv7y8nix4/43v5p1281016428.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