R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-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(11.73 + ,11.75 + ,11.39 + ,11.54 + ,9.62 + ,9.82 + ,9.94 + ,9.9 + ,9.8 + ,9.86 + ,10.5 + ,10.33 + ,10.16 + ,9.91 + ,9.96 + ,10.03 + ,9.55 + ,9.51 + ,9.8 + ,10.08 + ,10.2 + ,10.23 + ,10.2 + ,10.07 + ,10.01 + ,10.05 + ,9.92 + ,10.03 + ,10.18 + ,10.1 + ,10.16 + ,10.15 + ,10.13 + ,10.09 + ,10.18 + ,10.06 + ,9.65 + ,9.74 + ,9.53 + ,9.5 + ,9 + ,9.15 + ,9.32 + ,9.62 + ,9.59 + ,9.37 + ,9.35 + ,9.32 + ,9.49 + ,9.52 + ,9.59 + ,9.35 + ,9.2 + ,9.57 + ,9.78 + ,9.79 + ,9.57 + ,9.53 + ,9.65 + ,9.36 + ,9.4 + ,9.32 + ,9.31 + ,9.19 + ,9.39 + ,9.28 + ,9.28 + ,9.31 + ,9.28 + ,9.31 + ,9.35 + ,9.19 + ,9.07 + ,8.96 + ,8.69 + ,8.58 + ,8.56 + ,8.47 + ,8.46 + ,8.75 + ,8.95 + ,9.33 + ,9.51 + ,9.561 + ,9.94 + ,9.9 + ,9.275 + ,9.56 + ,9.779 + ,9.746 + ,9.991 + ,9.98 + ,10.195 + ,10.31 + ,10.25 + ,9.871 + ,10.06 + ,9.894 + ,9.59 + ,9.64 + ,9.89 + ,9.53 + ,9.388 + ,9.16 + ,9.418 + ,9.57 + ,9.857 + ,9.877 + ,9.76 + ,9.76 + ,9.695 + ,9.475 + ,9.262 + ,9.097 + ,8.55 + ,8.16 + ,7.532 + ,7.325 + ,6.749 + ,7.13 + ,6.995 + ,7.346 + ,7.73 + ,7.837 + ,7.514 + ,7.58 + ,6.83 + ,6.617 + ,6.715 + ,6.63 + ,6.891 + ,7.002 + ,7.09 + ,7.36 + ,7.477 + ,7.826 + ,7.79 + ,7.578 + ,7.204 + ,7.198 + ,7.685 + ,7.795 + ,7.46 + ,7.274 + ,7.33 + ,7.655 + ,7.767 + ,7.84 + ,7.424 + ,7.54 + ,7.351 + ,6.735 + ,6.777 + ,6.679 + ,7.34 + ,6.978 + ,6.92 + ,6.628 + ,6.385 + ,5.984 + ,6.268 + ,6.596 + ,6.395 + ,6.715 + ,6.804 + ,6.929 + ,6.846 + ,6.992 + ,6.774 + ,6.75 + ,6.485 + ,6.27 + ,6.47 + ,6.78 + ,6.71 + ,6.141 + ,6.72 + ,6.68 + ,6.371 + ,6.097 + ,6.27 + ,6.447 + ,6.37 + ,6.446 + ,6.54 + ,6.374 + ,6.33 + ,6.63 + ,6.498 + ,6.485 + ,6.36) > par2 = '5' > par1 = 'multiplicative' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > par2 <- as.numeric(par2) > x <- ts(x,freq=par2) > m <- decompose(x,type=par1) > m$figure [1] 1.0033809 0.9989555 0.9993687 0.9966212 1.0016736 > postscript(file="/var/wessaorg/rcomp/tmp/1qr0h1322232204.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/2po3n1322232204.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/33fvo1322232204.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/4g5hk1322232204.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,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="/var/wessaorg/rcomp/tmp/5dxkb1322232204.tab") > > try(system("convert tmp/1qr0h1322232204.ps tmp/1qr0h1322232204.png",intern=TRUE)) character(0) > try(system("convert tmp/2po3n1322232204.ps tmp/2po3n1322232204.png",intern=TRUE)) character(0) > try(system("convert tmp/33fvo1322232204.ps tmp/33fvo1322232204.png",intern=TRUE)) character(0) > try(system("convert tmp/4g5hk1322232204.ps tmp/4g5hk1322232204.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.120 0.207 2.330