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(7.5,7.2,6.8,6.7,6.4,6.3,6.8,7.3,7.1,7,6.8,6.6,6.3,6.1,6.1,6.3,6.3,6,6.2,6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8,8.1,8.2,8.3,8.2,8,7.9,7.6,7.6,8.3,8.4,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.4,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.5,8.2,8.1,7.9,8.6,8.7,8.7,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8,8.2,8.1,8.1,8,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.4,6.1,6.5,7.7,7.9,7.5,6.9,6.6,6.9,7.7,8,8,7.7,7.3,7.4,8.1,8.3,8.1,7.9,7.9,8.3,8.6,8.7,8.5,8.3,8,8,8.8,8.7,8.5,8.1,7.8,7.7,7.5,7.2,6.9,6.6,6.5,6.6,7.7,8,7.7,7.2,7,7,7.3,7.3,7.1,7,7,7,7.7,7.9,7.7) > 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.22013532 7.129406 0.150458486 Feb 1 0.14899827 7.077242 -0.026240559 Mar 1 -0.04521578 7.025078 -0.179862613 Apr 1 -0.24530445 6.970838 -0.025533477 May 1 -0.46077771 6.916597 -0.055819752 Jun 1 -0.51503063 6.859462 -0.044431257 Jul 1 0.19225497 6.802326 -0.194581290 Aug 1 0.34285848 6.744417 0.212724917 Sep 1 0.24730828 6.686507 0.166184844 Oct 1 0.09769343 6.638122 0.264184514 Nov 1 -0.03856958 6.589737 0.248832344 Dec 1 0.05564945 6.547435 -0.003084428 Jan 2 0.22013532 6.505133 -0.425268057 Feb 2 0.14899827 6.467810 -0.516808141 Mar 2 -0.04521578 6.430487 -0.285271234 Apr 2 -0.24530445 6.446155 0.099149592 May 2 -0.46077771 6.461823 0.298955007 Jun 2 -0.51503063 6.545309 -0.030278556 Jul 2 0.19225497 6.628796 -0.621050647 Aug 2 0.34285848 6.733868 -0.676726415 Sep 2 0.24730828 6.838940 -0.286248462 Oct 2 0.09769343 6.930748 0.471558992 Nov 2 -0.03856958 7.022555 0.516014605 Dec 2 0.05564945 7.107663 0.436687079 Jan 3 0.22013532 7.192772 0.187092697 Feb 3 0.14899827 7.263217 -0.012215108 Mar 3 -0.04521578 7.333662 0.011554078 Apr 3 -0.24530445 7.381201 -0.035896173 May 3 -0.46077771 7.428740 -0.067961836 Jun 3 -0.51503063 7.482379 -0.167348860 Jul 3 0.19225497 7.536019 -0.228274412 Aug 3 0.34285848 7.605379 -0.348237093 Sep 3 0.24730828 7.674738 -0.122046055 Oct 3 0.09769343 7.746996 0.155310898 Nov 3 -0.03856958 7.819254 0.319316011 Dec 3 0.05564945 7.887280 0.257070619 Jan 4 0.22013532 7.955306 0.124558371 Feb 4 0.14899827 8.006340 0.044661459 Mar 4 -0.04521578 8.057374 -0.012158463 Apr 4 -0.24530445 8.089596 0.055708231 May 4 -0.46077771 8.121818 -0.061040486 Jun 4 -0.51503063 8.156294 -0.041263623 Jul 4 0.19225497 8.190770 -0.083025287 Aug 4 0.34285848 8.227028 -0.169886216 Sep 4 0.24730828 8.263285 -0.110593424 Oct 4 0.09769343 8.271495 0.030811607 Nov 4 -0.03856958 8.279705 0.158864798 Dec 4 0.05564945 8.281551 0.262799782 Jan 5 0.22013532 8.283397 0.396467909 Feb 5 0.14899827 8.310557 0.340444361 Mar 5 -0.04521578 8.337718 0.007497804 Apr 5 -0.24530445 8.359754 -0.614449135 May 5 -0.46077771 8.381789 -0.721011486 Jun 5 -0.51503063 8.379928 -0.464897116 Jul 5 0.19225497 8.378066 0.229678725 Aug 5 0.34285848 8.387748 0.569393323 Sep 5 0.24730828 8.397430 0.655261642 Oct 5 0.09769343 8.430563 0.171743566 Nov 5 -0.03856958 8.463696 -0.225126350 Dec 5 0.05564945 8.475181 -0.230830064 Jan 6 0.22013532 8.486665 -0.206800634 Feb 6 0.14899827 8.465621 -0.014619464 Mar 6 -0.04521578 8.444577 0.100638697 Apr 6 -0.24530445 8.434331 0.010973896 May 6 -0.46077771 8.424084 0.136693684 Jun 6 -0.51503063 8.431739 -0.016708780 Jul 6 0.19225497 8.439395 -0.031649772 Aug 6 0.34285848 8.448776 -0.091634006 Sep 6 0.24730828 8.458156 -0.005464520 Oct 6 0.09769343 8.472566 -0.070259348 Nov 6 -0.03856958 8.486976 -0.048406016 Dec 6 0.05564945 8.490386 -0.046035477 Jan 7 0.22013532 8.493796 -0.013931794 Feb 7 0.14899827 8.466617 0.084384814 Mar 7 -0.04521578 8.439437 0.205778413 Apr 7 -0.24530445 8.389984 0.355320646 May 7 -0.46077771 8.340530 0.420247467 Jun 7 -0.51503063 8.278911 0.236119870 Jul 7 0.19225497 8.217291 -0.209546255 Aug 7 0.34285848 8.150553 -0.393411300 Sep 7 0.24730828 8.083814 -0.231122625 Oct 7 0.09769343 8.030666 -0.128359599 Nov 7 -0.03856958 7.977518 -0.038948412 Dec 7 0.05564945 7.934804 -0.090453787 Jan 8 0.22013532 7.892091 -0.112226018 Feb 8 0.14899827 7.833672 0.017329684 Mar 8 -0.04521578 7.775253 0.169962376 Apr 8 -0.24530445 7.694701 0.550603399 May 8 -0.46077771 7.614149 0.546629011 Jun 8 -0.51503063 7.529683 0.185347708 Jul 8 0.19225497 7.445217 -0.137472123 Aug 8 0.34285848 7.352010 -0.394868890 Sep 8 0.24730828 7.258804 -0.506111936 Oct 8 0.09769343 7.160076 -0.257769495 Nov 8 -0.03856958 7.061348 -0.022778894 Dec 8 0.05564945 7.012997 0.131353511 Jan 9 0.22013532 6.964646 0.115219060 Feb 9 0.14899827 6.976495 -0.025492915 Mar 9 -0.04521578 6.988344 -0.143127898 Apr 9 -0.24530445 6.998773 -0.353468326 May 9 -0.46077771 7.009202 -0.448424166 Jun 9 -0.51503063 7.017420 -0.002388973 Jul 9 0.19225497 7.025637 0.482107693 Aug 9 0.34285848 7.080285 0.476856666 Sep 9 0.24730828 7.134932 0.117759360 Oct 9 0.09769343 7.220752 -0.418445474 Nov 9 -0.03856958 7.306572 -0.668002147 Dec 9 0.05564945 7.381641 -0.537290289 Jan 10 0.22013532 7.456710 0.023154714 Feb 10 0.14899827 7.525252 0.325749437 Mar 10 -0.04521578 7.593795 0.451421150 Apr 10 -0.24530445 7.675986 0.269318816 May 10 -0.46077771 7.758177 0.002601071 Jun 10 -0.51503063 7.834099 0.080931926 Jul 10 0.19225497 7.910021 -0.002275748 Aug 10 0.34285848 7.967436 -0.010294392 Sep 10 0.24730828 8.024851 -0.172159315 Oct 10 0.09769343 8.081182 -0.278875834 Nov 10 -0.03856958 8.137514 -0.198944194 Dec 10 0.05564945 8.197289 0.047061791 Jan 11 0.22013532 8.257064 0.122800920 Feb 11 0.14899827 8.304136 0.246865790 Mar 11 -0.04521578 8.351208 0.194007650 Apr 11 -0.24530445 8.361919 0.183385941 May 11 -0.46077771 8.372629 0.088148821 Jun 11 -0.51503063 8.320996 0.194034570 Jul 11 0.19225497 8.269363 0.338381791 Aug 11 0.34285848 8.157424 0.199717817 Sep 11 0.24730828 8.045484 0.207207563 Oct 11 0.09769343 7.905227 0.097079364 Nov 11 -0.03856958 7.764970 0.073599325 Dec 11 0.05564945 7.639621 0.004729956 Jan 12 0.22013532 7.514271 -0.234406269 Feb 12 0.14899827 7.428669 -0.377667094 Mar 12 -0.04521578 7.343067 -0.397850929 Apr 12 -0.24530445 7.289341 -0.444036663 May 12 -0.46077771 7.235616 -0.274837809 Jun 12 -0.51503063 7.208275 -0.093243925 Jul 12 0.19225497 7.180934 0.326811431 Aug 12 0.34285848 7.182372 0.474769485 Sep 12 0.24730828 7.183810 0.268881260 Oct 12 0.09769343 7.199195 -0.096888639 Nov 12 -0.03856958 7.214580 -0.176010377 Dec 12 0.05564945 7.234358 -0.290007075 Jan 13 0.22013532 7.254135 -0.174270628 Feb 13 0.14899827 7.278717 -0.127715548 Mar 13 -0.04521578 7.303299 -0.158083477 Apr 13 -0.24530445 7.329571 -0.084266707 May 13 -0.46077771 7.355843 0.104934653 Jun 13 -0.51503063 7.386910 0.128120433 Jul 13 0.19225497 7.417977 0.089767686 Aug 13 0.34285848 7.453580 0.103561865 Sep 13 0.24730828 7.489182 -0.036490236 > m$win s t l 1531 19 13 > m$deg s t l 0 1 1 > m$jump s t l 154 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/wessaorg/rcomp/tmp/1zol41352763385.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/wessaorg/rcomp/tmp/2dag71352763385.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/wessaorg/rcomp/tmp/3580p1352763385.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/wessaorg/rcomp/tmp/4k5te1352763385.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/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,'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/wessaorg/rcomp/tmp/5edzf1352763385.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/wessaorg/rcomp/tmp/6mson1352763385.tab") > > try(system("convert tmp/1zol41352763385.ps tmp/1zol41352763385.png",intern=TRUE)) character(0) > try(system("convert tmp/2dag71352763385.ps tmp/2dag71352763385.png",intern=TRUE)) character(0) > try(system("convert tmp/3580p1352763385.ps tmp/3580p1352763385.png",intern=TRUE)) character(0) > try(system("convert tmp/4k5te1352763385.ps tmp/4k5te1352763385.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.146 0.487 4.601