Home » date » 2010 » Jan » 15 »

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Fri, 15 Jan 2010 07:34:06 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo.htm/, Retrieved Fri, 15 Jan 2010 15:40:44 +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/2010/Jan/15/t1263566434wmzp2e40dhe6cpo.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:
KDGP2W52
 
Dataseries X:
» Textbox « » Textfile « » CSV «
6550 8728 12026 14395 14587 13791 9498 8251 7049 9545 9364 8456 7237 9374 11837 13784 15926 13821 11143 7975 7610 1015 12759 8816 10677 10947 15200 17010 20900 16205 12143 8997 5568 11474 12256 10583 10862 10965 14405 20379 20128 17816 12268 8642 7962 13932 15936 12628 12267 12470 18944 21259 22015 18581 15175 10306 10792 14752 13754 11738 12181 12965 19990 23125 23541 21247 15189 14767 10895 17130 17697 16611 12674 12760 20249 22135 20677 19933 15388 15113 13401 16135 17562 14720 12225 11608 20985 19692 24081 22114 14220 13434 13598 17187 16119 13713 13210 14251 20139 21725 26099 21084 18024 16722 14385 21342 17180 14577
 
Output produced by software:


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


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
16550NANA-3153.89409722222NA
28728NANA-2741.54513888889NA
312026NANA2977.25173611111NA
414395NANA5047.60069444444NA
514587NANA6727.69965277778NA
613791NANA3834.36111111111NA
794989266.1475694444410215.2916666667-949.144097222223231.852430555557
882517065.8611111111110270.8333333333-3204.972222222221185.13888888889
970495687.6319444444510289.875-4602.243055555561361.36805555555
1095458610.7413194444510256.5416666667-1645.80034722222934.258680555555
11936410327.564236111110286.87540.6892361111112-963.56423611111
1284568013.9131944444410343.9166666667-2330.00347222222442.086805555557
1372377259.8142361111110413.7083333333-3153.89409722222-22.8142361111113
1493747729.2048611111110470.75-2741.545138888891644.79513888889
151183713459.876736111110482.6252977.25173611111-1622.87673611111
161378415198.184027777810150.58333333335047.60069444444-1414.18402777778
171592616664.32465277789936.6256727.69965277778-738.324652777777
181382113927.444444444410093.08333333333834.36111111111-106.444444444443
19111439302.2725694444410251.4166666667-949.1440972222231840.72743055556
2079757255.3194444444410460.2916666667-3204.97222222222719.680555555557
2176106063.7152777777810665.9583333333-4602.243055555561546.28472222222
2210159294.6996527777810940.5-1645.80034722222-8279.69965277778
231275911322.855902777811282.166666666740.68923611111121436.14409722222
2488169258.7465277777811588.75-2330.00347222222-442.746527777777
25106778575.8559027777811729.75-3153.894097222222101.14409722222
26109479072.4548611111111814-2741.545138888891874.54513888889
271520014748.751736111111771.52977.25173611111451.248263888889
281701017169.809027777812122.20833333335047.60069444444-159.809027777777
292090019264.741319444412537.04166666676727.699652777781635.25868055556
301620516424.069444444412589.70833333333834.36111111111-219.069444444443
311214311721.897569444412671.0416666667-949.144097222223421.102430555557
3289979474.5277777777812679.5-3204.97222222222-477.527777777776
3355688044.8819444444412647.125-4602.24305555556-2476.88194444444
341147411108.574652777812754.375-1645.80034722222365.425347222224
351225612903.272569444412862.583333333340.6892361111112-647.272569444443
361058310567.538194444412897.5416666667-2330.0034722222215.4618055555566
37108629815.9809027777812969.875-3153.894097222221046.01909722222
381096510218.746527777812960.2916666667-2741.54513888889746.253472222224
391440516022.501736111113045.252977.25173611111-1617.50173611111
402037918295.017361111113247.41666666675047.600694444442083.98263888889
412012820230.866319444413503.16666666676727.69965277778-102.866319444442
421781617576.069444444413741.70833333333834.36111111111239.930555555557
431226812936.314236111113885.4583333333-949.144097222223-668.314236111111
44864210801.736111111114006.7083333333-3204.97222222222-2159.73611111111
4579629656.2986111111114258.5416666667-4602.24305555556-1694.29861111111
461393212838.532986111114484.3333333333-1645.800347222221093.46701388889
471593614640.314236111114599.62540.68923611111121295.68576388889
481262812380.121527777814710.125-2330.00347222222247.878472222223
491226711709.230902777814863.125-3153.89409722222557.769097222223
501247012312.038194444415053.5833333333-2741.54513888889157.961805555555
511894418218.085069444415240.83333333332977.25173611111725.914930555557
522125920440.517361111115392.91666666675047.60069444444818.48263888889
532201522063.866319444415336.16666666676727.69965277778-48.8663194444434
541858119042.527777777815208.16666666673834.36111111111-461.527777777776
551517514218.355902777815167.5-949.144097222223956.644097222224
561030611979.569444444415184.5416666667-3204.97222222222-1673.56944444444
571079210646.506944444415248.75-4602.24305555556145.493055555557
581475213724.282986111115370.0833333333-1645.800347222221027.71701388889
591375415552.105902777815511.416666666740.6892361111112-1798.10590277778
601173813356.079861111115686.0833333333-2330.00347222222-1618.07986111111
611218112643.855902777815797.75-3153.89409722222-462.855902777779
621296513242.663194444415984.2083333333-2741.54513888889-277.663194444443
631999019151.626736111116174.3752977.25173611111838.373263888887
642312521325.350694444416277.755047.600694444441799.64930555556
652354123268.824652777816541.1256727.69965277778272.175347222223
662124720742.819444444416908.45833333333834.36111111111504.180555555555
671518916182.897569444417132.0416666667-949.144097222223-993.897569444445
681476713939.069444444417144.0416666667-3204.97222222222827.930555555558
691089512544.048611111117146.2916666667-4602.24305555556-1649.04861111111
701713015470.032986111117115.8333333333-1645.800347222221659.96701388889
711769716995.939236111116955.2540.6892361111112701.06076388889
721661114451.163194444416781.1666666667-2330.003472222222159.83680555555
731267413580.814236111116734.7083333333-3153.89409722222-906.814236111111
741276014015.871527777816757.4166666667-2741.54513888889-1255.87152777778
752024919853.501736111116876.252977.25173611111395.498263888891
762213521986.809027777816939.20833333335047.60069444444148.190972222223
772067723619.824652777816892.1256727.69965277778-2942.82465277778
781993320642.069444444416807.70833333333834.36111111111-709.069444444443
791538815761.064236111116710.2083333333-949.144097222223-373.064236111113
801511313438.527777777816643.5-3204.972222222221674.47222222222
811340112023.923611111116626.1666666667-4602.243055555561377.07638888889
821613514909.241319444416555.0416666667-1645.800347222221225.75868055555
831756216635.772569444416595.083333333340.6892361111112926.227430555555
841472014497.788194444416827.7916666667-2330.00347222222222.211805555555
851222513716.105902777816870-3153.89409722222-1491.10590277778
861160814009.829861111116751.375-2741.54513888889-2401.82986111111
872098519666.876736111116689.6252977.251736111111318.12326388889
881969221789.267361111116741.66666666675047.60069444444-2097.26736111111
892408123453.074652777816725.3756727.69965277778627.925347222223
902211420457.652777777816623.29166666673834.361111111111656.34722222222
911422015673.230902777816622.375-949.144097222223-1453.23090277778
921343413568.569444444416773.5416666667-3204.97222222222-134.569444444445
931359812246.173611111116848.4166666667-4602.243055555561351.82638888889
941718715252.074652777816897.875-1645.800347222221934.92534722222
951611917107.355902777817066.666666666740.6892361111112-988.355902777776
961371314777.829861111117107.8333333333-2330.00347222222-1064.82986111111
971321014069.522569444417223.4166666667-3153.89409722222-859.522569444443
981425114777.371527777817518.9166666667-2741.54513888889-526.371527777781
992013920665.960069444417688.70833333332977.25173611111-526.960069444445
1002172522942.225694444417894.6255047.60069444444-1217.22569444445
1012609924839.657986111118111.95833333336727.699652777781259.34201388889
1022108422026.527777777818192.16666666673834.36111111111-942.527777777777
10318024NANA-949.144097222223NA
10416722NANA-3204.97222222222NA
10514385NANA-4602.24305555556NA
10621342NANA-1645.80034722222NA
10717180NANA40.6892361111112NA
10814577NANA-2330.00347222222NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo/1zcsg1263566034.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo/1zcsg1263566034.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo/29csk1263566034.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo/29csk1263566034.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo/3p7l01263566034.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo/3p7l01263566034.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo/44c3t1263566034.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/15/t1263566434wmzp2e40dhe6cpo/44c3t1263566034.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