R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(11.73 + ,11.75 + ,11.39 + ,11.54 + ,9.62 + ,9.82 + ,9.94 + ,9.9 + ,9.8 + ,9.86 + ,10.5 + ,10.33 + ,10.16 + ,9.91 + ,9.96 + ,10.03 + ,9.55 + ,9.51 + ,9.8 + ,10.08 + ,10.2 + ,10.23 + ,10.2 + ,10.07 + ,10.01 + ,10.05 + ,9.92 + ,10.03 + ,10.18 + ,10.1 + ,10.16 + ,10.15 + ,10.13 + ,10.09 + ,10.18 + ,10.06 + ,9.65 + ,9.74 + ,9.53 + ,9.5 + ,9 + ,9.15 + ,9.32 + ,9.62 + ,9.59 + ,9.37 + ,9.35 + ,9.32 + ,9.49 + ,9.52 + ,9.59 + ,9.35 + ,9.2 + ,9.57 + ,9.78 + ,9.79 + ,9.57 + ,9.53 + ,9.65 + ,9.36 + ,9.4 + ,9.32 + ,9.31 + ,9.19 + ,9.39 + ,9.28 + ,9.28 + ,9.31 + ,9.28 + ,9.31 + ,9.35 + ,9.19 + ,9.07 + ,8.96 + ,8.69 + ,8.58 + ,8.56 + ,8.47 + ,8.46 + ,8.75 + ,8.95 + ,9.33 + ,9.51 + ,9.561 + ,9.94 + ,9.9 + ,9.275 + ,9.56 + ,9.779 + ,9.746 + ,9.991 + ,9.98 + ,10.195 + ,10.31 + ,10.25 + ,9.871 + ,10.06 + ,9.894 + ,9.59 + ,9.64 + ,9.89 + ,9.53 + ,9.388 + ,9.16 + ,9.418 + ,9.57 + ,9.857 + ,9.877 + ,9.76 + ,9.76 + ,9.695 + ,9.475 + ,9.262 + ,9.097 + ,8.55 + ,8.16 + ,7.532 + ,7.325 + ,6.749 + ,7.13 + ,6.995 + ,7.346 + ,7.73 + ,7.837 + ,7.514 + ,7.58 + ,6.83 + ,6.617 + ,6.715 + ,6.63 + ,6.891 + ,7.002 + ,7.09 + ,7.36 + ,7.477 + ,7.826 + ,7.79 + ,7.578 + ,7.204 + ,7.198 + ,7.685 + ,7.795 + ,7.46 + ,7.274 + ,7.33 + ,7.655 + ,7.767 + ,7.84 + ,7.424 + ,7.54 + ,7.351 + ,6.735 + ,6.777 + ,6.679 + ,7.34 + ,6.978 + ,6.92 + ,6.628 + ,6.385 + ,5.984 + ,6.268 + ,6.596 + ,6.395 + ,6.715 + ,6.804 + ,6.929 + ,6.846 + ,6.992 + ,6.774 + ,6.75 + ,6.485 + ,6.27 + ,6.47 + ,6.78 + ,6.71 + ,6.141 + ,6.72 + ,6.68 + ,6.371 + ,6.097 + ,6.27 + ,6.447 + ,6.37 + ,6.446 + ,6.54 + ,6.374 + ,6.33 + ,6.63 + ,6.498 + ,6.485 + ,6.36) > par8 = 'TRUE' > par7 = '1' > par6 = '' > par5 = '1' > par4 = '' > par3 = '0' > par2 = 'periodic' > par1 = '5' > 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 Time Series: Start = c(1, 1) End = c(39, 1) Frequency = 5 seasonal trend remainder 1.0 0.043517418 11.895171 -0.208688509 1.2 -0.008027948 11.611413 0.146615120 1.4 -0.014274898 11.316809 0.087465861 1.6 -0.029967442 11.017968 0.551999137 1.8 0.008752855 10.711468 -1.100221048 2.0 0.043517418 10.373767 -0.597284411 2.2 -0.008027948 9.950097 -0.002068603 2.4 -0.014274898 9.905987 0.008287661 2.6 -0.029967442 9.931844 -0.101876156 2.8 0.008752855 10.012005 -0.160757819 3.0 0.043517418 10.057952 0.398530441 3.2 -0.008027948 10.092638 0.245389757 3.4 -0.014274898 10.119497 0.054778269 3.6 -0.029967442 10.056209 -0.116241978 3.8 0.008752855 9.937517 0.013729939 4.0 0.043517418 9.840923 0.145559374 4.2 -0.008027948 9.817205 -0.259177334 4.4 -0.014274898 9.831305 -0.307030153 4.6 -0.029967442 9.871494 -0.041526259 4.8 0.008752855 9.980740 0.090507181 5.0 0.043517418 10.093634 0.062848225 5.2 -0.008027948 10.144293 0.093735421 5.4 -0.014274898 10.141385 0.072889566 5.6 -0.029967442 10.104632 -0.004664135 5.8 0.008752855 10.054612 -0.053364465 6.0 0.043517418 10.025596 -0.019113405 6.2 -0.008027948 10.033223 -0.105195153 6.4 -0.014274898 10.055919 -0.011644258 6.6 -0.029967442 10.084740 0.125227750 6.8 0.008752855 10.117320 -0.026072510 7.0 0.043517418 10.133355 -0.016872792 7.2 -0.008027948 10.133724 0.024303708 7.4 -0.014274898 10.133947 0.010327967 7.6 -0.029967442 10.106779 0.013188329 7.8 0.008752855 10.034039 0.137207848 8.0 0.043517418 9.940467 0.076015135 8.2 -0.008027948 9.828529 -0.170500751 8.4 -0.014274898 9.696599 0.057676234 8.6 -0.029967442 9.565409 -0.005441077 8.8 0.008752855 9.458748 0.032499155 9.0 0.043517418 9.399226 -0.442743813 9.2 -0.008027948 9.382494 -0.224466408 9.4 -0.014274898 9.380875 -0.046600147 9.6 -0.029967442 9.412607 0.237360309 9.8 0.008752855 9.435118 0.146129096 10.0 0.043517418 9.434411 -0.107928829 10.2 -0.008027948 9.417057 -0.059029219 10.4 -0.014274898 9.420149 -0.085873900 10.6 -0.029967442 9.446245 0.073722195 10.8 0.008752855 9.460037 0.051209849 11.0 0.043517418 9.456403 0.090080048 11.2 -0.008027948 9.475199 -0.117171346 11.4 -0.014274898 9.516613 -0.302337652 11.6 -0.029967442 9.561945 0.038022925 11.8 0.008752855 9.611840 0.159407578 12.0 0.043517418 9.646070 0.100412803 12.2 -0.008027948 9.635020 -0.056992106 12.4 -0.014274898 9.576340 -0.032064908 12.6 -0.029967442 9.505035 0.174932249 12.8 0.008752855 9.447809 -0.096562260 13.0 0.043517418 9.390456 -0.033973474 13.2 -0.008027948 9.336281 -0.008252910 13.4 -0.014274898 9.313966 0.010308458 13.6 -0.029967442 9.301083 -0.081115943 13.8 0.008752855 9.291825 0.089422344 14.0 0.043517418 9.293600 -0.057117441 14.2 -0.008027948 9.298937 -0.010909002 14.4 -0.014274898 9.299418 0.024857108 14.6 -0.029967442 9.299734 0.010233090 14.8 0.008752855 9.282691 0.018556150 15.0 0.043517418 9.238774 0.067708959 15.2 -0.008027948 9.164948 0.033079936 15.4 -0.014274898 9.048698 0.035576597 15.6 -0.029967442 8.906654 0.083313101 15.8 0.008752855 8.771836 -0.090589354 16.0 0.043517418 8.652372 -0.115889069 16.2 -0.008027948 8.575217 -0.007189313 16.4 -0.014274898 8.576748 -0.092472734 16.6 -0.029967442 8.653750 -0.163782065 16.8 0.008752855 8.800954 -0.059706460 17.0 0.043517418 9.001102 -0.094619637 17.2 -0.008027948 9.226258 0.111770223 17.4 -0.014274898 9.447795 0.076480220 17.6 -0.029967442 9.633969 -0.043001641 17.8 0.008752855 9.725725 0.205522556 18.0 0.043517418 9.738807 0.117675374 18.2 -0.008027948 9.757665 -0.474637193 18.4 -0.014274898 9.751454 -0.177179495 18.6 -0.029967442 9.747436 0.061531393 18.8 0.008752855 9.819098 -0.081851266 19.0 0.043517418 9.930825 0.016657207 19.2 -0.008027948 10.041532 -0.053504464 19.4 -0.014274898 10.122958 0.086316458 19.6 -0.029967442 10.144857 0.195110939 19.8 0.008752855 10.130394 0.110853019 20.0 0.043517418 10.068976 -0.241493870 20.2 -0.008027948 9.955087 0.112940752 20.4 -0.014274898 9.849874 0.058401074 20.6 -0.029967442 9.780249 -0.160281644 20.8 0.008752855 9.697759 -0.066511446 21.0 0.043517418 9.605851 0.240631713 21.2 -0.008027948 9.528915 0.009112678 21.4 -0.014274898 9.471233 -0.068957608 21.6 -0.029967442 9.445229 -0.255261906 21.8 0.008752855 9.488973 -0.079726269 22.0 0.043517418 9.581807 -0.055324511 22.2 -0.008027948 9.684385 0.180643261 22.4 -0.014274898 9.753441 0.137833470 22.6 -0.029967442 9.767812 0.022155934 22.8 0.008752855 9.706333 0.044913758 23.0 0.043517418 9.592875 0.058607277 23.2 -0.008027948 9.432720 0.050307693 23.4 -0.014274898 9.192758 0.083516989 23.6 -0.029967442 8.882907 0.244059947 23.8 0.008752855 8.516325 0.024922634 24.0 0.043517418 8.110047 0.006435783 24.2 -0.008027948 7.738785 -0.198756764 24.4 -0.014274898 7.477497 -0.138221756 24.6 -0.029967442 7.301269 -0.522301771 24.8 0.008752855 7.236298 -0.115050810 25.0 0.043517418 7.256564 -0.305081356 25.2 -0.008027948 7.370251 -0.016223257 25.4 -0.014274898 7.468084 0.276191017 25.6 -0.029967442 7.512973 0.353994686 25.8 0.008752855 7.442752 0.062495616 26.0 0.043517418 7.270198 0.266284703 26.2 -0.008027948 7.058388 -0.220359754 26.4 -0.014274898 6.880042 -0.248766736 26.6 -0.029967442 6.770232 -0.025264262 26.8 0.008752855 6.782250 -0.161003228 27.0 0.043517418 6.872692 -0.025209154 27.2 -0.008027948 7.004489 0.005538495 27.4 -0.014274898 7.166656 -0.062381583 27.6 -0.029967442 7.341442 0.048525389 27.8 0.008752855 7.490576 -0.022328429 28.0 0.043517418 7.579487 0.202996004 28.2 -0.008027948 7.592204 0.205824206 28.4 -0.014274898 7.556410 0.035864846 28.6 -0.029967442 7.536944 -0.302976093 28.8 0.008752855 7.524463 -0.335215756 29.0 0.043517418 7.504618 0.136864548 29.2 -0.008027948 7.509314 0.293713484 29.4 -0.014274898 7.497391 -0.023116149 29.6 -0.029967442 7.482908 -0.178940334 29.8 0.008752855 7.505278 -0.184030455 30.0 0.043517418 7.563659 0.047823606 30.2 -0.008027948 7.604690 0.170338316 30.4 -0.014274898 7.611819 0.242455593 30.6 -0.029967442 7.548143 -0.094175935 30.8 0.008752855 7.391231 0.140016502 31.0 0.043517418 7.198895 0.108587995 31.2 -0.008027948 7.015806 -0.272778003 31.4 -0.014274898 6.872271 -0.080996362 31.6 -0.029967442 6.830345 -0.121378038 31.8 0.008752855 6.824217 0.507029712 32.0 0.043517418 6.808865 0.125618018 32.2 -0.008027948 6.776803 0.151224907 32.4 -0.014274898 6.645929 -0.003654029 32.6 -0.029967442 6.531712 -0.116744854 32.8 0.008752855 6.473253 -0.498005444 33.0 0.043517418 6.444885 -0.220402275 33.2 -0.008027948 6.465062 0.138966150 33.4 -0.014274898 6.563447 -0.154172469 33.6 -0.029967442 6.672816 0.072151360 33.8 0.008752855 6.759640 0.035607625 34.0 0.043517418 6.834180 0.051302818 34.2 -0.008027948 6.862564 -0.008535773 34.4 -0.014274898 6.840878 0.165397086 34.6 -0.029967442 6.769838 0.034129464 34.8 0.008752855 6.665066 0.076181040 35.0 0.043517418 6.585269 -0.143786630 35.2 -0.008027948 6.560749 -0.282721199 35.4 -0.014274898 6.570984 -0.086709151 35.6 -0.029967442 6.628783 0.181184604 35.8 0.008752855 6.682671 0.018575992 36.0 0.043517418 6.696420 -0.598937176 36.2 -0.008027948 6.650399 0.077628799 36.4 -0.014274898 6.566850 0.127424446 36.6 -0.029967442 6.462371 -0.061403558 36.8 0.008752855 6.391621 -0.303374154 37.0 0.043517418 6.348612 -0.122129814 37.2 -0.008027948 6.354899 0.100128786 37.4 -0.014274898 6.405504 -0.021228887 37.6 -0.029967442 6.429020 0.046947711 37.8 0.008752855 6.429891 0.101356436 38.0 0.043517418 6.447922 -0.117439745 38.2 -0.008027948 6.462932 -0.124904103 38.4 -0.014274898 6.458057 0.186217796 38.6 -0.029967442 6.449573 0.078394755 38.8 0.008752855 6.441992 0.034254655 39.0 0.043517418 6.430872 -0.114389049 > m$win s t l 1911 9 5 > m$deg s t l 0 1 1 > m$jump s t l 192 1 1 > m$inner [1] 1 > m$outer [1] 15 > postscript(file="/var/www/rcomp/tmp/1mdz61322232436.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/rcomp/tmp/2hos11322232436.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/rcomp/tmp/3iid31322232436.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/rcomp/tmp/4k0ge1322232436.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/5mkiq1322232436.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/rcomp/tmp/6l9ou1322232436.tab") > > try(system("convert tmp/1mdz61322232436.ps tmp/1mdz61322232436.png",intern=TRUE)) character(0) > try(system("convert tmp/2hos11322232436.ps tmp/2hos11322232436.png",intern=TRUE)) character(0) > try(system("convert tmp/3iid31322232436.ps tmp/3iid31322232436.png",intern=TRUE)) character(0) > try(system("convert tmp/4k0ge1322232436.ps tmp/4k0ge1322232436.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.260 0.130 2.356