Home » date » 2011 » May » 17 »

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Tue, 17 May 2011 20:35:31 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5.htm/, Retrieved Tue, 17 May 2011 22:32:35 +0200
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
KDGP2W92
 
Dataseries X:
» Textbox « » Textfile « » CSV «
56 55 54 52 72 71 56 46 47 47 48 50 44 38 33 33 52 54 39 22 31 31 38 42 41 31 36 34 51 47 31 19 30 33 36 40 32 25 28 29 55 55 40 38 44 41 49 59 61 47 43 39 66 68 63 68 67 59 68 78 82 70 62 68 94 102 100 104 103 93 110 114 120 102 95 103 122 139 135 135 137 130 148 148 145 128 131 133 146 163 151 157 152 149 172 167 160 150 160 165 171 179 171 176 170 169 194 196 188 174 186 191 197 206 197 204 201 190 213 213
 
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'Herman Ole Andreas Wold' @ www.yougetit.org


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
156NANA1.05645166091252NA
255NANA0.880295890934327NA
354NANA0.869636406775788NA
452NANA0.871434371109763NA
572NANA1.1625384550494NA
671NANA1.19238812348658NA
75654.5994908201874541.011101681855321.02565059048673
84647.825163747467552.79166666666670.905922596637110.96183674859735
94749.491750716379651.20833333333330.9664784517437840.949653211286483
104745.902279849033349.54166666666670.9265388699552571.02391428387821
114850.256859069406347.91666666666671.048838797970220.95509351138937
125051.400876414305546.3751.108374693569930.972746059755596
134447.496305921858544.95833333333331.056451660912520.926387834716858
143838.072797282909643.250.8802958909343270.998087944986844
153336.162380581759941.58333333333330.8696364067757880.912550542002897
163335.07523343716840.250.8714343711097630.940834793276987
175245.532756156101639.16666666666671.16253845504941.14203497415633
185445.807577077276238.41666666666671.192388123486581.17884427523646
193938.379734673758337.95833333333331.011101681855321.01616127186689
202234.009844148751537.54166666666670.905922596637110.646871532365067
213136.122132133923937.3750.9664784517437840.858199618036569
223134.783813409570337.54166666666670.9265388699552570.891219132157338
233839.375156540465337.54166666666671.048838797970220.965075528295308
244241.240775056581137.20833333333331.108374693569931.01840957019788
254138.648523261716236.58333333333331.056451660912521.06084260250671
263131.800689060002636.1250.8802958909343270.974821644320606
273631.270675793646135.95833333333330.8696364067757881.15123831149549
283431.3716373599515360.8714343711097631.08378149377067
295141.8513843817785361.16253845504941.21859768209256
304742.727241091602535.83333333333331.192388123486581.10000081445084
313135.76772199563235.3751.011101681855320.866703224873693
321931.480810233139634.750.905922596637110.603542280496925
333033.02134710124634.16666666666670.9664784517437840.908503214845164
343331.154869502245533.6250.9265388699552571.05922446562074
353635.223502965166533.58333333333331.048838797970221.02204485555004
364037.777104139175134.08333333333331.108374693569931.05884241027675
373236.755714035914634.79166666666671.056451660912520.870612932964172
382531.653973078180235.95833333333330.8802958909343270.789790271769489
392832.466425852962837.33333333333330.8696364067757880.862429394809556
402933.332364694948438.250.8714343711097630.870025282196525
415545.484317053807839.1251.16253845504941.20920799876879
425548.242036162727940.45833333333331.192388123486581.1400845481413
434042.929692242107242.45833333333331.011101681855320.931756039023414
443840.389049100071244.58333333333330.905922596637110.940849087727916
454444.578818586682146.1250.9664784517437840.987015838350302
464143.701750032889647.16666666666670.9265388699552570.938177532230258
474950.387963919152648.04166666666671.048838797970220.972454455167516
485954.356542263825249.04166666666671.108374693569931.08542592193663
496153.394827695286750.54166666666671.056451660912521.14243275300212
504746.435608246785852.750.8802958909343271.01215428793814
514347.79376752238654.95833333333330.8696364067757880.899698898603449
523949.381281029553356.66666666666670.8714343711097630.789772950131845
536667.669425904333958.20833333333331.16253845504940.975329687195898
546871.294873216801859.79166666666671.192388123486580.953785271392763
556362.140624197358361.45833333333331.011101681855321.01382953283366
566857.337351012157163.29166666666670.905922596637111.18596340430136
576762.861369298835365.04166666666670.9664784517437841.06583742523155
585962.116710073250367.04166666666670.9265388699552570.949824933265542
596872.80689322576669.41666666666671.048838797970220.933977498382462
607879.8029779370349721.108374693569930.97740713462526
618279.18985574923474.95833333333331.056451660912521.03548616453684
627068.6630794928775780.8802958909343271.01947073328194
636270.4405489488389810.8696364067757880.880174855608106
646873.127867642294383.91666666666670.8714343711097630.929878064168679
6594101.23772379388587.08333333333331.16253845504940.928507640011534
66102107.71239382162190.33333333333331.192388123486580.946966234627732
6710094.453748779984793.41666666666671.011101681855321.05871922810533
6810487.270543476041796.33333333333330.905922596637111.191696486095
6910395.72163665812499.04166666666670.9664784517437841.07603676238708
709394.3911473766918101.8750.9265388699552570.98526188720707
71110109.603654387888104.51.048838797970221.00361617150747
72114118.827003606476107.2083333333331.108374693569930.95937789004205
73120116.4297767964110.2083333333331.056451660912521.03066417631156
7410299.4367566801234112.9583333333330.8802958909343271.02577762394365
7595100.587944383733115.6666666666670.8696364067757880.944447175872136
76103103.373902272896118.6250.8714343711097630.996383010946916
77122141.539056902265121.751.16253845504940.86195289604228
78139148.750418404951124.751.192388123486580.934451153082427
79135128.620559779346127.2083333333331.011101681855321.04959891506924
80135117.165989165066129.3333333333330.905922596637111.15221149893429
81137127.494615759201131.9166666666670.9664784517437841.07455518167726
82130124.773901153975134.6666666666670.9265388699552571.04188455115767
83148143.603512088756136.9166666666671.048838797970221.03061546230518
84148153.971717848423138.9166666666671.108374693569930.961215488585368
85145148.519495996618140.5833333333331.056451660912520.976302801372973
86128125.148732494497142.1666666666670.8802958909343271.02278303142725
87131124.973998623737143.7083333333330.8696364067757881.04821804089349
88133126.466913107304145.1250.8714343711097631.05165846727952
89146170.796274687675146.9166666666671.16253845504940.854819581205632
90163177.31805053015148.7083333333331.192388123486580.919252154603878
91151151.79163998853150.1251.011101681855320.994784693092518
92157137.398260489962151.6666666666670.905922596637111.14266366575631
93152148.636331891096153.7916666666670.9664784517437841.02263018782896
94149144.848910003005156.3333333333330.9265388699552571.0286580685827
95172166.45945756119158.7083333333331.048838797970221.03328463591066
96167177.801773760176160.4166666666671.108374693569930.939248222716013
97160171.057131429418161.9166666666671.056451660912520.935360009038965
98150143.965057163218163.5416666666670.8802958909343271.04191949738151
99160143.56247681857165.0833333333330.8696364067757881.11449735018297
100165145.239061851627166.6666666666670.8714343711097631.13605801288196
101171195.790851471237168.4166666666671.16253845504940.87338095071884
102179203.351857892941170.5416666666671.192388123486580.8802476744237
103171174.836332487483172.9166666666671.011101681855320.978057578577053
104176158.611947961214175.0833333333330.905922596637111.10962636965431
105170171.227765700607177.1666666666670.9664784517437840.992829634285167
106169166.159304011976179.3333333333330.9265388699552571.01709621982901
107194190.364241831595181.51.048838797970221.01909895542053
108196203.617667664576183.7083333333331.108374693569930.962588375792987
109188196.411971291318185.9166666666671.056451660912520.957171799478343
110174165.642343477476188.1666666666670.8802958909343271.0504560388791
111186165.774440041635190.6250.8696364067757881.12200650446043
112191168.00528479687192.7916666666670.8714343711097631.13686899927542
113197226.065290404815194.4583333333331.16253845504940.871429663736668
114206233.658389364891195.9583333333331.192388123486580.881628947969428
115197NANA1.01110168185532NA
116204NANA0.90592259663711NA
117201NANA0.966478451743784NA
118190NANA0.926538869955257NA
119213NANA1.04883879797022NA
120213NANA1.10837469356993NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5/16hwz1305664529.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5/16hwz1305664529.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5/25ens1305664529.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5/25ens1305664529.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5/3x4lr1305664529.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5/3x4lr1305664529.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5/4ohyr1305664529.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/17/t1305664351vb73b130d65vwu5/4ohyr1305664529.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