R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(3221816.00 + ,3209817.00 + ,3197649.00 + ,3172468.00 + ,3421574.00 + ,3408392.00 + ,3221816.00 + ,3097770.00 + ,3109769.00 + ,3109769.00 + ,3123120.00 + ,3147118.00 + ,3184467.00 + ,3184467.00 + ,3160469.00 + ,3097770.00 + ,3421574.00 + ,3470922.00 + ,3396393.00 + ,3221816.00 + ,3296514.00 + ,3184467.00 + ,3234998.00 + ,3259165.00 + ,3284346.00 + ,3221816.00 + ,3234998.00 + ,3147118.00 + ,3421574.00 + ,3508271.00 + ,3433742.00 + ,3296514.00 + ,3445741.00 + ,3284346.00 + ,3433742.00 + ,3421574.00 + ,3458923.00 + ,3321695.00 + ,3470922.00 + ,3458923.00 + ,3682848.00 + ,3632317.00 + ,3433742.00 + ,3333694.00 + ,3470922.00 + ,3284346.00 + ,3421574.00 + ,3445741.00 + ,3496272.00 + ,3384394.00 + ,3445741.00 + ,3483090.00 + ,3620318.00 + ,3508271.00 + ,3359044.00 + ,3197649.00 + ,3347045.00 + ,2936375.00 + ,3135119.00 + ,3246997.00 + ,3359044.00 + ,3197649.00 + ,3197649.00 + ,3197649.00 + ,3284346.00 + ,3160469.00 + ,2997891.00 + ,2861846.00 + ,2960542.00 + ,2575222.00 + ,2811315.00 + ,2948543.00 + ,2973724.00 + ,2836496.00 + ,2848495.00 + ,2811315.00 + ,2936375.00 + ,2848495.00 + ,2675270.00 + ,2550041.00 + ,2761798.00 + ,2301949.00 + ,2600572.00 + ,2736617.00 + ,2736617.00 + ,2575222.00 + ,2425995.00 + ,2413996.00 + ,2550041.00 + ,2425995.00 + ,2190071.00 + ,2027493.00 + ,2202070.00 + ,1791569.00 + ,2164721.00 + ,2363296.00 + ,2425995.00 + ,2288767.00 + ,2115373.00 + ,2239419.00 + ,2288767.00 + ,2251418.00 + ,1878097.00 + ,1704872.00 + ,1828749.00 + ,1455597.00 + ,1840917.00 + ,1978145.00 + ,2090023.00 + ,1903447.00 + ,1728870.00 + ,1828749.00 + ,1878097.00 + ,1779401.00 + ,1406249.00 + ,1243671.00 + ,1392898.00 + ,982397.00 + ,1430247.00 + ,1704872.00) > par2 = '12' > par1 = 'additive' > par2 <- '12' > par1 <- 'additive' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 () > #Author: root > #To cite this work: Wessa P., (2013), Classical Decomposition (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_decompose.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par2 <- as.numeric(par2) > x <- ts(x,freq=par2) > m <- decompose(x,type=par1) > m$figure [1] 111798.129 7069.768 -8113.630 15185.680 189084.333 148223.106 [7] -16397.760 -148928.968 -10363.834 -275066.343 -56984.361 44493.879 > postscript(file="/var/wessaorg/rcomp/tmp/1w46n1439141047.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(m) > dev.off() null device 1 > mylagmax <- length(x)/2 > postscript(file="/var/wessaorg/rcomp/tmp/2u31b1439141047.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > 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() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3w7gg1439141047.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > 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() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4jxth1439141047.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > 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() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/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,signif(m$trend[i]+m$seasonal[i],6)) else a<-table.element(a,signif(m$trend[i]*m$seasonal[i],6)) + a<-table.element(a,signif(m$trend[i],6)) + a<-table.element(a,signif(m$seasonal[i],6)) + a<-table.element(a,signif(m$random[i],6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/5turk1439141047.tab") > > try(system("convert tmp/1w46n1439141047.ps tmp/1w46n1439141047.png",intern=TRUE)) character(0) > try(system("convert tmp/2u31b1439141047.ps tmp/2u31b1439141047.png",intern=TRUE)) character(0) > try(system("convert tmp/3w7gg1439141047.ps tmp/3w7gg1439141047.png",intern=TRUE)) character(0) > try(system("convert tmp/4jxth1439141047.ps tmp/4jxth1439141047.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.015 0.325 2.351