Home » date » 2010 » Aug » 16 »

Decomposition

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Mon, 16 Aug 2010 13:18:35 +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/16/t12819647614j5bacx30ged4ir.htm/, Retrieved Mon, 16 Aug 2010 15:19:27 +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/16/t12819647614j5bacx30ged4ir.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 «
244 243 242 240 260 259 244 234 235 235 236 238 240 233 233 233 247 251 233 226 233 233 227 225 223 212 206 202 223 221 212 205 204 200 195 193 196 180 174 164 192 189 181 167 166 164 167 164 161 141 134 111 147 144 142 140 143 137 140 130 129 112 101 74 104 103 100 98 99 91 92 94 93 76 64 32 62 69 69 68 68 59 66 73 70 57 48 22 64 74 67 61 61 52 54 69 69 53 50 22 69 78 74 63 67 59 60 80 77 58 54 32 78 86 84 78 72 64 62 72
 
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
1244NANA8.14621913580246NA
2243NANA-5.50192901234568NA
3242NANA-10.4695216049383NA
4240NANA-28.0343364197531NA
5260NANA6.2295524691358NA
6259NANA11.0258487654321NA
7244247.410108024691242.3333333333335.07677469135803-3.41010802469134
8234241.789737654321241.750.0397376543209901-7.78973765432096
9235244.280478395062240.9583333333333.32214506172839-9.28047839506175
10235240.336033950617240.2916666666670.0443672839506155-5.33603395061726
11236242.086033950617239.4583333333332.62770061728395-6.08603395061732
12238246.076774691358238.5833333333337.49344135802469-8.07677469135803
13240245.937885802469237.7916666666678.14621913580246-5.93788580246911
14233231.498070987654237-5.501929012345681.50192901234567
15233226.113811728395236.583333333333-10.46952160493836.88618827160496
16233208.382330246914236.416666666667-28.034336419753124.6176697530865
17247242.187885802469235.9583333333336.22955246913584.81211419753089
18251246.067515432099235.04166666666711.02584876543214.93248456790127
19233238.868441358025233.7916666666675.07677469135803-5.86844135802465
20226232.248070987654232.2083333333330.0397376543209901-6.2480709876543
21233233.530478395062230.2083333333333.32214506172839-0.530478395061721
22233227.836033950617227.7916666666670.04436728395061555.16396604938274
23227228.127700617284225.52.62770061728395-1.12770061728389
24225230.743441358025223.257.49344135802469-5.74344135802465
25223229.271219135802221.1258.14621913580246-6.27121913580243
26212213.873070987654219.375-5.50192901234568-1.87307098765427
27206206.822145061728217.291666666667-10.4695216049383-0.822145061728378
28202186.67399691358214.708333333333-28.034336419753115.3260030864198
29223218.2295524691362126.22955246913584.77044753086423
30221220.359182098765209.33333333333311.02584876543210.640817901234584
31212211.951774691358206.8755.076774691358030.048225308642003
32205204.456404320988204.4166666666670.03973765432099010.543595679012356
33204205.072145061728201.753.32214506172839-1.07214506172841
34200198.877700617284198.8333333333330.04436728395061551.12229938271608
35195198.586033950617195.9583333333332.62770061728395-3.58603395061726
36193200.826774691358193.3333333333337.49344135802469-7.826774691358
37196198.854552469136190.7083333333338.14621913580246-2.85455246913580
38180182.331404320988187.833333333333-5.50192901234568-2.33140432098764
39174174.197145061728184.666666666667-10.4695216049383-0.197145061728378
40164153.548996913580181.583333333333-28.034336419753110.4510030864197
41192185.146219135802178.9166666666676.22955246913586.85378086419752
42189187.567515432099176.54166666666711.02584876543211.43248456790121
43181178.951774691358173.8755.076774691358032.04822530864200
44167170.831404320988170.7916666666670.0397376543209901-3.83140432098764
45166170.822145061728167.53.32214506172839-4.82214506172838
46164163.669367283951163.6250.04436728395061550.330632716049394
47167162.169367283951159.5416666666672.627700617283954.83063271604937
48164163.285108024691155.7916666666677.493441358024690.714891975308632
49161160.437885802469152.2916666666678.146219135802460.562114197530889
50141144.039737654321149.541666666667-5.50192901234568-3.03973765432102
51134136.988811728395147.458333333333-10.4695216049383-2.98881172839506
52111117.340663580247145.375-28.0343364197531-6.34066358024694
53147149.354552469136143.1256.2295524691358-2.35455246913580
54144151.609182098765140.58333333333311.0258487654321-7.60918209876544
55142142.910108024691137.8333333333335.07677469135803-0.910108024691368
56140135.331404320988135.2916666666670.03973765432099014.66859567901236
57143136.030478395062132.7083333333333.322145061728396.96952160493825
58137129.836033950617129.7916666666670.04436728395061557.1639660493827
59140129.086033950617126.4583333333332.6277006172839510.9139660493827
60130130.451774691358122.9583333333337.49344135802469-0.451774691358025
61129127.646219135802119.58.146219135802461.35378086419752
62112110.498070987654116-5.501929012345681.50192901234567
63101101.947145061728112.416666666667-10.4695216049383-0.947145061728378
647480.6323302469136108.666666666667-28.0343364197531-6.63233024691357
65104110.979552469136104.756.2295524691358-6.97955246913578
66103112.275848765432101.2511.0258487654321-9.27584876543209
67100103.32677469135898.255.07677469135803-3.32677469135803
689895.28973765432195.250.03973765432099012.710262345679
699995.530478395061792.20833333333333.322145061728393.46952160493828
709188.961033950617388.91666666666670.04436728395061552.03896604938272
719288.044367283950685.41666666666672.627700617283953.95563271604939
729489.743441358024782.257.493441358024694.25655864197532
739387.687885802469279.54166666666678.146219135802465.31211419753085
747671.498070987654377-5.501929012345684.50192901234567
756463.988811728395174.4583333333333-10.46952160493830.0111882716049507
763243.798996913580371.8333333333333-28.0343364197531-11.7989969135803
776275.646219135802569.41666666666676.2295524691358-13.6462191358025
786978.484182098765467.458333333333311.0258487654321-9.48418209876543
796970.70177469135865.6255.07677469135803-1.70177469135803
806863.91473765432163.8750.03973765432099014.08526234567903
816865.738811728395062.41666666666673.322145061728392.26118827160496
825961.37770061728461.33333333333330.0443672839506155-2.37770061728394
836663.627700617284612.627700617283952.37229938271606
847368.785108024691361.29166666666677.493441358024694.21489197530866
857069.562885802469161.41666666666678.146219135802460.437114197530875
865755.53973765432161.0416666666667-5.501929012345681.46026234567901
874849.988811728395160.4583333333333-10.4695216049383-1.98881172839506
882231.840663580246959.875-28.0343364197531-9.8406635802469
896465.312885802469259.08333333333336.2295524691358-1.31288580246915
907469.442515432098858.416666666666711.02584876543214.55748456790123
916763.285108024691458.20833333333335.076774691358033.71489197530864
926158.039737654321580.03973765432099012.96026234567901
936161.238811728395157.91666666666673.32214506172839-0.238811728395063
945258.0443672839506580.0443672839506155-6.04436728395061
955460.836033950617358.20833333333332.62770061728395-6.83603395061728
966966.07677469135858.58333333333337.493441358024692.92322530864197
976967.187885802469159.04166666666678.146219135802461.81211419753087
985353.91473765432159.4166666666667-5.50192901234568-0.914737654320987
995049.280478395061759.75-10.46952160493830.71952160493828
1002232.257330246913660.2916666666667-28.0343364197531-10.2573302469136
1016967.062885802469160.83333333333336.22955246913581.93711419753087
1027872.567515432098861.541666666666711.02584876543215.43248456790123
1037467.410108024691462.33333333333335.076774691358036.58989197530865
1046362.91473765432162.8750.03973765432099010.0852623456790127
1056766.572145061728463.253.322145061728390.427854938271608
1065963.87770061728463.83333333333330.0443672839506155-4.87770061728394
1076067.25270061728464.6252.62770061728395-7.25270061728395
1088072.82677469135865.33333333333337.493441358024697.17322530864199
1097774.229552469135866.08333333333338.146219135802462.77044753086420
1105861.623070987654367.125-5.50192901234568-3.62307098765431
1115457.48881172839567.9583333333333-10.4695216049383-3.48881172839505
1123240.340663580246968.375-28.0343364197531-8.3406635802469
1137874.896219135802568.66666666666676.22955246913583.10378086419753
1148679.442515432098868.416666666666711.02584876543216.55748456790124
11584NANA5.07677469135803NA
11678NANA0.0397376543209901NA
11772NANA3.32214506172839NA
11864NANA0.0443672839506155NA
11962NANA2.62770061728395NA
12072NANA7.49344135802469NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Aug/16/t12819647614j5bacx30ged4ir/1nkqi1281964712.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/16/t12819647614j5bacx30ged4ir/1nkqi1281964712.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/16/t12819647614j5bacx30ged4ir/2gtpl1281964712.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/16/t12819647614j5bacx30ged4ir/2gtpl1281964712.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/16/t12819647614j5bacx30ged4ir/39lo61281964712.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/16/t12819647614j5bacx30ged4ir/39lo61281964712.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Aug/16/t12819647614j5bacx30ged4ir/49lo61281964712.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Aug/16/t12819647614j5bacx30ged4ir/49lo61281964712.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