Home » date » 2008 » May » 25 »

opgave 9, oef 2

R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Sun, 25 May 2008 09:26:20 -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/May/25/t12117292611srte2oyne8y6kt.htm/, Retrieved Sun, 25 May 2008 17:27:46 +0200
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
-22 -31 -22 -26 -19 -20 -24 -29 -28 -31 -30 -32 -38 -43 -51 -43 -43 -42 -47 -45 -38 -46 -38 -32 -27 -26 -21 -23 -24 -17 -23 -16 -22 -26 -25 -21 -21 -18 -12 -19 -31 -38 -38 -32 -43 -33 -28 -25 -19 -20 -21 -19 -17 -16 -10 -16 -10 -8 -7 -15 -7 -6 -6 2 -4 -4 -8 -10 -16 -14 -30 -33
 
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 time6 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1-22NANA0.878593528797878NA
2-31NANA0.891862724105373NA
3-22NANA0.86922906834002NA
4-26NANA0.907834792939273NA
5-19NANA1.02869071623239NA
6-20NANA1.02067951940671NA
7-24-27.8337680645636-26.83333333333331.037283281909200.862261981357653
8-29-28.9410817048124-281.033610060886161.0020358014185
9-28-31.9872962682127-29.70833333333331.076711234834650.875347505622878
10-31-34.5283393728736-31.6251.091805197561220.897813232928151
11-30-33.339932427394-33.33333333333331.000197972821820.899821859727295
12-32-41.0134420513267-35.251.163501902165300.78023200198494
13-38-32.6177847566212-37.1250.8785935287978781.16500860752925
14-43-34.5596805590832-38.750.8918627241053731.24422446343181
15-51-34.6242912222108-39.83333333333330.869229068340021.47295433927278
16-43-37.1077471613928-40.8750.9078347929392731.15878767344673
17-43-43.0335616290551-41.83333333333331.028690716232390.999220105708554
18-42-43.0386530683164-42.16666666666671.020679519406710.975866970867613
19-47-43.263356882963-41.70833333333331.037283281909201.08636969912310
20-45-41.9042745517597-40.54166666666671.033610060886161.07387612555890
21-38-41.5431084773702-38.58333333333331.076711234834650.91471248524168
22-46-39.8508897109845-36.51.091805197561221.15430296120391
23-38-34.8819043021609-34.8751.000197972821821.08939006514177
24-32-38.4440420173784-33.04166666666671.163501902165300.83237865533324
25-27-27.2363993927342-310.8785935287978780.991320460927105
26-26-25.6782142648672-28.79166666666670.8918627241053731.01253146857541
27-21-23.3967490894855-26.91666666666670.869229068340020.897560593554314
28-23-23.0741343205399-25.41666666666670.9078347929392730.996787124513102
29-24-24.7314393027538-24.04166666666671.028690716232390.970424717550816
30-17-23.518157259663-23.04166666666671.020679519406710.722845749022923
31-23-23.1659932959722-22.33333333333331.037283281909200.992834613484884
32-16-22.4810188242740-21.751.033610060886160.711711516504935
33-22-22.6557988996457-21.04166666666671.076711234834650.971053817058025
34-26-22.382006550005-20.51.091805197561221.16164741270680
35-25-20.62908318945-20.6251.000197972821821.21188129256201
36-21-25.3546456180188-21.79166666666671.163501902165300.828250582413029
37-21-20.4639076082506-23.29166666666670.8785935287978781.02619697088220
38-18-21.9249586342571-24.58333333333330.8918627241053730.820982164676723
39-12-22.7086094103830-26.1250.869229068340020.528433942525483
40-19-24.776324557301-27.29166666666670.9078347929392730.766861120020368
41-31-28.5033052622726-27.70833333333331.028690716232391.08759316559094
42-38-28.5790265433880-281.020679519406711.32964640843555
43-38-29.1303721669501-28.08333333333331.037283281909201.30448041591150
44-32-29.0272158765530-28.08333333333331.033610060886161.10241368431922
45-43-30.7311331609056-28.54166666666671.076711234834651.39923249087027
46-33-31.5713669628119-28.91666666666671.091805197561221.04525090848524
47-28-28.3389425632849-28.33333333333331.000197972821820.988039689112324
48-25-31.2206343747688-26.83333333333331.163501902165300.800752467099257
49-19-21.7451898377475-24.750.8785935287978780.873756455646935
50-20-20.4385207607481-22.91666666666670.8918627241053730.97854439830155
51-21-18.1451568015979-20.8750.869229068340021.15733361963291
52-19-16.7571172196707-18.45833333333330.9078347929392731.13384657700529
53-17-17.0162589310108-16.54166666666671.028690716232390.999044506135176
54-16-15.5653626709524-15.251.020679519406711.02792336665941
55-10-14.8677270406986-14.33333333333331.037283281909200.672597766465999
56-16-13.6953333067416-13.251.033610060886161.16828116860244
57-10-12.9653977861339-12.04166666666671.076711234834650.771283701815512
58-8-11.5094464576245-10.54166666666671.091805197561220.695081212589537
59-7-9.1268065019991-9.1251.000197972821820.766971448169384
60-15-9.40497370916949-8.083333333333331.163501902165301.59490079013996
61-7-6.58945146598409-7.50.8785935287978781.06230390133917
62-6-6.3916828560885-7.166666666666670.8918627241053730.938719916975323
63-6-6.22947498977015-7.166666666666670.869229068340020.9631630289636
642-6.96006674586776-7.666666666666670.907834792939273-0.287353566140355
65-4-9.12963010656249-8.8751.028690716232390.43813385135119
66-4-10.8021915803877-10.58333333333331.020679519406710.370295228540691
67-8NANA1.03728328190920NA
68-10NANA1.03361006088616NA
69-16NANA1.07671123483465NA
70-14NANA1.09180519756122NA
71-30NANA1.00019797282182NA
72-33NANA1.16350190216530NA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t12117292611srte2oyne8y6kt/14fwg1211729173.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t12117292611srte2oyne8y6kt/14fwg1211729173.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t12117292611srte2oyne8y6kt/25ad81211729173.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t12117292611srte2oyne8y6kt/25ad81211729173.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t12117292611srte2oyne8y6kt/3697b1211729173.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t12117292611srte2oyne8y6kt/3697b1211729173.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t12117292611srte2oyne8y6kt/4b3u41211729173.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t12117292611srte2oyne8y6kt/4b3u41211729173.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