Home » date » 2011 » May » 17 »

opgave 9 oef 2 - decomposition - Berns Sophie MAR 201B

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Tue, 17 May 2011 16:15:16 +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/17/t1305648717a1dpene6qr63t6s.htm/, Retrieved Tue, 17 May 2011 18:12:01 +0200
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
KDGP2W92
 
Dataseries X:
» Textbox « » Textfile « » CSV «
41 39 50 40 43 38 44 35 39 35 29 49 50 59 63 32 39 47 53 60 57 52 70 90 74 62 55 84 94 70 108 139 120 97 126 149 158 124 140 109 114 77 120 133 110 92 97 78 99 107 112 90 98 125 155 190 236 189 174 178 136 161 171 149 184 155 276 224 213 279 268 287 238 213 257 293 212 246 353 339 308 247 257 322 298 273 312 249 286 279 309 401 309 328 353 354 327 324 285 243 241 287 355 460 364 487 452 391 500 451 375 372 302 316 398 394 431 431
 
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'Herman Ole Andreas Wold' @ www.yougetit.org


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
141NANA1.02296647816775NA
239NANA0.96815467779339NA
350NANA0.991361873664322NA
440NANA0.834468517593995NA
543NANA0.856224954354863NA
638NANA0.816882096729209NA
74444.065649479853240.54166666666671.086922494878190.998510189214772
83549.929502098888941.751.195916217937460.700988364167542
93946.158410394367643.1251.070339951173740.844916444626069
103543.909529274722643.33333333333331.013296829416680.797093491506602
112945.019808283808142.83333333333331.051046107793180.644160895070497
124947.019568913068143.04166666666671.092419800497231.04211929485346
135044.79740702309643.79166666666671.022966478167751.11613602935147
145943.768659391909545.20833333333330.968154677793391.34799650753996
156346.5940080622231470.9913618736643221.35210518734228
163240.436953581742348.45833333333330.8344685175939950.791355361014345
173943.560444552803750.8750.8562249543548630.895307667320164
184744.3498905015954.29166666666670.8168820967292091.05975458943501
195361.9545822080567571.086922494878190.855465376588526
206069.512630167614858.1251.195916217937460.863152492652383
215761.990522172145857.91666666666671.070339951173740.919495400308337
225260.544485557646359.751.013296829416680.858872604516379
237067.485918837887464.20833333333331.051046107793181.03725341827459
249073.692819041875367.45833333333331.092419800497231.22128588877647
257472.332254727111270.70833333333331.022966478167751.02305673007403
266273.862133959987476.29166666666670.968154677793390.839401689011404
275581.498207364154582.20833333333330.9913618736643220.67486146970382
288472.355374379712686.70833333333330.8344685175939951.16093656787923
299477.84511876676390.91666666666670.8562249543548631.20752593726062
307078.182424007791495.70833333333330.8168820967292090.895341899261451
31108110.503786979282101.6666666666671.086922494878190.977342070821955
32139128.859972482761107.751.195916217937461.07869028156587
33120121.88496193991113.8751.070339951173740.984534909722178
3497120.03345358465118.4583333333331.013296829416680.80810804907478
35126126.47588163778120.3333333333331.051046107793180.996237372441153
36149132.683488268725121.4583333333331.092419800497231.12297318938607
37158125.057651956007122.251.022966478167751.26341729217482
38124118.59894802969122.50.968154677793391.04554047114278
39140120.780921608103121.8333333333330.9913618736643221.1591234620171
40109101.144538236705121.2083333333330.8344685175939951.07766570395438
41114102.56861432376119.7916666666670.8562249543548631.11145110764738
427794.4519924343147115.6250.8168820967292090.815228964635643
43120119.787916623034110.2083333333331.086922494878191.00177049057155
44133128.012865161722107.0416666666671.195916217937461.0389580752839
45110112.564084865105105.1666666666671.070339951173740.977221110373013
4692104.580676936046103.2083333333331.013296829416680.879703619209317
4797106.943941467957101.751.051046107793180.90701725285732
4878112.610274434589103.0833333333331.092419800497230.692654381597367
4999108.988553528122106.5416666666671.022966478167750.908352269988198
50107106.860072561445110.3750.968154677793391.00130944547576
51112116.980701092391180.9913618736643220.957422882185872
5290106.220888385402127.2916666666670.8344685175939950.847290974195698
5398115.197932400494134.5416666666670.8562249543548630.850709712907832
54125115.929184227487141.9166666666670.8168820967292091.07824445443102
55155160.456933306392147.6251.086922494878190.965991290036858
56190181.081647332697151.4166666666671.195916217937461.04925045027295
57236167.106824877156.1251.070339951173741.41227026588357
58189163.18301023731161.0416666666671.013296829416681.15820880939226
59174175.612287177111167.0833333333331.051046107793180.990819052567289
60178187.805170702148171.9166666666671.092419800497230.94779073086492
61136182.301151130144178.2083333333331.022966478167750.746018328227177
62161178.785897165846184.6666666666670.968154677793390.900518455606443
63171183.525866862108185.1250.9913618736643220.931748766120696
64149156.810542264538187.9166666666670.8344685175939950.950191217046097
65184167.463330655905195.5833333333330.8562249543548631.09874800220039
66155166.677984486789204.0416666666670.8168820967292090.929936850851982
67276231.333337659907212.8333333333331.086922494878191.19308355117306
68224262.204630782788219.251.195916217937460.854294599341241
69213240.8264890140912251.070339951173740.884454201329725
70279237.702547900662234.5833333333331.013296829416681.17373584113451
71268254.090396559002241.751.051046107793181.05474273577186
72287269.509068281003246.7083333333331.092419800497231.06489923263272
73238259.535120231809253.7083333333331.022966478167750.917024253933053
74213253.374147134179261.7083333333330.968154677793390.84065403834276
75257268.122080081463270.4583333333330.9913618736643220.958518596908976
76293227.879444346293273.0833333333330.8344685175939951.28576757258872
77212232.286694908522271.2916666666670.8562249543548630.91266527376219
78246222.430187588557272.2916666666670.8168820967292091.10596498913646
79353300.262339210099276.251.086922494878191.17563861298303
80339336.351436294911281.251.195916217937461.00787439392043
81308306.161823533655286.0416666666671.070339951173741.00600393754234
82247290.309541627877286.51.013296829416680.850815989770697
83257302.438517517489287.751.051046107793180.849759488670747
84322319.214169203627292.2083333333331.092419800497231.00872715269289
85298298.45047000544291.751.022966478167750.998490637305975
86273283.185243254567292.50.968154677793390.964033283876269
87312292.575672965183295.1250.9913618736643221.06639077965012
88249249.123622023374298.5416666666670.8344685175939950.999503772374656
89286261.933483953059305.9166666666670.8562249543548631.09188025785682
90279254.254552606966311.250.8168820967292091.09732548400534
91309341.067221205318313.7916666666671.086922494878190.905979762311976
92401379.254930613417317.1251.195916217937461.05733628657487
93309340.501896967146318.1251.070339951173740.907483931080168
94328320.961770717732316.751.013296829416681.0219285594871
95353330.685381664431314.6251.051046107793181.0674799055926
96354342.018432539006313.0833333333331.092419800497231.03503193489324
97327322.575429448897315.3333333333331.022966478167751.01371639048474
98324309.527118446195319.7083333333330.968154677793391.0467580405441
99285321.655621259336324.4583333333330.9913618736643220.886040787610602
100243278.190942052898333.3750.8344685175939950.873500762486341
101241294.648412417367344.1250.8562249543548630.817923972584061
102287285.738550085071349.7916666666670.8168820967292091.00441469978256
103355389.707002851117358.5416666666671.086922494878190.910940777052508
104460443.734746697212371.0416666666671.195916217937461.03665535192782
105364406.818376441952380.0833333333331.070339951173740.894748175300134
106487394.383570149215389.2083333333331.013296829416681.23483845895442
107452417.396685557368397.1251.051046107793181.0829027053639
108391437.923787524325400.8751.092419800497230.89284942069579
109500NA403.875NANA
110451NA402.916666666667NANA
111375NA402.958333333333NANA
112372NA403.416666666667NANA
113302NANANANA
114316NANANANA
115398NANANANA
116394NANANANA
117431NANANANA
118431NANANANA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/May/17/t1305648717a1dpene6qr63t6s/1bh6g1305648914.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/17/t1305648717a1dpene6qr63t6s/1bh6g1305648914.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/17/t1305648717a1dpene6qr63t6s/21vnh1305648914.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/17/t1305648717a1dpene6qr63t6s/21vnh1305648914.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/17/t1305648717a1dpene6qr63t6s/3xjp31305648914.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/17/t1305648717a1dpene6qr63t6s/3xjp31305648914.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/17/t1305648717a1dpene6qr63t6s/4byx91305648914.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/17/t1305648717a1dpene6qr63t6s/4byx91305648914.ps (open in new window)


 
Parameters (Session):
par1 = multiplicative ; par2 = 12 ;
 
Parameters (R input):
par1 = multiplicative ; 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