Home » date » 2010 » Aug » 19 »

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Thu, 19 Aug 2010 01:04:08 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo.htm/, Retrieved Thu, 19 Aug 2010 03:51:03 +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/2010/Aug/19/t1282182661da18wgw4l8ywufo.htm/},
    year = {2010},
}
@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 = {2010},
    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 «
94 93 92 90 110 109 94 84 85 85 86 88 93 94 90 91 104 103 88 79 82 88 93 89 94 96 94 92 113 122 107 98 103 110 113 110 123 124 118 117 139 146 134 121 123 122 127 122 139 136 127 123 140 146 138 120 122 115 115 102 119 114 108 102 121 109 102 95 98 92 94 90 113 111 103 90 108 99 95 91 85 72 90 90 114 115 104 93 101 90 79 75 71 61 84 87 107 99 93 74 87 71 67 61 63 52 80 84 102 93 87 72 83 72 66 64 64 47 77 79
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
194NANA11.483024691358NA
293NANA9.2608024691358NA
392NANA3.00617283950618NA
490NANA-4.49845679012345NA
5110NANA11.4969135802469NA
6109NANA7.35802469135803NA
79491.932098765432192.4583333333333-0.5262345679012342.06790123456788
88483.006172839506292.4583333333333-9.452160493827170.993827160493822
98583.876543209876592.4166666666667-8.540123456790131.12345679012346
108580.052469135802592.375-12.32253086419754.94753086419755
118689.496913580246992.1666666666667-2.66975308641975-3.49691358024691
128887.07098765432191.6666666666667-4.595679012345680.929012345679027
1393102.64969135802591.166666666666711.483024691358-9.6496913580247
149499.969135802469190.70833333333339.2608024691358-5.96913580246913
159093.381172839506290.3753.00617283950618-3.38117283950618
169185.876543209876590.375-4.498456790123455.12345679012346
17104102.28858024691490.791666666666611.49691358024691.71141975308643
1810398.48302469135891.1257.358024691358034.51697530864197
198890.682098765432191.2083333333333-0.526234567901234-2.6820987654321
207981.881172839506291.3333333333333-9.45216049382717-2.88117283950618
218283.043209876543291.5833333333333-8.54012345679013-1.04320987654322
228879.469135802469191.7916666666667-12.32253086419758.53086419753087
239389.538580246913692.2083333333333-2.669753086419753.46141975308643
248988.779320987654393.375-4.595679012345680.220679012345698
2594106.44135802469194.958333333333311.483024691358-12.4413580246913
2696105.80246913580296.54166666666679.2608024691358-9.80246913580245
2794101.2145061728498.20833333333333.00617283950618-7.2145061728395
289295.5015432098765100-4.49845679012345-3.50154320987653
29113113.246913580247101.7511.4969135802469-0.246913580246911
30122110.816358024691103.4583333333337.3580246913580311.1836419753087
31107105.015432098765105.541666666667-0.5262345679012341.98456790123456
329898.4645061728395107.916666666667-9.45216049382717-0.464506172839506
33103101.543209876543110.083333333333-8.540123456790131.45679012345677
3411099.8024691358025112.125-12.322530864197510.1975308641975
35113111.58024691358114.25-2.669753086419751.41975308641975
36110111.737654320988116.333333333333-4.59567901234568-1.73765432098766
37123129.941358024691118.45833333333311.483024691358-6.94135802469135
38124129.802469135802120.5416666666679.2608024691358-5.80246913580245
39118125.33950617284122.3333333333333.00617283950618-7.33950617283952
40117119.168209876543123.666666666667-4.49845679012345-2.1682098765432
41139136.246913580247124.7511.49691358024692.75308641975309
42146133.191358024691125.8333333333337.3580246913580312.8086419753087
43134126.473765432099127-0.5262345679012347.52623456790126
44121118.714506172839128.166666666667-9.452160493827172.28549382716051
45123120.501543209877129.041666666667-8.540123456790132.49845679012347
46122117.344135802469129.666666666667-12.32253086419754.65586419753086
47127127.288580246914129.958333333333-2.66975308641975-0.288580246913597
48122125.404320987654130-4.59567901234568-3.40432098765432
49139141.649691358025130.16666666666711.483024691358-2.64969135802468
50136139.552469135802130.2916666666679.2608024691358-3.55246913580245
51127133.214506172839130.2083333333333.00617283950618-6.21450617283949
52123125.376543209877129.875-4.49845679012345-2.37654320987652
53140140.58024691358129.08333333333311.4969135802469-0.580246913580226
54146135.108024691358127.757.3580246913580310.891975308642
55138125.557098765432126.083333333333-0.52623456790123412.4429012345679
56120114.881172839506124.333333333333-9.452160493827175.11882716049382
57122114.08487654321122.625-8.540123456790137.91512345679011
58115108.635802469136120.958333333333-12.32253086419756.3641975308642
59115116.621913580247119.291666666667-2.66975308641975-1.62191358024691
60102112.362654320988116.958333333333-4.59567901234568-10.3626543209876
61119125.399691358025113.91666666666711.483024691358-6.39969135802468
62114120.635802469136111.3759.2608024691358-6.6358024691358
63108112.339506172839109.3333333333333.00617283950618-4.33950617283949
64102102.876543209877107.375-4.49845679012345-0.876543209876544
65121117.038580246914105.54166666666711.49691358024693.9614197530864
66109111.524691358025104.1666666666677.35802469135803-2.52469135802468
67102102.890432098765103.416666666667-0.526234567901234-0.890432098765416
689593.5895061728395103.041666666667-9.452160493827171.41049382716051
699894.1682098765432102.708333333333-8.540123456790133.83179012345681
709289.6774691358025102-12.32253086419752.32253086419756
719498.2885802469136100.958333333333-2.66975308641975-4.2885802469136
729095.4043209876543100-4.59567901234568-5.40432098765433
73113110.77469135802599.291666666666711.4830246913582.2253086419753
74111108.09413580246998.83333333333339.26080246913582.90586419753089
75103101.13117283950698.1253.006172839506181.86882716049382
769092.251543209876596.75-4.49845679012345-2.25154320987653
77108107.24691358024795.7511.49691358024690.753086419753075
7899102.94135802469195.58333333333337.35802469135803-3.94135802469135
799595.098765432098895.625-0.526234567901234-0.098765432098773
809186.381172839506295.8333333333333-9.452160493827174.61882716049384
818587.501543209876596.0416666666667-8.54012345679013-2.50154320987654
827283.885802469135896.2083333333333-12.3225308641975-11.8858024691358
839093.371913580246996.0416666666667-2.66975308641975-3.37191358024691
849090.779320987654395.375-4.59567901234568-0.779320987654302
85114105.81635802469194.333333333333311.4830246913588.18364197530866
86115102.260802469136939.260802469135812.7391975308642
8710494.756172839506291.753.006172839506189.24382716049382
889386.209876543209990.7083333333333-4.498456790123456.79012345679013
89101101.4969135802479011.4969135802469-0.496913580246911
909096.98302469135889.6257.35802469135803-6.98302469135803
917988.682098765432189.2083333333333-0.526234567901234-9.6820987654321
927578.797839506172888.25-9.45216049382717-3.79783950617285
937178.584876543209987.125-8.54012345679013-7.58487654320987
946173.552469135802585.875-12.3225308641975-12.5524691358025
958481.830246913580284.5-2.669753086419752.16975308641976
968778.529320987654383.125-4.595679012345688.47067901234568
9710793.316358024691481.833333333333311.48302469135813.6836419753086
989990.010802469135880.759.26080246913588.9891975308642
999382.839506172839579.83333333333333.0061728395061810.1604938271605
1007474.626543209876579.125-4.49845679012345-0.626543209876544
1018790.080246913580378.583333333333311.4969135802469-3.08024691358025
1027185.649691358024778.29166666666677.35802469135803-14.6496913580247
1036777.432098765432177.9583333333333-0.526234567901234-10.4320987654321
1046168.047839506172877.5-9.45216049382717-7.04783950617283
1056368.459876543209977-8.54012345679013-5.45987654320989
1065264.344135802469176.6666666666667-12.3225308641975-12.3441358024691
1078073.746913580246976.4166666666667-2.669753086419756.25308641975307
1088471.69598765432176.2916666666667-4.5956790123456812.304012345679
10910287.774691358024776.291666666666711.48302469135814.2253086419753
1109385.635802469135876.3759.26080246913587.3641975308642
1118779.547839506172876.54166666666673.006172839506187.45216049382717
1127271.876543209876576.375-4.498456790123450.123456790123456
1138387.538580246913676.041666666666711.4969135802469-4.53858024691358
1147283.066358024691475.70833333333337.35802469135803-11.0663580246914
11566NANA-0.526234567901234NA
11664NANA-9.45216049382717NA
11764NANA-8.54012345679013NA
11847NANA-12.3225308641975NA
11977NANA-2.66975308641975NA
12079NANA-4.59567901234568NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo/1c3p81282179844.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo/1c3p81282179844.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo/2c3p81282179844.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo/2c3p81282179844.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo/3nuot1282179844.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo/3nuot1282179844.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo/4ylow1282179844.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/19/t1282182661da18wgw4l8ywufo/4ylow1282179844.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