Home » date » 2009 » Jun » 07 »

Opdracht 9 oefening 2

*Unverified author*
R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Sun, 07 Jun 2009 10:21:02 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql.htm/, Retrieved Sun, 07 Jun 2009 18:22: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/2009/Jun/07/t1244391718nvui0j5lmw3uuql.htm/},
    year = {2009},
}
@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 = {2009},
    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:
Thomas Cammaert
 
Dataseries X:
» Textbox « » Textfile « » CSV «
8,9722 8,8284 8,7446 8,7519 8,6337 8,7272 8,6330 8,5865 8,5968 8,5114 8,3884 8,2671 8,2410 8,3177 8,4070 8,3917 8,4145 8,5245 8,6289 8,6622 8,9055 8,9770 9,1264 9,1120 9,0576 9,2106 9,2637 9,3107 9,6744 9,5780 9,4166 9,4359 9,2275 9,1828 9,0594 9,1358 9,2208 9,1137 9,2689 9,2489 9,1679 9,1051 9,0818 9,0961 9,1733 9,1455 9,2265 9,1541 9,1559 9,1182 9,1856 9,2378 9,0682 9,0105 8,9939 9,0228 9,1368 9,1763 9,2346 9,1653 9,1277 9,1430 9,1962 9,1861 9,0920 9,0620 8,9981 8,9819 9,0476 9,0852 9,0884 9,1670 9,1931 9,2628 9,4276 9,3398 9,3342 9,4223 9,5614 9,4316 9,3111 9,3414 9,4017 9,3346 9,3310 9,2349 9,2170 9,2098 9,2665 9,2533 9,1008 9,0377 9,0795 9,1896 9,2992 9,2372 9,2061 9,3290 9,1842 9,3231 9,2835 9,1735 9,2889 9,4319 9,4314 9,3642 9,4020 9,3699 9,3106 9,3739 9,4566 9,3984 9,5637 9,8506
 
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'George Udny Yule' @ 72.249.76.132


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
18.9722NANA-0.0314108072916666NA
28.8284NANA-0.0146425781250000NA
38.7446NANA0.0291449218750004NA
48.7519NANA0.0325688802083339NA
58.6337NANA0.0295105468749996NA
68.7272NANA-0.00301236979166623NA
78.6338.5846230468758.6063-0.02167695312499990.0483769531249987
88.58658.525517838541678.55455416666667-0.02903632812499990.0609821614583321
98.59688.5057792968758.51920833333333-0.01342903645833450.0910207031250021
108.51148.484656901041678.49013333333333-0.005476432291666760.0267430989583346
118.38848.496311588541678.465991666666670.0303199218750003-0.107911588541665
128.26718.4455527343758.4484125-0.00285976562500027-0.178452734375
138.2418.408385026041678.43979583333333-0.0314108072916666-0.167385026041666
148.31778.428136588541678.44277916666667-0.0146425781250000-0.110436588541665
158.4078.487940755208338.458795833333330.0291449218750004-0.0809407552083332
168.39178.523627213541678.491058333333330.0325688802083339-0.131927213541665
178.41458.570718880208338.541208333333330.0295105468749996-0.156218880208332
188.52458.604150130208348.6071625-0.00301236979166623-0.0796501302083357
198.62898.654714713541678.67639166666667-0.0216769531249999-0.0258147135416671
208.66228.718584505208338.74762083333333-0.0290363281249999-0.0563845052083334
218.90558.8070917968758.82052083333333-0.01342903645833450.0984082031250022
228.9778.889031901041678.89450833333333-0.005476432291666760.0879680989583331
239.12649.015615755208338.985295833333330.03031992187500030.110784244791668
249.1129.0788277343759.0816875-0.002859765625000270.0331722656250015
259.05769.1269933593759.15840416666667-0.0314108072916666-0.0693933593749989
269.21069.2088199218759.2234625-0.01464257812500000.00178007812499992
279.26379.298261588541679.269116666666670.0291449218750004-0.0345615885416688
289.31079.323677213541679.291108333333330.0325688802083339-0.0129772135416673
299.67449.326402213541679.296891666666670.02951054687499960.347997786458333
309.5789.2920792968759.29509166666667-0.003012369791666230.285920703124999
319.41669.281206380208339.30288333333333-0.02167695312499990.135393619791669
329.43599.276609505208339.30564583333333-0.02903632812499990.159290494791668
339.22759.288395963541679.301825-0.0134290364583345-0.0608959635416664
349.18289.2939902343759.29946666666667-0.00547643229166676-0.111190234375
359.05949.3061074218759.27578750.0303199218750003-0.246707421875000
369.13589.232119401041669.23497916666667-0.00285976562500027-0.096319401041665
379.22089.169914192708339.201325-0.03141080729166660.0508858072916674
389.11379.158574088541679.17321666666667-0.0146425781250000-0.0448740885416665
399.26899.1859449218759.15680.02914492187500040.0829550781250017
409.24899.185556380208349.15298750.03256888020833390.0633436197916648
419.16799.187906380208339.158395833333330.0295105468749996-0.0200063802083328
429.10519.163108463541679.16612083333333-0.00301236979166623-0.0580084635416664
439.08189.142502213541679.16417916666667-0.0216769531249999-0.0607022135416670
449.09619.1326261718759.1616625-0.0290363281249999-0.0365261718749981
459.17339.144950130208339.15837916666667-0.01342903645833450.0283498697916684
469.14559.148969401041679.15444583333333-0.00547643229166676-0.00346940104166649
479.22659.180149088541679.149829166666670.03031992187500030.0463509114583331
489.15419.138873567708339.14173333333333-0.002859765625000270.0152264322916675
499.15599.1027183593759.13412916666667-0.03141080729166660.0531816406250023
509.11829.1127699218759.1274125-0.01464257812500000.00543007812500029
519.18569.1519824218759.12283750.02914492187500040.0336175781250017
529.23789.155168880208339.12260.03256888020833390.0826311197916656
539.06829.153731380208339.124220833333330.0295105468749996-0.0855313802083337
549.01059.122012630208339.125025-0.00301236979166623-0.111512630208333
558.99399.102639713541669.12431666666667-0.0216769531249999-0.108739713541665
569.02289.0951386718759.124175-0.0290363281249999-0.0723386718750003
579.13689.112220963541669.12565-0.01342903645833450.0245790364583343
589.17639.118461067708339.1239375-0.005476432291666760.0578389322916664
599.23469.1530949218759.1227750.03031992187500030.0815050781249997
609.16539.1230527343759.1259125-0.002859765625000270.042247265624999
619.12779.096822526041669.12823333333333-0.03141080729166660.0308774739583360
629.1439.112061588541669.12670416666666-0.01464257812500000.0309384114583366
639.19629.150428255208339.121283333333330.02914492187500040.0457717447916668
649.18619.146339713541679.113770833333330.03256888020833390.039760286458332
659.0929.133393880208339.103883333333330.0295105468749996-0.0413938802083322
669.0629.094850130208339.0978625-0.00301236979166623-0.0328501302083346
678.99819.078981380208339.10065833333333-0.0216769531249999-0.0808813802083321
688.98199.0793386718759.108375-0.0290363281249999-0.0974386718749987
699.04769.1095792968759.12300833333333-0.0134290364583345-0.0619792968749984
709.08529.1335777343759.13905416666667-0.00547643229166676-0.0483777343750003
719.08849.1858699218759.155550.0303199218750003-0.0974699218749997
729.1679.177794401041679.18065416666667-0.00285976562500027-0.0107944010416681
739.19319.187726692708339.2191375-0.03141080729166660.00537330729166818
749.26289.246703255208339.26134583333333-0.01464257812500000.0160967447916676
759.42769.3202074218759.29106250.02914492187500040.107392578125001
769.33989.3452855468759.312716666666670.0325688802083339-0.00548554687500058
779.33429.365956380208339.336445833333330.0295105468749996-0.0317563802083320
789.42239.353470963541679.35648333333333-0.003012369791666230.0688290364583324
799.56149.3475355468759.3692125-0.02167695312499990.213864453125000
809.43169.344759505208339.37379583333333-0.02903632812499990.0868404947916677
819.31119.3504292968759.36385833333333-0.0134290364583345-0.0393292968749996
829.34149.3441902343759.34966666666667-0.00547643229166676-0.00279023437499859
839.40179.371749088541679.341429166666670.03031992187500030.0299509114583323
849.33469.328706901041679.33156666666667-0.002859765625000270.00589309895833345
859.3319.273922526041679.30533333333334-0.03141080729166660.0570774739583317
869.23499.255086588541679.26972916666667-0.0146425781250000-0.0201865885416677
879.2179.272811588541679.243666666666670.0291449218750004-0.0558115885416655
889.20989.2602605468759.227691666666660.0325688802083339-0.0504605468749979
899.26659.246606380208339.217095833333330.02951054687499960.0198936197916701
909.25339.2057542968759.20876666666666-0.003012369791666230.0475457031250013
919.10089.177827213541669.19950416666667-0.0216769531249999-0.0770272135416654
929.03779.169184505208339.19822083333333-0.0290363281249999-0.131484505208332
939.07959.187345963541669.200775-0.0134290364583345-0.107845963541665
949.18969.1986527343759.20412916666666-0.00547643229166676-0.00905273437499687
959.29929.239878255208339.209558333333330.03031992187500030.0593217447916707
969.23729.204081901041669.20694166666667-0.002859765625000270.0331180989583348
979.20619.1800433593759.21145416666667-0.03141080729166660.0260566406250007
989.3299.221074088541679.23571666666667-0.01464257812500000.107925911458334
999.18429.295949088541679.266804166666670.0291449218750004-0.111749088541666
1009.32319.3213105468759.288741666666660.03256888020833390.00178945312500112
1019.28359.3298105468759.30030.0295105468749996-0.0463105468749987
1029.17359.307100130208339.3101125-0.00301236979166623-0.133600130208333
1039.28899.298318880208339.31999583333333-0.0216769531249999-0.00941888020833304
1049.43199.297184505208339.32622083333333-0.02903632812499990.134715494791667
1059.43149.326012630208339.33944166666667-0.01342903645833450.105387369791666
1069.36429.3484527343759.35392916666667-0.005476432291666760.0157472656250004
1079.4029.399061588541679.368741666666670.03031992187500030.00293841145833262
1089.36999.405769401041679.40862916666667-0.00285976562500027-0.0358694010416656
1099.3106NANANANA
1109.3739NANANANA
1119.4566NANANANA
1129.3984NANANANA
1139.5637NANANANA
1149.8506NANANANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql/1agkq1244391659.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql/1agkq1244391659.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql/2p56g1244391659.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql/2p56g1244391659.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql/3s2zv1244391659.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql/3s2zv1244391659.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql/4ytcs1244391659.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/07/t1244391718nvui0j5lmw3uuql/4ytcs1244391659.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