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(17.75694444,-10.5625,-10.40277778,-24.45138889,7.798611111,56.28472222,2.743055556,-26.97222222,-5.948611111,-13.34861111,5.718055556,-13.86527778,53.75694444,3.3125,30.80555556,-3.409722222,-22.11805556,-38.67361111,-5.215277778,7.194444444,-0.781944444,16.06805556,-14.44861111,27.13472222,3.715277778,3.854166667,-5.944444444,2.881944444,-17.57638889,-7.215277778,-5.965277778,-4.847222222,-11.49027778,-5.806944444,1.176388889,22.38472222,-27.86805556,26.3125,-5.777777778,6.840277778,3.298611111,0.659722222,29.03472222,22.52777778,18.55138889,8.193055556,2.968055556,-25.07361111,-30.65972222,-19.5625,-3.069444444,6.381944444,20.92361111,4.951388889,-18.67361111,2.444444444,1.718055556,-3.056944444,6.634722222,-8.531944444,-14.24305556,-0.895833333,-3.152777778,14.21527778,10.13194444,-13.54861111,0.534722222,2.111111111) > 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.208335217 -0.67742471 18.226033929 Feb 1 0.186708438 -0.31100260 -10.438205839 Mar 1 0.165058791 0.05541951 -10.623256079 Apr 1 0.007882529 0.44817178 -24.907443196 May 1 -0.149311571 0.84092404 7.106998638 Jun 1 -0.136067396 1.38738471 55.033404901 Jul 1 -0.122795018 1.93384539 0.932005188 Aug 1 -0.078540156 2.78168292 -29.675364985 Sep 1 0.075313657 3.62952046 -9.653445224 Oct 1 -0.017091204 3.94897445 -17.280494356 Nov 1 -0.109507002 4.26842844 1.559134115 Dec 1 -0.029979270 2.78765443 -16.622952943 Jan 2 0.208335217 1.30688042 52.241728801 Feb 2 0.186708438 0.98671688 2.139074683 Mar 2 0.165058791 0.66655334 29.973943433 Apr 2 0.007882529 0.83964482 -4.257249568 May 2 -0.149311571 1.01273630 -22.981480285 Jun 2 -0.136067396 0.55282227 -39.090365983 Jul 2 -0.122795018 0.09290824 -5.185391000 Aug 2 -0.078540156 -0.43503777 7.708022367 Sep 2 0.075313657 -0.96298378 0.105725675 Oct 2 -0.017091204 -0.59449861 16.679645373 Nov 2 -0.109507002 -0.22601344 -14.113090666 Dec 2 -0.029979270 0.19744570 26.967255788 Jan 3 0.208335217 0.62090484 2.886037717 Feb 3 0.186708438 -0.08410578 3.751564011 Mar 3 0.165058791 -0.78911641 -5.320386827 Apr 3 0.007882529 -1.72523795 4.599299868 May 3 -0.149311571 -2.66135950 -14.765717819 Jun 3 -0.136067396 -3.16972913 -3.909481256 Jul 3 -0.122795018 -3.67809875 -2.164384006 Aug 3 -0.078540156 -3.43769806 -1.330984011 Sep 3 0.075313657 -3.19729736 -8.368294079 Oct 3 -0.017091204 -2.28242330 -3.507429943 Nov 3 -0.109507002 -1.36754924 2.653445127 Dec 3 -0.029979270 0.21523723 22.199464256 Jan 4 0.208335217 1.79802370 -29.874414480 Feb 4 0.186708438 3.74584822 22.379943340 Mar 4 0.165058791 5.69367274 -11.636509309 Apr 4 0.007882529 6.83029392 0.002101329 May 4 -0.149311571 7.96691510 -4.518992416 Jun 4 -0.136067396 7.12081976 -6.325030147 Jul 4 -0.122795018 6.27472443 22.882792807 Aug 4 -0.078540156 4.67270329 17.933614646 Sep 4 0.075313657 3.07068215 15.405393085 Oct 4 -0.017091204 2.02981498 6.180331784 Nov 4 -0.109507002 0.98894780 2.088614755 Dec 4 -0.029979270 -0.10615833 -24.937473511 Jan 5 0.208335217 -1.20126446 -29.666792974 Feb 5 0.186708438 -2.45515806 -17.294050380 Mar 5 0.165058791 -3.70905165 0.474548418 Apr 5 0.007882529 -3.70967962 10.083741530 May 5 -0.149311571 -3.71030758 24.783230259 Jun 5 -0.136067396 -2.77210269 7.859558974 Jul 5 -0.122795018 -1.83389780 -16.716918290 Aug 5 -0.078540156 -1.34692742 3.869912015 Sep 5 0.075313657 -0.85995703 2.502698929 Oct 5 -0.017091204 -0.99013905 -2.049714186 Nov 5 -0.109507002 -1.12032108 7.864550303 Dec 5 -0.029979270 -0.95444751 -7.547517662 Jan 6 0.208335217 -0.78857395 -13.662816831 Feb 6 0.186708438 -0.66734625 -0.415195524 Mar 6 0.165058791 -0.54611855 -2.771718020 Apr 6 0.007882529 -0.33460566 14.542000912 May 6 -0.149311571 -0.12309278 10.404348786 Jun 6 -0.136067396 0.16093230 -13.573476012 Jul 6 -0.122795018 0.44495737 0.212559870 Aug 6 -0.078540156 0.74858180 1.441069462 > m$win s t l 681 19 13 > m$deg s t l 0 1 1 > m$jump s t l 69 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/wessaorg/rcomp/tmp/12lgk1352735705.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/29ovd1352735705.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/3njwl1352735705.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/4itns1352735705.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/50mxk1352735705.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/69t911352735705.tab") > > try(system("convert tmp/12lgk1352735705.ps tmp/12lgk1352735705.png",intern=TRUE)) character(0) > try(system("convert tmp/29ovd1352735705.ps tmp/29ovd1352735705.png",intern=TRUE)) character(0) > try(system("convert tmp/3njwl1352735705.ps tmp/3njwl1352735705.png",intern=TRUE)) character(0) > try(system("convert tmp/4itns1352735705.ps tmp/4itns1352735705.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.960 0.491 3.444