Home » date » 2008 » May » 19 » attachments

Opdracht 9 - Oefening 1 Eigen reeks - Decomposition - Katrien De Soomer

R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Mon, 19 May 2008 12:59:11 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl.htm/, Retrieved Mon, 19 May 2008 20:59:48 +0200
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
464 675 703 887 1139 1077 1318 1260 1120 963 996 960 530 883 894 1045 1199 1287 1565 1577 1076 918 1008 1063 544 635 804 980 1018 1064 1404 1286 1104 999 996 1015 615 722 832 977 1270 1437 1520 1708 1151 934 1159 1209 699 830 996 1124 1458 1270 1753 2258 1208 1241 1265 1828 809 997 1164 1205 1538 1513 1378 2083 1357 1536 1526 1376 779 1005 1193 1522 1539 1546 2116 2326 1596 1356 1553 1613 814 1150 1225 1691 1759 1754 2100 2062 2012 1897 1964 2186 966 1549 1538 1612 2078 2137 2907 2249 1883 1739 1828 1868 1138 1430 1809 1763 2200 2067 2503 2141 2103 1972 2181 2344 970 1199 1718 1683 2025 2051 2439 2353 2230 1852 2147 2286 1007 1665 1642 1518 1831 2207 2822 2393 2306 1785 2047 2171 1212 1335 2011 1860 1954 2152 2835 2224 2182 1992 2389 2724 891 1247 2017 2257 2255 2255 3057 3330 1896 2096 2374 2535 1041 1728 2201 2455 2204 2660 3670 2665 2639 2226 2586 2684 1185 1749 2459 2618 2585 3310 3923
 
