Home » date » 2010 » Jan » 10 »

opgave 9 oefening 2

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Sun, 10 Jan 2010 09:24:10 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas.htm/, Retrieved Sun, 10 Jan 2010 17:25:11 +0100
 
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/Jan/10/t126314070544pfju2x6nezdas.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 «
102,5 77,7 82,8 77,3 103,1 99,7 99,5 107,2 96,7 97,1 105,2 151,2 102,7 75,4 87,2 83,7 105,8 111,5 99,7 111,2 101,5 110,9 116,3 164,9 118,1 83,7 84 107,2 113,7 120,7 111,2 112,4 112,5 130,4 130,7 174,3 132,2 91,8 104,2 104,8 131,4 141,2 132,7 135,7 136,9 151,2 144 201,5 149,6 108,7 122,8 126,7 139,9 162,5 142,7 151,6 148,1 159 157,8 226,7 153,7 122,3 117,6 166 154,5 183,9 164,4 173,3 160,2 166,4 170,3 238,4 166,8 122,5 141,8 140,5 173,8 188,8 168 187,4 177,7 183,8 196,1 264,6 193,7 141,3 170,1 163,7 190,1 230,7 195,9 210,3 204,7 210,3 221,2 288,2 203,2 162,4 149,2 195,3 213,7 227,9 212,1 226,8 212,6 220,9 228,1 311,6
 
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'Gwilym Jenkins' @ 72.249.127.135


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1102.5NANA2.22430555555556NA
277.7NANA-37.9725694444445NA
382.8NANA-30.5991319444445NA
477.3NANA-17.9725694444444NA
5103.1NANA-2.38246527777777NA
699.7NANA14.1795138888889NA
799.595.3967013888889100.008333333333-4.611631944444454.10329861111111
8107.2103.71857638888999.92083333333333.797743055555563.4814236111111
996.796.6690972222222100.008333333333-3.339236111111120.0309027777777686
1097.1105.008680555556100.4583333333334.55034722222223-7.90868055555558
11105.2108.259722222222100.83757.42222222222223-3.05972222222223
12151.2166.145138888889101.44166666666764.7034722222222-14.9451388888889
13102.7104.165972222222101.9416666666672.22430555555556-1.46597222222222
1475.464.1440972222222102.116666666667-37.972569444444511.2559027777778
1587.271.8842013888889102.483333333333-30.599131944444515.3157986111111
1683.785.2857638888889103.258333333333-17.9725694444444-1.58576388888889
17105.8101.913368055556104.295833333333-2.382465277777773.88663194444445
18111.5119.508680555556105.32916666666714.1795138888889-8.00868055555556
1999.7101.930034722222106.541666666667-4.61163194444445-2.23003472222221
20111.2111.326909722222107.5291666666673.79774305555556-0.126909722222223
21101.5104.402430555556107.741666666667-3.33923611111112-2.90243055555555
22110.9113.137847222222108.58754.55034722222223-2.23784722222223
23116.3117.318055555556109.8958333333337.42222222222223-1.01805555555556
24164.9175.311805555556110.60833333333364.7034722222222-10.4118055555555
25118.1113.695138888889111.4708333333332.224305555555564.4048611111111
2683.774.0274305555556112-37.97256944444459.67256944444446
278481.9092013888889112.508333333333-30.59913194444452.09079861111111
28107.295.8065972222222113.779166666667-17.972569444444411.3934027777778
29113.7112.809201388889115.191666666667-2.382465277777770.890798611111109
30120.7130.362847222222116.18333333333314.1795138888889-9.6628472222222
31111.2112.550868055556117.1625-4.61163194444445-1.35086805555555
32112.4121.885243055556118.08753.79774305555556-9.48524305555556
33112.5115.927430555556119.266666666667-3.33923611111112-3.42743055555555
34130.4124.558680555556120.0083333333334.550347222222235.84131944444444
35130.7128.068055555556120.6458333333337.422222222222232.63194444444441
36174.3186.940972222222122.237564.7034722222222-12.6409722222222
37132.2126.211805555556123.98752.224305555555565.98819444444445
3891.887.8815972222222125.854166666667-37.97256944444453.91840277777777
39104.297.2425347222222127.841666666667-30.59913194444456.9574652777778
40104.8111.752430555556129.725-17.9725694444444-6.95243055555555
41131.4128.763368055556131.145833333333-2.382465277777772.63663194444445
42141.2147.012847222222132.83333333333314.1795138888889-5.81284722222225
43132.7130.080034722222134.691666666667-4.611631944444452.61996527777777
44135.7139.918576388889136.1208333333333.79774305555556-4.21857638888889
45136.9134.260763888889137.6-3.339236111111122.63923611111113
46151.2143.837847222222139.28754.550347222222237.36215277777777
47144147.976388888889140.5541666666677.42222222222223-3.97638888888886
48201.5206.499305555556141.79583333333364.7034722222222-4.99930555555554
49149.6145.324305555556143.12.224305555555564.27569444444444
50108.7106.206597222222144.179166666667-37.97256944444452.49340277777779
51122.8114.709201388889145.308333333333-30.59913194444458.0907986111111
52126.7128.127430555556146.1-17.9725694444444-1.42743055555559
53139.9144.617534722222147-2.38246527777777-4.71753472222221
54162.5162.804513888889148.62514.1795138888889-0.30451388888892
55142.7145.234201388889149.845833333333-4.61163194444445-2.53420138888887
56151.6154.381076388889150.5833333333333.79774305555556-2.78107638888889
57148.1147.594097222222150.933333333333-3.339236111111120.505902777777777
58159156.904513888889152.3541666666674.550347222222232.09548611111111
59157.8162.022222222222154.67.42222222222223-4.22222222222223
60226.7220.803472222222156.164.70347222222225.89652777777778
61153.7160.120138888889157.8958333333332.22430555555556-6.42013888888889
62122.3121.731597222222159.704166666667-37.97256944444450.568402777777777
63117.6130.513368055556161.1125-30.5991319444445-12.9133680555555
64166143.952430555556161.925-17.972569444444422.0475694444445
65154.5160.371701388889162.754166666667-2.38246527777777-5.87170138888888
66183.9177.942013888889163.762514.17951388888895.95798611111113
67164.4160.184201388889164.795833333333-4.611631944444454.2157986111111
68173.3169.147743055556165.353.797743055555564.15225694444442
69160.2163.027430555556166.366666666667-3.33923611111112-2.82743055555557
70166.4170.862847222222166.31254.55034722222223-4.46284722222219
71170.3173.476388888889166.0541666666677.42222222222223-3.17638888888882
72238.4231.765972222222167.062564.70347222222226.63402777777782
73166.8169.640972222222167.4166666666672.22430555555556-2.84097222222221
74122.5130.181597222222168.154166666667-37.9725694444445-7.68159722222222
75141.8138.871701388889169.470833333333-30.59913194444452.92829861111113
76140.5152.952430555556170.925-17.9725694444444-12.4524305555555
77173.8170.342534722222172.725-2.382465277777773.4574652777778
78188.8189.071180555556174.89166666666714.1795138888889-0.27118055555556
79168172.492534722222177.104166666667-4.61163194444445-4.49253472222225
80187.4182.806076388889179.0083333333333.797743055555564.59392361111111
81177.7177.631597222222180.970833333333-3.339236111111120.0684027777777487
82183.8187.667013888889183.1166666666674.55034722222223-3.86701388888886
83196.1192.184722222222184.76257.422222222222233.91527777777776
84264.6251.890972222222187.187564.703472222222212.7090277777778
85193.7192.320138888889190.0958333333332.224305555555561.37986111111110
86141.3154.239930555556192.2125-37.9725694444445-12.9399305555555
87170.1163.692534722222194.291666666667-30.59913194444456.40746527777776
88163.7178.548263888889196.520833333333-17.9725694444444-14.8482638888889
89190.1196.288368055556198.670833333333-2.38246527777777-6.18836805555554
90230.7214.879513888889200.714.179513888888915.8204861111111
91195.9197.467534722222202.079166666667-4.61163194444445-1.56753472222223
92210.3207.151909722222203.3541666666673.797743055555563.14809027777781
93204.7200.023263888889203.3625-3.339236111111124.67673611111113
94210.3208.358680555556203.8083333333334.550347222222231.94131944444447
95221.2213.530555555556206.1083333333337.422222222222237.66944444444448
96288.2271.678472222222206.97564.703472222222216.5215277777778
97203.2209.757638888889207.5333333333332.22430555555556-6.5576388888889
98162.4170.923263888889208.895833333333-37.9725694444445-8.52326388888889
99149.2179.313368055556209.9125-30.5991319444445-30.1133680555556
100195.3192.710763888889210.683333333333-17.97256944444442.58923611111112
101213.7209.030034722222211.4125-2.382465277777774.66996527777778
102227.9226.854513888889212.67514.17951388888891.04548611111113
103212.1NANA-4.61163194444445NA
104226.8NANA3.79774305555556NA
105212.6NANA-3.33923611111112NA
106220.9NANA4.55034722222223NA
107228.1NANA7.42222222222223NA
108311.6NANA64.7034722222222NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas/1z2b81263140647.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas/1z2b81263140647.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas/2zk961263140647.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas/2zk961263140647.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas/3uy531263140647.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas/3uy531263140647.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas/4pbdv1263140647.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/10/t126314070544pfju2x6nezdas/4pbdv1263140647.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