Home » date » 2008 » Aug » 17 »

Opgave 9

R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Sun, 17 Aug 2008 10:55:27 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj.htm/, Retrieved Sun, 17 Aug 2008 16:58:07 +0000
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
Alain Piscaer 2mar04
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2005/12 2005/11 2005/10 2005/09 2005/08 2005/07 2005/06 2005/05 2005/04 2005/03 2005/02 2005/01 2004/12 2004/11 2004/10 2004/09 2004/08 2004/07 2004/06 2004/05 2004/04 2004/03 2004/02 2004/01 2003/12 2003/11 2003/10 2003/09 2003/08 2003/07 2003/06 2003/05 2003/04 2003/03 2003/02 2003/01 2002/12 2002/11 2002/10 2002/09 2002/08 2002/07 2002/06 2002/05 2002/04 2002/03 2002/02 2002/01 2001/12 2001/11 2001/10 2001/09 2001/08 2001/07 2001/06 2001/05 2001/04 2001/03 2001/02 2001/01 2000/12 2000/11 2000/10 2000/09 2000/08 2000/07 2000/06 2000/05 2000/04 2000/03 2000/02 2000/01 1999/12 1999/11 1999/10 1999/09 1999/08 1999/07 1999/06 1999/05 1999/04 1999/03 1999/02 1999/01 1998/12 1998/11 1998/10 1998/09 1998/08 1998/07 1998/06 1998/05 1998/04 1998/03 1998/02 1998/01
 
