Home » date » 2009 » Jun » 03 »

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: Wed, 03 Jun 2009 05:56:33 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy.htm/, Retrieved Wed, 03 Jun 2009 13:57:51 +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/2009/Jun/03/t1244030266po5iiul0wri55sy.htm/},
    year = {2009},
}
@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 = {2009},
    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 «
41 39 50 40 43 38 44 35 39 35 29 49 50 59 63 32 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'Gwilym Jenkins' @ 72.249.127.135


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
141NANA0.940572165980726NA
239NANA0.978635082059458NA
350NANA0.912681720809828NA
440NANA0.837659062236775NA
543NANA0.814693087578113NA
638NANA1.08225431042776NA
74448.240899882177940.54166666666671.189909144061940.912089121626343
83544.409501831542641.751.063700642671680.788119626578218
93943.526414221373143.1251.009308155857930.8960076472564
103545.450204196209743.33333333333331.048850866066380.770073547940602
112947.02975654103443.16666666666671.089492429522020.616630876553595
124945.375696501141543.95833333333331.032243332727391.07987323123001
135042.560890510627845.250.9405721659807261.17478744923146
145945.832743009784646.83333333333330.9786350820594581.28728930728419
156344.074921434107948.29166666666670.9126817208098281.42938428362680
163242.127270338324550.29166666666670.8376590622367750.759602977904994
174744.231045546428454.29166666666670.8146930875781131.06260205743193
185362.635468216006757.8751.082254310427760.846165942549075
196070.70043497634759.41666666666671.189909144061940.848651072939977
205763.556113399632859.751.063700642671680.896845275002756
215261.021088922910560.45833333333331.009308155857930.852164406074316
227067.039051189409263.91666666666671.048850866066381.04416752263132
239073.495343474839967.45833333333331.089492429522021.22456737726262
247472.988205651599170.70833333333331.032243332727391.01386243625759
256271.757818162946276.29166666666670.9405721659807260.864017351519965
265580.45195903763882.20833333333330.9786350820594580.683637796492554
278479.137110875218986.70833333333330.9126817208098281.06144890900110
289476.157169741693590.91666666666670.8376590622367751.23428956615411
297077.972917590288695.70833333333330.8146930875781130.8977476047237
30108110.029188226823101.6666666666671.082254310427760.981557727912712
31139128.212710272674107.751.189909144061941.08413588406628
32120121.128910684237113.8751.063700642671680.990680088858553
3397119.560961962670118.4583333333331.009308155857930.811301602192576
34126126.211720883321120.3333333333331.048850866066380.998322494283107
35149132.327934669029121.4583333333331.089492429522021.12599052023800
36158126.191747425923122.251.032243332727391.2520628584904
37124115.220090332639122.50.9405721659807261.07620120451228
38140119.230374164244121.8333333333330.9786350820594581.17419743904473
39109110.624630243158121.2083333333330.9126817208098280.985314027811104
40114100.344575163780119.7916666666670.8376590622367751.13608533210621
417794.1988882512193115.6250.8146930875781130.817419413641576
42120119.273443795060110.2083333333331.082254310427761.00609151695317
43133127.369857962297107.0416666666671.189909144061941.04420309583268
44110111.865850920971105.1666666666671.063700642671680.983320638911604
4592104.169012585837103.2083333333331.009308155857930.883180110056151
4697106.720575622254101.751.048850866066380.908915637255738
4778112.308511276562103.0833333333331.089492429522020.694515483407339
4899109.976925074331106.5416666666671.032243332727390.900188834458578
49107103.815652820123110.3750.9405721659807261.03067309305847
50112115.4789396830161180.9786350820594580.969873816883273
5190116.176777378084127.2916666666670.9126817208098280.774681498584739
5298112.700046331773134.5416666666670.8376590622367750.869564859906997
53125115.618527345461141.9166666666670.8146930875781131.08114160307983
54155159.767792576898147.6251.082254310427760.97015798678821
55190180.172076230046151.4166666666671.189909144061941.05454743029883
56236166.070262837116156.1251.063700642671681.42108524409016
57189162.540667599620161.0416666666671.009308155857931.16278592177040
58174175.245498871924167.0833333333331.048850866066380.992892833881947
59178187.301906841995171.9166666666671.089492429522020.950337361755524
60136183.954363919793178.2083333333331.032243332727390.739313800999566
61161173.692326651107184.6666666666670.9405721659807260.926926382438286
62171181.169819566257185.1250.9786350820594580.943865818321147
63149171.508106702180187.9166666666670.9126817208098280.868763598788569
64184163.832151589143195.5833333333330.8376590622367751.12310067477740
65155166.231335411251204.0416666666670.8146930875781130.932435509926785
66276230.339792402709212.8333333333331.082254310427761.19822978531413
67224260.887579835581219.251.189909144061940.858607374644556
68213239.3326446011282251.063700642671680.889974705936945
69279236.766871561672234.5833333333331.009308155857931.17837431461490
70268253.559696871547241.751.048850866066381.05695030916435
71287268.786861466663246.7083333333331.089492429522021.06776052383645
72238261.888735540711253.7083333333331.032243332727390.90878288258031
73213246.155573938539261.7083333333330.9405721659807260.865306426305757
74257264.680013235331270.4583333333330.9786350820594580.970983780975927
75293249.238166591151273.0833333333330.9126817208098281.17558239176360
76212227.249923092652271.2916666666670.8376590622367750.932893605044547
77246221.834138638457272.2916666666670.8146930875781131.10893662044023
78353298.972753255669276.251.082254310427761.18070960030973
79339334.661946767421281.251.189909144061941.01296249326964
80308304.262704664211286.0416666666671.063700642671681.01228312007518
81247289.166786653296286.51.009308155857930.854178319919386
82257301.8068367106287.751.048850866066380.851538032739912
83322318.358767009915292.2083333333331.089492429522021.01143751442526
84298301.156992323216291.751.032243332727390.98951712095787
85273275.117358549362292.50.9405721659807260.992303798784174
86312288.819678592798295.1250.9786350820594581.08025880203227
87249272.473522066767298.5416666666670.9126817208098280.913850263729422
88286256.2538681226305.9166666666670.8376590622367751.11608071361158
89279253.573223508688311.250.8146930875781131.10027390171361
90309339.602383826312313.7916666666671.082254310427760.909887605965796
91401377.349937310643317.1251.189909144061941.06267408670559
92309338.389766949928318.1251.063700642671680.913148180529122
93328319.698358367998316.751.009308155857931.02596710747712
94353329.994703736134314.6251.048850866066381.06971413784344
95354341.101921476187313.0833333333331.089492429522021.03781297527728
96327325.500730920037315.3333333333331.032243332727391.00460603905781
97324300.708759565421319.7083333333330.9405721659807261.07745447943797
98285317.526307666542324.4583333333330.9786350820594580.897563424254282
99243304.265268674976333.3750.9126817208098280.79864521198303
100241288.25942479223344.1250.8376590622367750.836052455782518
101287284.972852925761349.7916666666670.8146930875781131.00711347433072
102355388.033264217954358.5416666666671.082254310427760.914870019495546
103460441.50587199465371.0416666666671.189909144061941.0418887475308
104364404.29488593546380.0833333333331.063700642671680.900332931884049
105487392.831145161204389.2083333333331.009308155857931.23971840318352
106452416.52490018661397.1251.048850866066381.08516921748855
107391436.750277684641400.8751.089492429522020.895248429085887
108500416.897276005274403.8751.032243332727391.19933621248625
109451NA402.916666666667NANA
110375NA402.958333333333NANA
111372NA403.416666666667NANA
112302NANANANA
113316NANANANA
114398NANANANA
115394NANANANA
116431NANANANA
117431NANANANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy/1u0hs1244030191.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy/1u0hs1244030191.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy/2s91s1244030191.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy/2s91s1244030191.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy/3nuw31244030191.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy/3nuw31244030191.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy/4ouoz1244030191.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244030266po5iiul0wri55sy/4ouoz1244030191.ps (open in new window)


 
Parameters (Session):
par1 = 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