R version 2.12.1 (2010-12-16) 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(465,455,444,424,630,620,465,362,372,372,382,403,434,424,362,372,661,723,558,465,486,496,548,599,610,506,517,382,765,878,620,537,589,651,744,858,858,785,754,568,878,1023,899,765,785,858,961,1085,1002,951,951,785,1023,1178,1054,920,961,1126,1199,1302,1219,1085,1054,806,971,1147,951,837,951,1064,1126,1292,1209,1002,1023,827,992,1137,971,858,961,1085,1064,1312,1271,1106,1116,899,1033,1240,1085,992,1147,1240,1168,1498,1416,1230,1178,940,1075,1199,1044,1044,1219,1312,1261,1622,1529,1354,1281,1023,1116,1281,1157,1126,1271,1395,1261,1581) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #Technical description: > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > if (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/rcomp/tmp/158xp1312548651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2gqje1312548651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=mysub) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/30e0s1312548651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 -0.0473122157 -0.3437360386 -0.0003112125 -0.1847010285 [6] -0.0246973627 0.2530380084 0.0448719964 -0.2231256498 -0.0069827052 [11] -0.3337401673 -0.0915699480 0.8598049723 0.0102234716 -0.3112969086 [16] -0.0260503035 -0.1488724382 -0.0441901738 0.2438038529 0.0990538973 [21] -0.2109239147 -0.0091439058 -0.2882675371 -0.1126138648 0.7193474552 [26] 0.0395197075 -0.2818031099 -0.0407768346 -0.1213280779 -0.0666120635 [31] 0.2098905118 0.1456366028 -0.1985382582 -0.0151060011 -0.2151075875 [36] -0.1175341762 0.5664245037 0.0731660994 -0.2310306337 -0.0427554178 [41] -0.0845857694 -0.0806662657 0.1700946783 0.1812024198 -0.1921880102 [46] -0.0311749784 -0.1594642141 -0.1188380611 0.4338536551 > (mypacf <- c(rpacf$acf)) [1] -4.731222e-02 -3.467507e-01 -4.399531e-02 -3.503743e-01 -1.086324e-01 [6] 4.214231e-02 1.380852e-02 -1.976378e-01 -3.643809e-02 -5.645239e-01 [11] -4.012366e-01 6.755954e-01 -8.377572e-03 6.707289e-02 -1.445028e-01 [16] -6.006010e-02 6.151464e-02 -5.240139e-02 -2.330996e-02 3.436320e-02 [21] -9.671194e-03 1.361386e-01 2.090097e-02 -4.778096e-02 -8.544956e-02 [26] -7.200314e-02 3.260295e-02 3.235368e-07 -4.262794e-02 -1.002880e-01 [31] -2.888411e-03 -4.216360e-02 -2.717298e-02 6.236328e-02 -2.591633e-02 [36] -1.448227e-01 -6.755537e-03 -3.991783e-03 9.125895e-02 2.230536e-02 [41] -4.080707e-02 8.517740e-03 5.436491e-02 -2.059189e-02 -7.085741e-03 [46] -9.448641e-02 -2.840547e-02 1.044037e-02 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/4mhou1312548651.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/59qn01312548651.tab") > > try(system("convert tmp/158xp1312548651.ps tmp/158xp1312548651.png",intern=TRUE)) character(0) > try(system("convert tmp/2gqje1312548651.ps tmp/2gqje1312548651.png",intern=TRUE)) character(0) > try(system("convert tmp/30e0s1312548651.ps tmp/30e0s1312548651.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.004 0.340 2.309