R version 2.9.0 (2009-04-17) 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(1.3031,1.3241,1.2961,1.2865,1.2305,1.2101,1.2125,1.2350,1.2014,1.1992,1.1791,1.1832,1.2159,1.1922,1.2114,1.2614,1.2812,1.2786,1.2772,1.2815,1.2679,1.2765,1.3247,1.3191,1.3029,1.3234,1.3354,1.3651,1.3453,1.3534,1.3706,1.3638,1.4268,1.4485,1.4635,1.4587,1.4876,1.5189,1.5783,1.5633,1.5554,1.5757,1.5593,1.4660,1.4065,1.2759,1.2705,1.3954,1.2793,1.2694,1.3282,1.3230,1.4135,1.4042,1.4253,1.4322,1.4632,1.4713,1.5016,1.4318) > par8 = 'FALSE' > par7 = '1' > par6 = '' > par5 = '1' > par4 = '' > par3 = '0' > par2 = 'periodic' > par1 = '12' > main = 'Seasonal Decomposition by Loess' > #'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.018731086 1.295812 0.0260194305 Feb 1 -0.012941157 1.285391 0.0516502776 Mar 1 0.009288774 1.274970 0.0118411227 Apr 1 0.016243561 1.265506 0.0047507295 May 1 0.018538319 1.256041 -0.0440796348 Jun 1 0.015765304 1.247128 -0.0527929935 Jul 1 0.018352273 1.238214 -0.0440663359 Aug 1 0.003178343 1.229521 0.0023011189 Sep 1 -0.001255558 1.220827 -0.0181714550 Oct 1 -0.023880073 1.217527 0.0055530077 Nov 1 -0.014024569 1.214227 -0.0211025483 Dec 1 -0.010534103 1.217898 -0.0241642691 Jan 2 -0.018731086 1.221570 0.0130614589 Feb 2 -0.012941157 1.227209 -0.0220682346 Mar 2 0.009288774 1.232849 -0.0307379300 Apr 2 0.016243561 1.240809 0.0043475936 May 2 0.018538319 1.248769 0.0138931461 Jun 2 0.015765304 1.258824 0.0040104166 Jul 2 0.018352273 1.268880 -0.0100322968 Aug 2 0.003178343 1.278850 -0.0005284851 Sep 2 -0.001255558 1.288820 -0.0196647022 Oct 2 -0.023880073 1.297319 0.0030614241 Nov 2 -0.014024569 1.305817 0.0329075318 Dec 2 -0.010534103 1.312978 0.0166561243 Jan 3 -0.018731086 1.320139 0.0014921657 Feb 3 -0.012941157 1.328382 0.0079594615 Mar 3 0.009288774 1.336624 -0.0105132446 Apr 3 0.016243561 1.347548 0.0013083188 May 3 0.018538319 1.358472 -0.0317100889 Jun 3 0.015765304 1.372218 -0.0345831283 Jul 3 0.018352273 1.385964 -0.0337161515 Aug 3 0.003178343 1.403253 -0.0426315144 Sep 3 -0.001255558 1.420542 0.0075130941 Oct 3 -0.023880073 1.439625 0.0327547424 Nov 3 -0.014024569 1.458708 0.0188163721 Dec 3 -0.010534103 1.475711 -0.0064771520 Jan 4 -0.018731086 1.492714 0.0136167728 Feb 4 -0.012941157 1.499976 0.0318653315 Mar 4 0.009288774 1.507237 0.0617738883 Apr 4 0.016243561 1.500749 0.0463073403 May 4 0.018538319 1.494261 0.0426008211 Jun 4 0.015765304 1.478708 0.0812264029 Jul 4 0.018352273 1.463156 0.0777920008 Aug 4 0.003178343 1.442404 0.0204172381 Sep 4 -0.001255558 1.421653 -0.0138975533 Oct 4 -0.023880073 1.401444 -0.1016643482 Nov 4 -0.014024569 1.381236 -0.0967111617 Dec 4 -0.010534103 1.368532 0.0374020256 Jan 5 -0.018731086 1.355828 -0.0577973382 Feb 5 -0.012941157 1.355486 -0.0731451845 Mar 5 0.009288774 1.355144 -0.0362330328 Apr 5 0.016243561 1.369566 -0.0628095982 May 5 0.018538319 1.383988 0.0109738652 Jun 5 0.015765304 1.398180 -0.0097454618 Jul 5 0.018352273 1.412372 -0.0054247727 Aug 5 0.003178343 1.427417 0.0016042809 Sep 5 -0.001255558 1.442462 0.0219933057 Oct 5 -0.023880073 1.458414 0.0367658619 Nov 5 -0.014024569 1.474366 0.0412583993 Dec 5 -0.010534103 1.490796 -0.0484617503 > m$win s t l 601 19 13 > m$deg s t l 0 1 1 > m$jump s t l 61 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/www/html/rcomp/tmp/1wcxk1292181087.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/www/html/rcomp/tmp/2wcxk1292181087.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/www/html/rcomp/tmp/3olwn1292181087.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/www/html/rcomp/tmp/4zddq1292181087.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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/5owak1292181087.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/www/html/rcomp/tmp/69e981292181087.tab") > > try(system("convert tmp/1wcxk1292181087.ps tmp/1wcxk1292181087.png",intern=TRUE)) character(0) > try(system("convert tmp/2wcxk1292181087.ps tmp/2wcxk1292181087.png",intern=TRUE)) character(0) > try(system("convert tmp/3olwn1292181087.ps tmp/3olwn1292181087.png",intern=TRUE)) character(0) > try(system("convert tmp/4zddq1292181087.ps tmp/4zddq1292181087.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.957 0.618 2.282