R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(9.3,14.2,17.3,23,16.3,18.4,14.2,9.1,5.9,7.2,6.8,8,14.3,14.6,17.5,17.2,17.2,14.1,10.4,6.8,4.1,6.5,6.1,6.3,9.3,16.4,16.1,18,17.6,14,10.5,6.9,2.8,0.7,3.6,6.7,12.5,14.4,16.5,18.7,19.4,15.8,11.3,9.7,2.9,0.1,2.5,6.7,10.3,11.2,17.4,20.5,17,14.2,10.6,6.1) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = 'FALSE' > par7 = '1' > par6 = '' > par5 = '1' > par4 = '' > par3 = '0' > par2 = 'periodic' > par1 = '12' > ylab = '' > xlab = '' > main = '' > #'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!) > par1 <- as.numeric(par1) #seasonal period > if (par2 != 'periodic') par2 <- as.numeric(par2) #s.window > par3 <- as.numeric(par3) #s.degree > if (par4 == '') par4 <- NULL else par4 <- as.numeric(par4)#t.window > par5 <- as.numeric(par5)#t.degree > if (par6 != '') par6 <- as.numeric(par6)#l.window > par7 <- as.numeric(par7)#l.degree > if (par8 == 'FALSE') par8 <- FALSE else par9 <- TRUE #robust > nx <- length(x) > x <- ts(x,frequency=par1) > if (par6 != '') { + m <- stl(x,s.window=par2, s.degree=par3, t.window=par4, t.degre=par5, l.window=par6, l.degree=par7, robust=par8) + } else { + m <- stl(x,s.window=par2, s.degree=par3, t.window=par4, t.degre=par5, l.degree=par7, robust=par8) + } > m$time.series seasonal trend remainder Jan 1 0.02065002 11.30147 -2.02212449 Feb 1 3.05375084 11.52325 -0.37700562 Mar 1 5.86684861 11.74504 -0.31188371 Apr 1 8.42280576 11.93809 2.63910239 May 1 6.47876807 12.13115 -2.30991668 Jun 1 4.30685145 12.29836 1.79479151 Jul 1 0.43493691 12.46557 1.29949762 Aug 1 -3.24515996 12.60403 -0.25887130 Sep 1 -7.23486621 12.74250 0.39236914 Oct 1 -7.52797702 12.68326 2.04471900 Nov 1 -6.39608802 12.62402 0.57206907 Dec 1 -4.18052050 12.36247 -0.18194662 Jan 2 0.02065002 12.10092 2.17843469 Feb 2 3.05375084 11.83485 -0.28859689 Mar 2 5.86684861 11.56878 0.06437457 Apr 2 8.42280576 11.40263 -2.62544068 May 2 6.47876807 11.23649 -0.51526109 Jun 2 4.30685145 11.13368 -1.34052727 Jul 2 0.43493691 11.03086 -1.06579551 Aug 2 -3.24515996 11.00437 -0.95920683 Sep 2 -7.23486621 10.97787 0.35699123 Oct 2 -7.52797702 11.01035 3.01763149 Nov 2 -6.39608802 11.04282 1.45327194 Dec 2 -4.18052050 11.03447 -0.55394527 Jan 3 0.02065002 11.02612 -1.74676548 Feb 3 3.05375084 10.90792 2.43833394 Mar 3 5.86684861 10.78971 -0.55656359 Apr 3 8.42280576 10.59857 -1.02138034 May 3 6.47876807 10.40743 0.71379773 Jun 3 4.30685145 10.32889 -0.63573685 Jul 3 0.43493691 10.25034 -0.18527351 Aug 3 -3.24515996 10.27602 -0.13086290 Sep 3 -7.23486621 10.30171 -0.26684291 Oct 3 -7.52797702 10.39003 -2.16205745 Nov 3 -6.39608802 10.47836 -0.48227179 Dec 3 -4.18052050 10.61823 0.26228909 Jan 4 0.02065002 10.75810 1.72124697 Feb 4 3.05375084 10.88872 0.45752472 Mar 4 5.86684861 11.01935 -0.38619448 Apr 4 8.42280576 11.01817 -0.74097161 May 4 6.47876807 11.01699 1.90424609 Jun 4 4.30685145 10.89916 0.59398730 Jul 4 0.43493691 10.78134 0.08372644 Aug 4 -3.24515996 10.65324 2.29192398 Sep 4 -7.23486621 10.52514 -0.39026911 Oct 4 -7.52797702 10.44899 -2.82100996 Nov 4 -6.39608802 10.37284 -1.47675061 Dec 4 -4.18052050 10.33459 0.54593107 Jan 5 0.02065002 10.29634 -0.01699024 Feb 5 3.05375084 10.24539 -2.09913676 Mar 5 5.86684861 10.19443 1.33871976 Apr 5 8.42280576 10.16355 1.91364627 May 5 6.47876807 10.13266 0.38856761 Jun 5 4.30685145 10.11705 -0.22390521 Jul 5 0.43493691 10.10144 0.06361989 Aug 5 -3.24515996 10.08951 -0.74434645 > m$win s t l 561 19 13 > m$deg s t l 0 1 1 > m$jump s t l 57 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/yougetitorg/rcomp/tmp/1dn131293650411.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(m,main=main) > dev.off() null device 1 > mylagmax <- nx/2 > postscript(file="/var/yougetitorg/rcomp/tmp/2dn131293650411.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$time.series[,'trend']),na.action=na.pass,lag.max = mylagmax,main='Trend') > acf(as.numeric(m$time.series[,'seasonal']),na.action=na.pass,lag.max = mylagmax,main='Seasonal') > acf(as.numeric(m$time.series[,'remainder']),na.action=na.pass,lag.max = mylagmax,main='Remainder') > par(op) > dev.off() null device 1 > postscript(file="/var/yougetitorg/rcomp/tmp/35w0o1293650411.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$time.series[!is.na(m$time.series[,'trend']),'trend']),main='Trend') > spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'seasonal']),'seasonal']),main='Seasonal') > spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'remainder']),'remainder']),main='Remainder') > par(op) > dev.off() null device 1 > postscript(file="/var/yougetitorg/rcomp/tmp/45w0o1293650411.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$time.series[!is.na(m$time.series[,'trend']),'trend']),main='Trend') > cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'seasonal']),'seasonal']),main='Seasonal') > cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'remainder']),'remainder']),main='Remainder') > par(op) > dev.off() null device 1 > > #Note: the /var/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Seasonal Decomposition by Loess - Parameters',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Component',header=TRUE) > a<-table.element(a,'Window',header=TRUE) > a<-table.element(a,'Degree',header=TRUE) > a<-table.element(a,'Jump',header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Seasonal',header=TRUE) > a<-table.element(a,m$win['s']) > a<-table.element(a,m$deg['s']) > a<-table.element(a,m$jump['s']) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Trend',header=TRUE) > a<-table.element(a,m$win['t']) > a<-table.element(a,m$deg['t']) > a<-table.element(a,m$jump['t']) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Low-pass',header=TRUE) > a<-table.element(a,m$win['l']) > a<-table.element(a,m$deg['l']) > a<-table.element(a,m$jump['l']) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/yougetitorg/rcomp/tmp/5cxx01293650411.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Seasonal Decomposition by Loess - Time Series Components',6,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'t',header=TRUE) > a<-table.element(a,'Observed',header=TRUE) > a<-table.element(a,'Fitted',header=TRUE) > a<-table.element(a,'Seasonal',header=TRUE) > a<-table.element(a,'Trend',header=TRUE) > a<-table.element(a,'Remainder',header=TRUE) > a<-table.row.end(a) > for (i in 1:nx) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]+m$time.series[i,'remainder']) + a<-table.element(a,m$time.series[i,'seasonal']) + a<-table.element(a,m$time.series[i,'trend']) + a<-table.element(a,m$time.series[i,'remainder']) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/yougetitorg/rcomp/tmp/6n6wl1293650411.tab") > > try(system("convert tmp/1dn131293650411.ps tmp/1dn131293650411.png",intern=TRUE)) character(0) > try(system("convert tmp/2dn131293650411.ps tmp/2dn131293650411.png",intern=TRUE)) character(0) > try(system("convert tmp/35w0o1293650411.ps tmp/35w0o1293650411.png",intern=TRUE)) character(0) > try(system("convert tmp/45w0o1293650411.ps tmp/45w0o1293650411.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.260 0.860 1.607