R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 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. Natural language support but running in an English locale 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. > source('/home/pw/wessanet/cretab') > > > > myrfcuid = 'r0614471' > > x <- c(9916,9474,9172,7766,6660,6458,5890,5732,4770,4614,4872,5256,6442,6128,5630,5112,4448,4266,4492,4236,3988,4084,4354,5062,6472,6454,6020,5520,4662,4612,4836,4514,4256,4228,4370,5510,6304,6288,6156,5602,4808,4774,4960,4762,4490,4202,4450,5420,6004,6094,5896,4980,4212,4212,4084,4068,3564,3250,3524,4362,5322,5416,5126,4284,3722,3756,3726,3844,3234,3160,3510,3898,5230,5154,4972,4416,3856,3710,4050,4020,3486,3638,3922,4442,6034,5786,5452,5000,4468,4250,4698,4388,4186,4368,4812,5850,7772,7940,7894,7510,6324,6152,6326,5772,5366,5354,5468,6876,8096,8100,7916,6970,6124,6008,5956,5910) > par2 = '12' > par1 = 'additive' > par2 <- '12' > par1 <- 'additive' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Tue, 16 Aug 2016 15:23:07 +0200) > #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] 1349.5779 1313.3372 1008.2631 411.0548 -336.4035 -443.9452 -323.1721 [8] -500.1628 -931.9869 -971.5980 -700.5424 125.5779 > postscript(file="/home/pw/wessanet/rcomp/tmp/1izvc1482481364.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="/home/pw/wessanet/rcomp/tmp/2xz051482481364.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="/home/pw/wessanet/rcomp/tmp/3p9bi1482481364.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="/home/pw/wessanet/rcomp/tmp/4lju31482481364.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 > > 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="/home/pw/wessanet/rcomp/tmp/52ka31482481364.tab") > > try(system("convert /home/pw/wessanet/rcomp/tmp/1izvc1482481364.ps /home/pw/wessanet/rcomp/tmp/1izvc1482481364.png",intern=TRUE)) character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/2xz051482481364.ps /home/pw/wessanet/rcomp/tmp/2xz051482481364.png",intern=TRUE)) character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/3p9bi1482481364.ps /home/pw/wessanet/rcomp/tmp/3p9bi1482481364.png",intern=TRUE)) character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/4lju31482481364.ps /home/pw/wessanet/rcomp/tmp/4lju31482481364.png",intern=TRUE)) character(0) > > proc.time() user system elapsed 1.764 0.128 1.898