Home » date » 2010 » May » 24 »

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Mon, 24 May 2010 19:24:43 +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/May/24/t1274729150eelb9chi67tz5xf.htm/, Retrieved Mon, 24 May 2010 21:25:56 +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/May/24/t1274729150eelb9chi67tz5xf.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:
KDGP2W52
 
Dataseries X:
» Textbox « » Textfile « » CSV «
132.8 132.5 131.4 131.4 130.7 131.5 131.2 130.1 130.5 129 128.2 128.4 127.3 127.7 127 123.9 125.4 124.6 124.5 124.8 124.1 124.2 122.8 122.3 121.1 121.7 122.2 122.2 122.7 121.7 121 119.8 120.2 116.6 116 118 117.1 116.2 113.3 114.3 113.6 113 112.9 112.7 112.5 113 111.9 110.9 109.8 108.3 109.2 109.2 108.7 109.8 110.8 110 109.6 109.5 110.8 111.6 113.1 114.3 114.1 113.8 112.6 112.7 111.5 110.7 110.4 109.7 110 111.3 109 108.2 107.2 108.7 110.3 110.3 109.5 109.5 109.4 109.6 111.3 110 109.5 110.693 109.195 108.095 108.199 106.87 105.278 108.711 111.192 109.641 109.42 109.935 111.126 110.733 110.34 111.766 111.294 111.54 112.008 111.007 114.963 112.045 110.703 108.894 107.51 111.35 112.964 115.203 115.182 115.191 112.346 110.774 113.07 111.138 109.092 107.971 107.051
 
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'George Udny Yule' @ 72.249.76.132


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1132.8NANA-0.577568672839512NA
2132.5NANA0.00363503086419385NA
3131.4NANA-0.234753858024696NA
4131.4NANA0.113635030864193NA
5130.7NANA0.374903549382724NA
6131.5NANA0.305278549382719NA
7131.2130.253991512346130.4125-0.1585084876543220.946008487654296
8130.1129.988838734568129.9833333333330.005505401234566310.111161265432116
9130.5130.242422067901129.60.6424220679012370.257577932098769
10129129.042315586420129.104166666667-0.0618510802469051-0.0423155864197611
11128.2128.333533179012128.570833333333-0.237300154320984-0.133533179012346
12128.4127.887102623457128.0625-0.1753973765432140.512897376543208
13127.3126.918264660494127.495833333333-0.5775686728395120.381735339506179
14127.7126.999468364198126.9958333333330.003635030864193850.700531635802477
15127126.273579475309126.508333333333-0.2347538580246960.726420524691363
16123.9126.155301697531126.0416666666670.113635030864193-2.25530169753085
17125.4125.991570216049125.6166666666670.374903549382724-0.591570216049377
18124.6125.442778549383125.13750.305278549382719-0.842778549382714
19124.5124.466491512346124.625-0.1585084876543220.0335084876543306
20124.8124.122172067901124.1166666666670.005505401234566310.677827932098751
21124.1124.309088734568123.6666666666670.642422067901237-0.209088734567914
22124.2123.333982253086123.395833333333-0.06185108024690510.866017746913613
23122.8122.975199845679123.2125-0.237300154320984-0.175199845678989
24122.3122.803769290123122.979166666667-0.175397376543214-0.503769290123444
25121.1122.134931327160122.7125-0.577568672839512-1.03493132716049
26121.7122.361968364198122.3583333333330.00363503086419385-0.66196836419752
27122.2121.752746141975121.9875-0.2347538580246960.447253858024709
28122.2121.621968364198121.5083333333330.1136350308641930.578031635802489
29122.7121.283236882716120.9083333333330.3749035493827241.41676311728396
30121.7120.751111882716120.4458333333330.3052785493827190.948888117283957
31121119.941491512346120.1-0.1585084876543221.05850848765432
32119.8119.709672067901119.7041666666670.005505401234566310.0903279320987735
33120.2119.746588734568119.1041666666670.6424220679012370.453411265432109
34116.6118.342315586420118.404166666667-0.0618510802469051-1.74231558641974
35116117.458533179012117.695833333333-0.237300154320984-1.45853317901232
36118116.778769290123116.954166666667-0.1753973765432141.22123070987654
37117.1115.676597993827116.254166666667-0.5775686728395121.42340200617284
38116.2115.624468364198115.6208333333330.003635030864193850.575531635802477
39113.3114.769412808642115.004166666667-0.234753858024696-1.46941280864196
40114.3114.646968364198114.5333333333330.113635030864193-0.346968364197537
41113.6114.587403549383114.21250.374903549382724-0.987403549382705
42113114.051111882716113.7458333333330.305278549382719-1.05111188271604
43112.9112.987324845679113.145833333333-0.158508487654322-0.0873248456789923
44112.7112.518005401235112.51250.005505401234566310.181994598765442
45112.5112.654922067901112.01250.642422067901237-0.154922067901225
46113111.567315586420111.629166666667-0.06185108024690511.43268441358023
47111.9110.975199845679111.2125-0.2373001543209840.924800154320991
48110.9110.699602623457110.875-0.1753973765432140.200397376543222
49109.8110.076597993827110.654166666667-0.577568672839512-0.276597993827153
50108.3110.457801697531110.4541666666670.00363503086419385-2.15780169753087
51109.2109.986079475309110.220833333333-0.234753858024696-0.786079475308654
52109.2110.067801697531109.9541666666670.113635030864193-0.867801697530865
53108.7110.137403549383109.76250.374903549382724-1.43740354938271
54109.8110.051111882716109.7458333333330.305278549382719-0.25111188271606
55110.8109.753991512346109.9125-0.1585084876543221.04600848765433
56110110.305505401235110.30.00550540123456631-0.305505401234569
57109.6111.396588734568110.7541666666670.642422067901237-1.79658873456789
58109.5111.088148919753111.15-0.0618510802469051-1.58814891975308
59110.8111.266866512346111.504166666667-0.237300154320984-0.466866512345675
60111.6111.612102623457111.7875-0.175397376543214-0.0121026234567978
61113.1111.359931327160111.9375-0.5775686728395121.74006867283951
62114.3111.999468364198111.9958333333330.003635030864193852.30053163580249
63114.1111.823579475309112.058333333333-0.2347538580246962.27642052469137
64113.8112.213635030864112.10.1136350308641931.58636496913583
65112.6112.449903549383112.0750.3749035493827240.150096450617298
66112.7112.334445216049112.0291666666670.3052785493827190.3655547839506
67111.5111.687324845679111.845833333333-0.158508487654322-0.187324845679044
68110.7111.426338734568111.4208333333330.00550540123456631-0.726338734567904
69110.4111.521588734568110.8791666666670.642422067901237-1.12158873456788
70109.7110.317315586420110.379166666667-0.0618510802469051-0.617315586419735
71110109.833533179012110.070833333333-0.2373001543209840.166466820987665
72111.3109.699602623457109.875-0.1753973765432141.60039737654321
73109109.114097993827109.691666666667-0.577568672839512-0.114097993827144
74108.2109.561968364198109.5583333333330.00363503086419385-1.36196836419752
75107.2109.231912808642109.466666666667-0.234753858024696-2.03191280864196
76108.7109.534468364198109.4208333333330.113635030864193-0.834468364197534
77110.3109.845736882716109.4708333333330.3749035493827240.454263117283958
78110.3109.776111882716109.4708333333330.3052785493827190.523888117283946
79109.5109.278991512346109.4375-0.1585084876543220.221008487654316
80109.5109.567713734568109.5622083333330.00550540123456631-0.0677137345679029
81109.4110.391630401235109.7492083333330.642422067901237-0.99163040123456
82109.6109.745273919753109.807125-0.0618510802469051-0.145273919753080
83111.3109.457074845679109.694375-0.2373001543209841.84292515432098
84110109.288519290123109.463916666667-0.1753973765432140.71148070987654
85109.5108.567514660494109.145083333333-0.5775686728395120.932485339506187
86110.693108.939926697531108.9362916666670.003635030864193851.75307330246913
87109.195108.743329475309108.978083333333-0.2347538580246960.451670524691366
88108.095109.168093364198109.0544583333330.113635030864193-1.07309336419753
89108.199109.352736882716108.9778333333330.374903549382724-1.15373688271605
90106.87109.202070216049108.8967916666670.305278549382719-2.33207021604936
91105.278108.803324845679108.961833333333-0.158508487654322-3.52532484567901
92108.711109.036755401235109.031250.00550540123456631-0.325755401234559
93111.192109.723047067901109.0806250.6424220679012371.46895293209876
94109.641109.219440586420109.281291666667-0.06185108024690510.421559413580255
95109.42109.325908179012109.563208333333-0.2373001543209840.0940918209876713
96109.935109.711352623457109.88675-0.1753973765432140.223647376543227
97111.126109.784181327160110.36175-0.5775686728395121.34181867283952
98110.733110.741468364198110.7378333333330.00363503086419385-0.00846836419749764
99110.34110.755871141975110.990625-0.234753858024696-0.415871141975302
100111.766111.361551697531111.2479166666670.1136350308641930.404448302469149
101111.294111.776445216049111.4015416666670.374903549382724-0.482445216049399
102111.54111.716903549383111.4116250.305278549382719-0.176903549382700
103112.008111.059074845679111.217583333333-0.1585084876543220.94892515432096
104111.007111.098130401235111.0926250.00550540123456631-0.0911304012345653
105114.963111.870088734568111.2276666666670.6424220679012373.09291126543208
106112.045111.418357253086111.480208333333-0.06185108024690510.626642746913575
107110.703111.548116512346111.785416666667-0.237300154320984-0.845116512345683
108108.894111.924144290123112.099541666667-0.175397376543214-3.03014429012345
109107.51111.688181327160112.26575-0.577568672839512-4.17818132716047
110111.35112.273760030864112.2701250.00363503086419385-0.923760030864202
111112.964111.946787808642112.181541666667-0.2347538580246961.01721219135804
112115.203112.178510030864112.0648750.1136350308641933.02448996913581
113115.182112.334861882716111.9599583333330.3749035493827242.84713811728395
114115.191112.159653549383111.8543750.3052785493827193.03134645061728
115112.346111.638283179012111.796791666667-0.1585084876543220.707716820987642
116110.774NANA0.00550540123456631NA
117113.07NANA0.642422067901237NA
118111.138NANA-0.0618510802469051NA
119109.092NANA-0.237300154320984NA
120107.971NANA-0.175397376543214NA
121107.051NANANANA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/May/24/t1274729150eelb9chi67tz5xf/1pxtd1274729080.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/24/t1274729150eelb9chi67tz5xf/1pxtd1274729080.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/May/24/t1274729150eelb9chi67tz5xf/2pxtd1274729080.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/24/t1274729150eelb9chi67tz5xf/2pxtd1274729080.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/May/24/t1274729150eelb9chi67tz5xf/306ty1274729080.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/24/t1274729150eelb9chi67tz5xf/306ty1274729080.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/May/24/t1274729150eelb9chi67tz5xf/406ty1274729080.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/24/t1274729150eelb9chi67tz5xf/406ty1274729080.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