Text written by user:
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1464NANA-732.01014957265NA
2675NANA-461.680021367521NA
3703NANA-224.955662393162NA
4887NANA-123.843482905983NA
51139NANA90.1853632478632NA
61077NANA128.105235042735NA
713181522.97702991453966.25556.72702991453-204.97702991453
812601498.58600427350977.666666666667520.919337606838-238.586004273504
911201055.54433760684994.29166666666761.25267094017164.4556623931626
10963923.9161324786331008.83333333333-84.917200854700839.0838675213673
119961088.336004273501017.9166666666770.4193376068376-92.3360042735045
129601228.964209401711029.16666666667199.797542735043-268.964209401709
13530316.1981837606841048.20833333333-732.01014957265213.801816239316
14883610.0283119658121071.70833333333-461.680021367521272.971688034188
15894858.1276709401711083.08333333333-224.95566239316235.8723290598291
161045955.5315170940171079.375-123.84348290598389.4684829059829
1711991168.18536324786107890.185363247863230.8146367521367
1812871210.896901709401082.79166666667128.10523504273576.1030982905982
1915651644.393696581201087.66666666667556.72702991453-79.3936965811964
2015771598.836004273501077.91666666667520.919337606838-21.8360042735042
2110761125.086004273501063.8333333333361.252670940171-49.0860042735042
22918972.4577991452991057.375-84.9172008547008-54.457799145299
2310081117.544337606841047.12570.4193376068376-109.544337606837
2410631230.089209401711030.29166666667199.797542735043-167.089209401709
25544282.2815170940171014.29166666667-732.01014957265261.718482905983
26635533.778311965812995.458333333333-461.680021367521101.221688034188
27804759.544337606838984.5-224.95566239316244.4556623931624
28980865.198183760684989.041666666667-123.843482905983114.801816239316
2910181082.10202991453991.91666666666790.1853632478632-64.1020299145299
3010641117.52190170940989.416666666667128.105235042735-53.5219017094015
3114041547.10202991453990.375556.72702991453-143.102029914530
3212861517.87767094017996.958333333333520.919337606838-231.877670940171
3311041063.002670940171001.7561.25267094017140.9973290598292
34999917.8744658119661002.79166666667-84.917200854700881.125534188034
359961083.586004273501013.1666666666770.4193376068376-87.5860042735042
3610151239.005876068381039.20833333333199.797542735043-224.005876068376
37615327.5731837606841059.58333333333-732.01014957265287.426816239316
38722620.3199786324781082-461.680021367521101.680021367522
39832876.5860042735041101.54166666667-224.955662393162-44.5860042735042
40977976.9481837606841100.79166666667-123.8434829059830.0518162393163948
4112701195.060363247861104.87590.185363247863274.9396367521367
4214371247.855235042741119.75128.105235042735189.144764957265
4315201688.060363247861131.33333333333556.72702991453-168.060363247863
4417081660.252670940171139.33333333333520.91933760683847.7473290598293
4511511211.919337606841150.6666666666761.252670940171-60.9193376068376
469341078.70779914531163.625-84.9172008547008-144.707799145299
4711591248.002670940171177.5833333333370.4193376068376-89.0026709401709
4812091378.255876068381178.45833333333199.797542735043-169.255876068376
49699449.1981837606841181.20833333333-732.01014957265249.801816239316
50830752.1533119658121213.83333333333-461.68002136752177.846688034188
519961014.169337606841239.125-224.955662393162-18.1693376068374
5211241130.448183760681254.29166666667-123.843482905983-6.4481837606836
5314581361.685363247861271.590.185363247863296.3146367521367
5412701429.813568376071301.70833333333128.105235042735-159.813568376068
5517531888.810363247861332.08333333333556.72702991453-135.810363247863
5622581864.544337606841343.625520.919337606838393.455662393163
5712081418.836004273501357.5833333333361.252670940171-210.836004273504
5812411283.041132478631367.95833333333-84.9172008547008-42.0411324786323
5912651445.086004273501374.6666666666770.4193376068376-180.086004273504
6018281587.922542735041388.125199.797542735043240.077457264958
61809650.614850427351382.625-732.01014957265158.385149572650
62997898.0283119658121359.70833333333-461.68002136752198.971688034188
6311641133.669337606841358.625-224.95566239316230.3306623931624
6412051253.281517094021377.125-123.843482905983-48.2815170940169
6515381490.477029914531400.2916666666790.185363247863247.5229700854702
6615131520.438568376071392.33333333333128.105235042735-7.43856837606859
6713781928.977029914531372.25556.72702991453-550.97702991453
6820831892.252670940171371.33333333333520.919337606838190.747329059829
6913571434.127670940171372.87561.252670940171-77.1276709401711
7015361302.374465811971387.29166666667-84.9172008547008233.625534188034
7115261470.961004273501400.5416666666770.419337606837655.0389957264961
7213761601.755876068381401.95833333333199.797542735043-225.755876068376
73779702.0731837606841434.08333333333-732.0101495726576.9268162393164
7410051013.278311965811474.95833333333-461.680021367521-8.27831196581178
7511931270.086004273501495.04166666667-224.955662393162-77.0860042735046
7615221373.656517094021497.5-123.843482905983148.343482905983
7715391581.310363247861491.12590.1853632478632-42.3103632478633
7815461630.230235042731502.125128.105235042735-84.2302350427349
7921162070.185363247861513.45833333333556.7270299145345.8146367521372
8023262041.877670940171520.95833333333520.919337606838284.122329059830
8115961589.586004273501528.3333333333361.2526709401716.41399572649607
8213561451.791132478631536.70833333333-84.9172008547008-95.7911324786326
8315531623.336004273501552.9166666666770.4193376068376-70.336004273504
8416131770.547542735041570.75199.797542735043-157.547542735042
85814846.739850427351578.75-732.01014957265-32.7398504273503
8611501105.403311965811567.08333333333-461.68002136752144.596688034188
8712251348.461004273501573.41666666667-224.955662393162-123.461004273504
8816911489.448183760681613.29166666667-123.843482905983201.551816239316
8917591743.143696581201652.9583333333390.185363247863215.8563034188037
9017541822.063568376071693.95833333333128.105235042735-68.0635683760681
9121002280.893696581201724.16666666667556.72702991453-180.893696581196
9220622268.044337606841747.125520.919337606838-206.044337606837
9320121838.044337606841776.7916666666761.252670940171173.955662393162
9418971701.624465811971786.54166666667-84.9172008547008195.375534188034
9519641866.961004273501796.5416666666770.419337606837697.0389957264958
9621862025.589209401711825.79166666667199.797542735043160.410790598291
979661143.364850427351875.375-732.01014957265-177.364850427350
9815491455.111645299151916.79166666667-461.68002136752193.8883547008547
9915381694.252670940171919.20833333333-224.955662393162-156.252670940171
10016121783.406517094021907.25-123.843482905983-171.406517094017
10120781985.18536324786189590.185363247863292.8146367521367
10221372004.188568376071876.08333333333128.105235042735132.811431623932
10329072426.727029914531870556.72702991453480.27297008547
10422492393.127670940171872.20833333333520.919337606838-144.127670940171
10518831939.794337606841878.5416666666761.252670940171-56.7943376068374
10617391811.20779914531896.125-84.9172008547008-72.2077991452993
10718281977.919337606841907.570.4193376068376-149.919337606838
10818682109.464209401711909.66666666667199.797542735043-241.464209401710
10911381157.906517094021889.91666666667-732.01014957265-19.9065170940171
11014301406.903311965811868.58333333333-461.68002136752123.0966880341882
11118091648.294337606841873.25-224.955662393162160.705662393162
11217631768.281517094021892.125-123.843482905983-5.28151709401686
11322002006.727029914531916.5416666666790.1853632478632193.27297008547
11420672079.188568376071951.08333333333128.105235042735-12.1885683760684
11525032520.643696581201963.91666666667556.72702991453-17.6436965811965
11621412468.211004273501947.29166666667520.919337606838-327.211004273504
11721031995.127670940171933.87561.252670940171107.872329059829
11819721841.83279914531926.75-84.9172008547008130.167200854701
11921811986.544337606841916.12570.4193376068376194.455662393162
12023442107.964209401711908.16666666667199.797542735043236.035790598291
1219701172.823183760681904.83333333333-732.01014957265-202.823183760684
12211991449.319978632481911-461.680021367521-250.319978632478
12317181700.169337606841925.125-224.95566239316217.8306623931626
12416831801.573183760681925.41666666667-123.843482905983-118.573183760684
12520252009.18536324786191990.185363247863215.8146367521367
12620512043.27190170941915.16666666667128.1052350427357.72809829059815
12724392471.018696581201914.29166666667556.72702991453-32.0186965811965
12823532456.169337606841935.25520.919337606838-103.169337606837
12922302012.752670940171951.561.252670940171217.247329059829
13018521856.541132478631941.45833333333-84.9172008547008-4.54113247863256
13121471996.919337606841926.570.4193376068376150.080662393162
13222862124.714209401711924.91666666667199.797542735043161.285790598291
13310071215.364850427351947.375-732.01014957265-208.36485042735
13416651503.319978632481965-461.680021367521161.680021367521
13516421744.877670940171969.83333333333-224.955662393162-102.877670940171
13615181846.364850427351970.20833333333-123.843482905983-328.364850427350
13718312053.435363247861963.2590.1853632478632-222.435363247863
13822072082.39690170941954.29166666667128.105235042735124.603098290599
13928222514.768696581201958.04166666667556.72702991453307.231303418804
14023932473.752670940171952.83333333333520.919337606838-80.7526709401707
14123062015.711004273501954.4583333333361.252670940171290.288995726496
14217851899.166132478631984.08333333333-84.9172008547008-114.166132478633
14320472073.877670940172003.4583333333370.4193376068376-26.8776709401714
14421712206.089209401712006.29166666667199.797542735043-35.0892094017095
14512121272.531517094022004.54166666667-732.01014957265-60.5315170940171
14613351536.361645299151998.04166666667-461.680021367521-201.361645299145
14720111760.877670940171985.83333333333-224.955662393162250.122329059830
14818601865.448183760681989.29166666667-123.843482905983-5.4481837606836
14919542102.352029914532012.1666666666790.1853632478632-148.352029914530
15021522177.563568376072049.45833333333128.105235042735-25.5635683760681
15128352615.852029914532059.125556.72702991453219.147970085471
15222242563.002670940172042.08333333333520.919337606838-339.002670940170
15321822099.919337606842038.6666666666761.25267094017182.0806623931626
15419921970.541132478632055.45833333333-84.917200854700821.4588675213677
15523892154.961004273502084.5416666666770.4193376068376234.038995726496
15627242301.172542735042101.375199.797542735043422.827457264958
1578911382.906517094022114.91666666667-732.01014957265-491.906517094016
15812471708.569978632482170.25-461.680021367521-461.569978632478
15920171979.461004273502204.41666666667-224.95566239316237.5389957264961
16022572072.989850427352196.83333333333-123.843482905983184.01014957265
16122552290.727029914532200.5416666666790.1853632478632-35.7270299145298
16222552320.14690170942192.04166666667128.105235042735-65.1469017094018
16330572747.143696581202190.41666666667556.72702991453309.856303418804
16433302737.627670940172216.70833333333520.919337606838592.372329059829
16518962305.669337606842244.4166666666761.252670940171-409.669337606837
16620962175.416132478632260.33333333333-84.9172008547008-79.4161324786323
16723742336.877670940172266.4583333333370.419337606837637.1223290598286
16825352481.005876068382281.20833333333199.79754273504353.9941239316236
16910411591.614850427352323.625-732.01014957265-550.61485042735
17017281859.778311965812321.45833333333-461.680021367521-131.778311965812
17122012099.752670940172324.70833333333-224.955662393162101.247329059830
17224552237.239850427352361.08333333333-123.843482905983217.760149572649
17322042465.518696581202375.3333333333390.1853632478632-261.518696581197
17426602518.480235042732390.375128.105235042735141.519764957265
17536702959.310363247862402.58333333333556.72702991453710.689636752137
17626652930.377670940172409.45833333333520.919337606838-265.377670940170
17726392482.336004273502421.0833333333361.252670940171156.663995726496
17822262353.70779914532438.625-84.9172008547008-127.707799145299
17925862531.711004273502461.2916666666770.419337606837654.2889957264956
18026842704.047542735042504.25199.797542735043-20.0475427350434
1811185NA2541.875NANA
1821749NANANANA
1832459NANANANA
1842618NANANANA
1852585NANANANA
1863310NANANANA
1873923NANANANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl/1fj721211223544.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl/1fj721211223544.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl/2s4yx1211223544.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl/2s4yx1211223544.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl/3jexw1211223544.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl/3jexw1211223544.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl/4e0g01211223544.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/19/t1211223587woxxmdsa0rh7frl/4e0g01211223544.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