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(9700,9081,9084,9743,8587,9731,9563,9998,9437,10038,9918,9252,9737,9035,9133,9487,8700,9627,8947,9283,8829,9947,9628,9318,9605,8640,9214,9567,8547,9185,9470,9123,9278,10170,9434,9655,9429,8739,9552,9687,9019,9672,9206,9069,9788,10312,10105,9863,9656,9295,9946,9701,9049,10190,9706,9765,9893,9994,10433,10073,10112,9266,9820,10097,9115,10411,9678,10408,10153,10368,10581,10597,10680,9738,9556) > par8 = 'FALSE' > par7 = '1' > par6 = '' > par5 = '1' > par4 = '' > par3 = '0' > par2 = 'periodic' > par1 = '6' > main = 'Seasonal Decomposition by Loess' > par8 <- 'FALSE' > par7 <- '1' > par6 <- '' > par5 <- '1' > par4 <- '' > par3 <- '0' > par2 <- 'periodic' > par1 <- '6' > #'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(13, 3) Frequency = 6 seasonal trend remainder 1.000000 52.16881 9338.419 309.412517 1.166667 -270.65156 9349.994 1.657685 1.333333 -109.46836 9361.569 -168.100720 1.500000 327.46343 9390.105 25.431765 1.666667 -182.01005 9418.641 -649.630487 1.833333 182.49792 9488.866 59.635667 2.000000 52.16881 9559.092 -48.261099 2.166667 -270.65156 9638.008 630.643257 2.333333 -109.46836 9716.924 -170.455962 2.500000 327.46343 9679.553 30.983630 2.666667 -182.01005 9642.182 457.828485 2.833333 182.49792 9547.482 -477.979842 3.000000 52.16881 9452.782 232.048912 3.166667 -270.65156 9358.090 -52.438299 3.333333 -109.46836 9263.397 -20.929084 3.500000 327.46343 9224.189 -64.652114 3.666667 -182.01005 9184.980 -302.969881 3.833333 182.49792 9197.847 246.655054 4.000000 52.16881 9210.714 -315.882931 4.166667 -270.65156 9277.396 276.255423 4.333333 -109.46836 9344.078 -405.609798 4.500000 327.46343 9361.985 257.551144 4.666667 -182.01005 9379.893 430.117349 4.833333 182.49792 9354.294 -218.792188 5.000000 52.16881 9328.696 224.135354 5.166667 -270.65156 9242.984 -332.332520 5.333333 -109.46836 9157.272 166.196032 5.500000 327.46343 9150.249 89.287089 5.666667 -182.01005 9143.227 -414.216591 5.833333 182.49792 9203.828 -201.326143 6.000000 52.16881 9264.430 153.401385 6.166667 -270.65156 9363.979 29.672399 6.333333 -109.46836 9463.529 -76.060161 6.500000 327.46343 9477.613 364.923452 6.666667 -182.01005 9491.698 124.312329 6.833333 182.49792 9465.480 7.022493 7.000000 52.16881 9439.261 -62.430262 7.166667 -270.65156 9396.594 -386.942769 7.333333 -109.46836 9353.927 307.541149 7.500000 327.46343 9350.996 8.540948 7.666667 -182.01005 9348.064 -147.053990 7.833333 182.49792 9410.544 78.958552 8.000000 52.16881 9473.023 -319.191826 8.166667 -270.65156 9584.521 -244.869303 8.333333 -109.46836 9696.019 201.449646 8.500000 327.46343 9755.731 228.805999 8.666667 -182.01005 9815.442 471.567616 8.833333 182.49792 9798.728 -118.225795 9.000000 52.16881 9782.013 -178.182126 9.166667 -270.65156 9710.242 -144.589942 9.333333 -109.46836 9638.470 416.998668 9.500000 327.46343 9659.484 -285.947701 9.666667 -182.01005 9680.499 -449.488808 9.833333 182.49792 9726.469 281.033189 10.000000 52.16881 9772.439 -118.607733 10.166667 -270.65156 9868.999 166.652137 10.333333 -109.46836 9965.560 36.908433 10.500000 327.46343 9980.979 -314.442688 10.666667 -182.01005 9996.399 618.611455 10.833333 182.49792 9963.126 -72.624126 11.000000 52.16881 9929.854 129.977373 11.166667 -270.65156 9862.148 -325.496921 11.333333 -109.46836 9794.443 135.025211 11.500000 327.46343 9817.033 -47.496779 11.666667 -182.01005 9839.624 -542.613506 11.833333 182.49792 9931.827 296.675386 12.000000 52.16881 10024.030 -398.198641 12.166667 -270.65156 10148.879 529.772407 12.333333 -109.46836 10273.728 -11.260119 12.500000 327.46343 10299.515 -258.978182 12.666667 -182.01005 10325.301 437.709017 12.833333 182.49792 10262.037 152.464890 13.000000 52.16881 10198.773 429.057843 13.166667 -270.65156 10122.129 -113.477378 13.333333 -109.46836 10045.485 -380.016174 > m$win s t l 751 11 7 > m$deg s t l 0 1 1 > m$jump s t l 76 2 1 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/wessaorg/rcomp/tmp/1urve1352732338.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/2kiny1352732338.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/38ydn1352732338.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/48tt61352732338.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/5u3hb1352732338.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/6wcl01352732338.tab") > > try(system("convert tmp/1urve1352732338.ps tmp/1urve1352732338.png",intern=TRUE)) character(0) > try(system("convert tmp/2kiny1352732338.ps tmp/2kiny1352732338.png",intern=TRUE)) character(0) > try(system("convert tmp/38ydn1352732338.ps tmp/38ydn1352732338.png",intern=TRUE)) character(0) > try(system("convert tmp/48tt61352732338.ps tmp/48tt61352732338.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.394 0.366 2.760