Home » date » 2011 » May » 13 »

isabelle regnard, oef 9, Classical Deomposition

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Fri, 13 May 2011 09:47:54 +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/13/t1305279912byslay8g37mot4s.htm/, Retrieved Fri, 13 May 2011 11:45:15 +0200
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
KDGP2W92
 
Dataseries X:
» Textbox « » Textfile « » CSV «
106,42 106,22 106,32 105,81 105,92 107,54 107,34 107,24 107,74 105,71 105,41 106,22 106,32 106,12 106,22 105,92 105,71 105,71 105,92 105,71 105,41 104,49 101,35 99,72 99,01 97,89 95,86 94,95 95,35 95,15 95,46 95,56 95,05 94,64 93,63 93,12 93,53 97,18 96,27 95,15 97,08 101,95 103,07 103,68 102,87 102,56 103,38 103,27 102,89 102,69 101,54 102,9 101,53 101,96 101,99 101,11 101,75 101,71 104,11 103,57 103,32 103,64 103,68 103,79 103,01 101,54 101,9 103,68 104,62 104,11 105,04 104,83 105,05 104,68 107,32 109,9 109,77 110,69 110,54 110,89 110,95 109,73 110,85 110,39 110,58 110,4 111,07 110,86 111,38 111,44 110,36 110,06 108,34 107,94 107,39 107,1 107,61 107,74 106,9 106,71 106,6 108,21 110,54 110,91 109,51 110,27 111,39 112,13 111,64
 
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
1106.42NANA-0.474292534722225NA
2106.22NANA-0.256323784722219NA
3106.32NANA-0.469657118055554NA
4105.81NANA-0.337625868055552NA
5105.92NANA-0.361271701388894NA
6107.54NANA0.354301215277776NA
7107.34107.173728298611106.4866666666670.6870616319444450.166271701388908
8107.24107.272061631944106.4783333333330.793728298611123-0.032061631944444
9107.74107.027790798611106.470.5577907986111120.712209201388887
10105.71106.607842881944106.4704166666670.137426215277778-0.897842881944442
11105.41106.412374131944106.46625-0.0538758680555628-1.00237413194442
12106.22105.803988715278106.38125-0.5772612847222280.416011284722217
13106.32105.771540798611106.245833333333-0.4742925347222250.54845920138888
14106.12105.866592881944106.122916666667-0.2563237847222190.253407118055577
15106.22105.492426215278105.962083333333-0.4696571180555540.727573784722225
16105.92105.476540798611105.814166666667-0.3376258680555520.44345920138889
17105.71105.232894965278105.594166666667-0.3612717013888940.4771050347222
18105.71105.508467881944105.1541666666670.3543012152777760.201532118055553
19105.92105.265811631944104.578750.6870616319444450.654188368055543
20105.71104.724978298611103.931250.7937282986111230.985021701388874
21105.41103.714457465278103.1566666666670.5577907986111121.69554253472222
22104.49102.405342881944102.2679166666670.1374262152777782.08465711805555
23101.35101.325290798611101.379166666667-0.05387586805556280.0247092013888732
2499.7299.9302387152778100.5075-0.577261284722228-0.210238715277782
2599.0199.157374131944499.6316666666666-0.474292534722225-0.147374131944417
2697.8998.516592881944498.7729166666667-0.256323784722219-0.626592881944447
2795.8697.448676215277897.9183333333333-0.469657118055554-1.58867621527777
2894.9596.738624131944497.07625-0.337625868055552-1.78862413194445
2995.3595.982894965277896.3441666666667-0.361271701388894-0.632894965277785
3095.1596.101801215277895.74750.354301215277776-0.951801215277754
3195.4695.931228298611195.24416666666670.687061631944445-0.471228298611109
3295.5695.779978298611194.986250.793728298611123-0.21997829861111
3395.0595.531540798611194.973750.557790798611112-0.481540798611107
3494.6495.136592881944494.99916666666670.137426215277778-0.496592881944437
3593.6395.025707465277895.0795833333333-0.0538758680555628-1.39570746527779
3693.1294.857738715277895.435-0.577261284722228-1.73773871527779
3793.5395.561124131944596.0354166666667-0.474292534722225-2.03112413194445
3897.1896.434509548611196.6908333333333-0.2563237847222190.745490451388875
3996.2796.885342881944597.355-0.469657118055554-0.615342881944457
4095.1597.673207465277898.0108333333333-0.337625868055552-2.52320746527776
4197.0898.385811631944598.7470833333334-0.361271701388894-1.30581163194447
42101.9599.930551215277899.576250.3543012152777762.01944878472224
43103.07101.076228298611100.3891666666670.6870616319444451.99377170138889
44103.68101.802478298611101.008750.7937282986111231.87752170138889
45102.87102.015707465278101.4579166666670.5577907986111120.854292534722205
46102.56102.137842881944102.0004166666670.1374262152777780.422157118055537
47103.38102.454874131944102.50875-0.05387586805556280.925125868055545
48103.27102.117322048611102.694583333333-0.5772612847222281.15267795138888
49102.89102.175707465278102.65-0.4742925347222250.714292534722219
50102.69102.241592881944102.497916666667-0.2563237847222190.448407118055542
51101.54101.874509548611102.344166666667-0.469657118055554-0.334509548611109
52102.9101.924457465278102.262083333333-0.3376258680555520.975542534722237
53101.53101.895811631944102.257083333333-0.361271701388894-0.365811631944439
54101.96102.654301215278102.30.354301215277776-0.69430121527779
55101.99103.017478298611102.3304166666670.687061631944445-1.0274782986111
56101.11103.181644965278102.3879166666670.793728298611123-2.07164496527778
57101.75103.074457465278102.5166666666670.557790798611112-1.32445746527779
58101.71102.780342881944102.6429166666670.137426215277778-1.07034288194444
59104.11102.687790798611102.741666666667-0.05387586805556281.4222092013889
60103.57102.208572048611102.785833333333-0.5772612847222281.3614279513889
61103.32102.290290798611102.764583333333-0.4742925347222251.0297092013889
62103.64102.611592881944102.867916666667-0.2563237847222191.02840711805555
63103.68102.624926215278103.094583333333-0.4696571180555541.05507378472224
64103.79102.976540798611103.314166666667-0.3376258680555520.813459201388895
65103.01103.091644965278103.452916666667-0.361271701388894-0.0816449652777749
66101.54103.898467881944103.5441666666670.354301215277776-2.35846788194443
67101.9104.355811631944103.668750.687061631944445-2.45581163194446
68103.68104.577894965278103.7841666666670.793728298611123-0.897894965277771
69104.62104.536957465278103.9791666666670.5577907986111120.0830425347222388
70104.11104.522842881944104.3854166666670.137426215277778-0.412842881944442
71105.04104.867790798611104.921666666667-0.05387586805556280.172209201388895
72104.83105.007322048611105.584583333333-0.577261284722228-0.177322048611103
73105.05105.851540798611106.325833333333-0.474292534722225-0.8015407986111
74104.68106.729926215278106.98625-0.256323784722219-2.04992621527776
75107.32107.080759548611107.550416666667-0.4696571180555540.239240451388895
76109.9107.710707465278108.048333333333-0.3376258680555522.18929253472224
77109.77108.163311631944108.524583333333-0.3612717013888941.60668836805556
78110.69109.352634548611108.9983333333330.3543012152777761.33736545138892
79110.54110.147478298611109.4604166666670.6870616319444450.392521701388915
80110.89110.722894965278109.9291666666670.7937282986111230.167105034722226
81110.95110.881540798611110.323750.5577907986111120.0684592013889187
82109.73110.657426215278110.520.137426215277778-0.927426215277762
83110.85110.573207465278110.627083333333-0.05387586805556280.276792534722233
84110.39110.148155381944110.725416666667-0.5772612847222280.241844618055552
85110.58110.274874131944110.749166666667-0.4742925347222250.305125868055555
86110.4110.450759548611110.707083333333-0.256323784722219-0.0507595486111114
87111.07110.094092881944110.56375-0.4696571180555540.975907118055545
88110.86110.042790798611110.380416666667-0.3376258680555520.817209201388891
89111.38109.800394965278110.161666666667-0.3612717013888941.57960503472222
90111.44110.234717881944109.8804166666670.3543012152777761.20528211805556
91110.36110.306644965278109.6195833333330.6870616319444450.0533550347222302
92110.06110.178728298611109.3850.793728298611123-0.118728298611103
93108.34109.658207465278109.1004166666670.557790798611112-1.31820746527775
94107.94108.891176215278108.753750.137426215277778-0.951176215277783
95107.39108.327790798611108.381666666667-0.0538758680555628-0.937790798611118
96107.1107.470655381944108.047916666667-0.577261284722228-0.370655381944445
97107.61107.446540798611107.920833333333-0.4742925347222250.163459201388889
98107.74107.707426215278107.96375-0.2563237847222190.032573784722203
99106.9107.578259548611108.047916666667-0.469657118055554-0.678259548611109
100106.71107.856124131944108.19375-0.337625868055552-1.14612413194445
101106.6108.096228298611108.4575-0.361271701388894-1.49622829861109
102108.21109.188051215278108.833750.354301215277776-0.978051215277787
103110.54109.898311631944109.211250.6870616319444450.641688368055569
104110.91NANA0.793728298611123NA
105109.51NANA0.557790798611112NA
106110.27NANA0.137426215277778NA
107111.39NANA-0.0538758680555628NA
108112.13NANA-0.577261284722228NA
109111.64NANANANA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/May/13/t1305279912byslay8g37mot4s/15twm1305280070.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/13/t1305279912byslay8g37mot4s/15twm1305280070.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/13/t1305279912byslay8g37mot4s/259wz1305280070.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/13/t1305279912byslay8g37mot4s/259wz1305280070.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/13/t1305279912byslay8g37mot4s/362oi1305280070.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/13/t1305279912byslay8g37mot4s/362oi1305280070.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/13/t1305279912byslay8g37mot4s/4xwwq1305280070.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/13/t1305279912byslay8g37mot4s/4xwwq1305280070.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