Home » date » 2009 » Dec » 04 »

Ws 9: classical decomposition

*The author of this computation has been verified*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Fri, 04 Dec 2009 08:11:47 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5.htm/, Retrieved Fri, 04 Dec 2009 16:12:48 +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/2009/Dec/04/t1259939563ijg9phsnhslrkn5.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 «
79.8 83.4 113.6 112.9 104 109.9 99 106.3 128.9 111.1 102.9 130 87 87.5 117.6 103.4 110.8 112.6 102.5 112.4 135.6 105.1 127.7 137 91 90.5 122.4 123.3 124.3 120 118.1 119 142.7 123.6 129.6 151.6 110.4 99.2 130.5 136.2 129.7 128 121.6 135.8 143.8 147.5 136.2 156.6 123.3 104.5 139.8 136.5 112.1 118.5 94.4 102.3 111.4 99.2 87.8 115.8
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
179.8NANA0.845455037396441NA
283.4NANA0.788096489013404NA
3113.6NANA1.05599690966033NA
4112.9NANA1.03304502569662NA
5104NANA0.991406386781802NA
6109.9NANA0.9997050446317NA
79999.3008748374767107.1166666666670.9270347736500080.996970068612496
8106.3106.413368376655107.58750.9890867282598340.998934641592646
9128.9124.203307476908107.9251.150829812155741.03781455275630
10111.1108.440480666374107.6958333333331.006914356015391.02452515257478
11102.9110.283413800911107.5833333333331.025097572123110.933050550881208
12130128.207105297975107.9791666666671.187331864615631.01398436301840
138791.5099396101973108.23750.8454550373964410.950716396170643
1487.585.6168323251937108.63750.7880964890134041.02199529722910
15117.6115.284062625043109.1708333333331.055996909660331.02008896392288
16103.4112.808516806071109.21.033045025696620.91659746025874
17110.8109.038179106218109.9833333333330.9914063867818021.01615783488153
18112.6111.27550234288111.3083333333330.99970504463171.01190286836934
19102.5103.611586534949111.7666666666670.9270347736500080.989271600096826
20112.4110.835410290917112.0583333333330.9890867282598341.01411633434637
21135.6129.334090389436112.3833333333331.150829812155741.0484474711323
22105.1114.196674401596113.41251.006914356015390.920342037548263
23127.7117.685472519616114.8041666666671.025097572123111.08509569844073
24137137.344613439413115.6751.187331864615630.997490884929646
259198.608239195005116.6333333333330.8454550373964410.922843777993449
2690.592.6473097542674117.5583333333330.7880964890134040.97682275114126
27122.4124.74403494075118.1291666666671.055996909660330.981209242254644
28123.3123.134662708763119.1958333333331.033045025696621.00134273556771
29124.3119.014205873210120.0458333333330.9914063867818021.04441313612949
30120120.697722388534120.7333333333330.99970504463170.994219258037962
31118.1113.237297601348122.150.9270347736500081.04294258607063
32119121.974999567943123.3208333333330.9890867282598340.975609759553344
33142.7142.726872328398124.0208333333331.150829812155740.999811722011703
34123.6125.759407589839124.8958333333331.006914356015390.98282905723537
35129.6128.812052417036125.6583333333331.025097572123111.00611703305847
36151.6149.861070178903126.2166666666671.187331864615631.01160361272625
37110.4107.115630508807126.6958333333330.8454550373964411.03066190690931
3899.2100.515139702918127.5416666666670.7880964890134040.986916003829822
39130.5135.471203548049128.28751.055996909660330.963304352380052
40136.2133.602852302489129.3291666666671.033045025696621.01943931325381
41129.7129.477674113703130.60.9914063867818021.00171709823967
42128131.044669600472131.0833333333330.99970504463170.976766169812519
43121.6122.210221681303131.8291666666670.9270347736500080.99500678688814
44135.8131.140536583151132.58750.9890867282598341.03553030617573
45143.8153.285735854927133.1958333333331.150829812155740.938117295767792
46147.5134.519562487173133.5958333333331.006914356015391.09649479430967
47136.2136.209839895858132.8751.025097572123110.99992775928769
48156.6156.426025947007131.7458333333331.187331864615631.00111218099380
49123.3110.092336786307130.2166666666670.8454550373964411.11996896059469
50104.5100.630070440899127.68750.7880964890134041.03845698946791
51139.8131.938013887811124.9416666666671.055996909660331.05958848311052
52136.5125.596753353340121.5791666666671.033045025696621.08681153258783
53112.1116.539820766201117.550.9914063867818020.961902972417404
54118.5113.799757580575113.8333333333330.99970504463171.04130274544827
5594.4NANA0.927034773650008NA
56102.3NANA0.989086728259834NA
57111.4NANA1.15082981215574NA
5899.2NANA1.00691435601539NA
5987.8NANA1.02509757212311NA
60115.8NANA1.18733186461563NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5/1e3q71259939505.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5/1e3q71259939505.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5/2b24z1259939505.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5/2b24z1259939505.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5/3gqg31259939505.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5/3gqg31259939505.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5/4g6zu1259939505.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259939563ijg9phsnhslrkn5/4g6zu1259939505.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