Text written by user:
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1167.083333333333NANA-350.938494443442NA
2182.272727272727NANA-335.760337877786NA
3200.5NANA-317.546133332331NA
4222.777777777778NANA-295.282938887887NA
5250.625NANA-267.449605554554NA
6286.428571428571NANA-231.646034125982NA
7334.166666666667334.545178596481518.491311928812-183.946133332331-0.378511929814067
8401401.261845263147518.484051827802-117.222206564654-0.261845263147393
9501.25501.336845263147518.476097282347-17.1392520191999-0.0868452631473247
10668.333333333333668.128511929814518.467300986051149.6612109437630.204821403519190
111002.51001.71184526315518.457463023088483.2543822400590.788154736852562
1220052002.46184526315518.4463023088021484.015542954342.53815473685279
13167167.494911039963518.433405483405-350.938494443442-0.494911039963085
14182.181818181818182.657789827842518.418127705628-335.760337877786-0.475971646023595
15200.4200.853244373296518.399377705628-317.546133332331-0.453244373296229
16222.666666666667223.092133262185518.375072150072-295.282938887887-0.425466595518515
17250.5250.890744373296518.34034992785-267.449605554554-0.390744373296457
18286.285714285714286.631815801868518.27784992785-231.646034125982-0.346101516153453
19334334.28657770663518.232711038961-183.946133332331-0.286577706629714
20400.8401.003244373296518.225450937951-117.222206564654-0.203244373296457
21501501.078244373296518.217496392496-17.1392520191999-0.078244373296343
22668667.869911039963518.2087000962149.6612109437630.130088960036915
2310021001.45324437330518.198862133237483.2543822400590.546755626703543
2420042002.20324437330518.1877014189511484.015542954341.79675562670366
25166.916666666667167.236310150112518.174804593555-350.938494443442-0.319643483445475
26182.090909090909182.399188937991518.159526815777-335.760337877786-0.308279847081963
27200.3200.594643483446518.140776815777-317.546133332331-0.294643483445611
28222.555555555556222.833532372334518.116471260221-295.282938887887-0.277976816778846
29250.375250.632143483446518.081749037999-267.449605554554-0.257143483445589
30286.142857142857286.373214912017518.019249037999-231.646034125982-0.230357769159809
31333.833333333333334.027976816779517.97411014911-183.946133332331-0.194643483445475
32400.6400.744643483446517.9668500481-117.222206564654-0.144643483445520
33500.75500.819643483445517.958895502645-17.1392520191999-0.0696434834454749
34667.666666666667667.611310150112517.950099206349149.6612109437630.0553565165544114
351001.51001.19464348345517.940261243386483.2543822400590.305356516554411
3620032001.94464348345517.9291005291011484.015542954341.05535651655453
37166.833333333333166.977709260261517.916203703704-350.938494443442-0.144375926927978
38182182.14058804814517.900925925926-335.760337877786-0.140588048140103
39200.2200.336042593595517.882175925926-317.546133332331-0.136042593594652
40222.444444444444222.574931482483517.85787037037-295.282938887887-0.130487038038950
41250.25250.373542593595517.823148148148-267.449605554554-0.123542593594607
42286286.114614022166517.760648148148-231.646034125982-0.114614022166052
43333.666666666667333.769375926928517.715509259259-183.946133332331-0.102709260261349
44400.4400.486042593595517.708249158249-117.222206564654-0.0860425935945841
45500.5500.561042593595517.700294612795-17.1392520191999-0.0610425935946068
46667.333333333333667.352709260261517.691498316498149.661210943763-0.0193759269279781
4710011000.93604259359517.681660353535483.2543822400590.0639574064052795
4820022001.68604259359517.670499639251484.015542954340.313957406405507
49166.75166.719108370410517.657602813853-350.9384944434420.0308916295896324
50181.909090909091181.881987158289517.642325036075-335.7603378777860.0271037508017571
51200.1200.077441703744517.623575036075-317.5461333323310.0225582962563067
52222.333333333333222.316330592633517.599269480519-295.2829388878870.0170027407007183
53250.125250.114941703744517.564547258297-267.4496055545540.0100582962562612
54285.857142857143285.856013132315517.502047258297-231.6460341259820.00112972482759233
55333.5333.510775037077517.456908369408-183.946133332331-0.0107750370771100
56400.2400.227441703744517.449648268398-117.222206564654-0.0274417037437615
57500.25500.302441703744517.441693722944-17.1392520191999-0.0524417037437388
58667667.09410837041517.432897426647149.661210943763-0.0941083704104813
591000.51000.67744170374517.423059463684483.254382240059-0.177441703743852
6020012001.42744170374517.4118987493991484.01554295434-0.427441703743625
61166.666666666667166.460507480560517.399001924002-350.9384944434420.206159186107129
62181.818181818182181.623386268438517.383724146224-335.7603378777860.194795549743390
63200199.818840813893517.364974146224-317.5461333323310.181159186107152
64222.222222222222222.057729702782517.340668590669-295.2829388878870.164492519440500
65250249.856340813893517.305946368446-267.4496055545540.143659186107129
66285.714285714286285.597412242464517.243446368446-231.6460341259820.116873471821464
67333.333333333333333.252174147226517.198307479557-183.9461333323310.0811591861071292
68400399.968840813893517.191047378547-117.2222065646540.0311591861070610
69500500.043840813893517.183092833093-17.1392520191999-0.0438408138928708
70666.666666666667666.83550748056517.174296536796149.661210943763-0.168840813892871
7110001000.41884081389517.164458573833483.254382240059-0.418840813892871
7220002001.16884081389517.1532978595481484.01554295434-1.16884081389276
73166.583333333333166.201906590709517.140401034151-350.9384944434420.38142674262474
74181.727272727273181.364785378587517.125123256373-335.7603378777860.362487348685363
75199.9199.560239924042517.106373256373-317.5461333323310.339760075958111
76222.111111111111221.799128812931517.082067700818-295.2829388878870.311982298180283
77249.875249.597739924042517.047345478595-267.4496055545540.277260075958111
78285.571428571429285.338811352613516.984845478596-231.6460341259820.232617218815108
79333.166666666667332.993573257375516.939706589706-183.9461333323310.173093409291369
80399.8399.710239924042516.932446488696-117.2222065646540.0897600759579973
81499.75499.785239924042516.924491943242-17.1392520191999-0.0352399240420027
82666.333333333333666.576906590709516.915695646946149.661210943763-0.243573257375374
83999.51000.16023992404516.905857683983483.254382240059-0.660239924042003
8419992000.91023992404516.8946969696971484.01554295434-1.91023992404189
85166.5165.943305700858516.8818001443-350.9384944434420.556694299142237
86181.636363636364181.106184488737516.866522366522-335.7603378777860.530179147627109
87199.8199.301639034191516.847772366522-317.5461333323310.498360965808956
88222221.54052792308516.823466810967-295.2829388878870.459472076919951
89249.75249.339139034191516.788744588745-267.4496055545540.410860965808979
90285.428571428571285.080210462762516.726244588745-231.6460341259820.348360965808979
91333NANA-183.946133332331NA
92399.6NANA-117.222206564654NA
93499.5NANA-17.1392520191999NA
94666NANA149.661210943763NA
95999NANA483.254382240059NA
961998NANA1484.01554295434NA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj/10ghf1218992121.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj/10ghf1218992121.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj/2s83u1218992121.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj/2s83u1218992121.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj/393rz1218992121.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj/393rz1218992121.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj/4eedd1218992121.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Aug/17/t1218992287hrw7h5xw0smx8rj/4eedd1218992121.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