R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(1.4761,1.4721,1.487,1.5167,1.5812,1.554,1.5508,1.5764,1.5611,1.4735,1.4303,1.2757,1.2727,1.3917,1.2816,1.2644,1.3308,1.3275,1.4098,1.4134,1.4138,1.4272,1.4643,1.48,1.5023,1.4406,1.3966,1.357,1.3479,1.3315,1.2307,1.2271,1.3028,1.268,1.3648,1.3857,1.2998,1.3362,1.3692,1.3834,1.4207,1.486,1.4385,1.4453,1.426,1.445,1.3503,1.4001,1.3418,1.2939,1.3176,1.3443,1.3356,1.3214,1.2403,1.259,1.2284,1.2611,1.293,1.2993,1.2986) > par8 = 'FALSE' > par7 = '1' > par6 = '' > par5 = '1' > par4 = '' > par3 = '0' > par2 = 'periodic' > par1 = '12' > main = 'Seasonal Decomposition by Loess' > par8 <- 'FALSE' > par7 <- '1' > par6 <- '' > par5 <- '1' > par4 <- '' > par3 <- '0' > par2 <- 'periodic' > par1 <- '12' > #'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.021659721 1.561052 -0.063292738 Feb 1 -0.016697531 1.550465 -0.061667216 Mar 1 -0.026030799 1.539877 -0.026846238 Apr 1 -0.017681134 1.527484 0.006896861 May 1 0.017988552 1.515092 0.048119939 Jun 1 0.021940109 1.501557 0.030503060 Jul 1 -0.005008348 1.488022 0.067786194 Aug 1 0.007696967 1.474342 0.094361526 Sep 1 0.012362320 1.460661 0.088076819 Oct 1 0.004866133 1.442068 0.026565429 Nov 1 0.014409956 1.423476 -0.007585972 Dec 1 0.007813485 1.403402 -0.135515338 Jan 2 -0.021659721 1.383328 -0.088967969 Feb 2 -0.016697531 1.370608 0.037789897 Mar 2 -0.026030799 1.357888 -0.050256781 Apr 2 -0.017681134 1.357261 -0.075180358 May 2 0.017988552 1.356635 -0.043823957 Jun 2 0.021940109 1.367180 -0.061620122 Jul 2 -0.005008348 1.377725 0.037083727 Aug 2 0.007696967 1.390498 0.015205373 Sep 2 0.012362320 1.403271 -0.001833019 Oct 2 0.004866133 1.410728 0.011606161 Nov 2 0.014409956 1.418185 0.031705331 Dec 2 0.007813485 1.414949 0.057237587 Jan 3 -0.021659721 1.411713 0.112246578 Feb 3 -0.016697531 1.398913 0.058384170 Mar 3 -0.026030799 1.386114 0.036517219 Apr 3 -0.017681134 1.370959 0.003721810 May 3 0.017988552 1.355805 -0.025893620 Jun 3 0.021940109 1.342733 -0.033173230 Jul 3 -0.005008348 1.329661 -0.093952826 Aug 3 0.007696967 1.323114 -0.103710989 Sep 3 0.012362320 1.316567 -0.026129190 Oct 3 0.004866133 1.320435 -0.057300840 Nov 3 0.014409956 1.324303 0.026087499 Dec 3 0.007813485 1.337180 0.040706446 Jan 4 -0.021659721 1.350058 -0.028597873 Feb 4 -0.016697531 1.365048 -0.012150474 Mar 4 -0.026030799 1.380038 0.015192381 Apr 4 -0.017681134 1.389665 0.011416279 May 4 0.017988552 1.399291 0.003420157 Jun 4 0.021940109 1.402260 0.061799707 Jul 4 -0.005008348 1.405229 0.038279271 Aug 4 0.007696967 1.402967 0.034636058 Sep 4 0.012362320 1.400705 0.012932807 Oct 4 0.004866133 1.393539 0.046594858 Nov 4 0.014409956 1.386373 -0.050483101 Dec 4 0.007813485 1.374367 0.017919128 Jan 5 -0.021659721 1.362362 0.001098091 Feb 5 -0.016697531 1.347575 -0.036977857 Mar 5 -0.026030799 1.332789 0.010841651 Apr 5 -0.017681134 1.321120 0.040860969 May 5 0.017988552 1.309451 0.008160266 Jun 5 0.021940109 1.302594 -0.003134176 Jul 5 -0.005008348 1.295737 -0.050428604 Aug 5 0.007696967 1.289012 -0.037708949 Sep 5 0.012362320 1.282287 -0.066249333 Oct 5 0.004866133 1.275725 -0.019491517 Nov 5 0.014409956 1.269164 0.009426289 Dec 5 0.007813485 1.263322 0.028164776 Jan 6 -0.021659721 1.257480 0.062779996 > m$win s t l 611 19 13 > m$deg s t l 0 1 1 > m$jump s t l 62 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/fisher/rcomp/tmp/1mxxr1356086989.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/fisher/rcomp/tmp/222721356086989.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/fisher/rcomp/tmp/3gb6o1356086989.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/fisher/rcomp/tmp/4sbev1356086989.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/5c14z1356086989.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/fisher/rcomp/tmp/6k4q71356086989.tab") > > try(system("convert tmp/1mxxr1356086989.ps tmp/1mxxr1356086989.png",intern=TRUE)) character(0) > try(system("convert tmp/222721356086989.ps tmp/222721356086989.png",intern=TRUE)) character(0) > try(system("convert tmp/3gb6o1356086989.ps tmp/3gb6o1356086989.png",intern=TRUE)) character(0) > try(system("convert tmp/4sbev1356086989.ps tmp/4sbev1356086989.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.377 0.720 3.085