R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(21571,21493,21422,21272,22747,22676,21571,20831,20909,20909,20980,21130,21051,21643,21864,21643,22455,21935,20759,20467,20467,20610,20026,20467,20097,20467,21051,21272,21792,21571,20246,19726,19506,19726,19363,19506,19064,19805,20168,20246,21643,21643,19805,19363,19363,19584,18622,18180,17668,17817,18480,17960,19363,19584,18180,17668,17375,17668,16855,16563,15388,15680,15751,15830,17226,17076,15388,14647,14355,14725,13322,12367,10601,10750,10750,10601,11854,11926,10451,10159,9568,10380,8905,8022,6333,6697,6255,6404,7509,7730,6996,6917,6917,7879,6184,5079,3163,4709,4488,4566,6333,6112,5300,5671,5671,6996,5450,4566,3163,5008,4859,4930,6476,6333,5813,5892,6255,7067,5813,4787) > 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/wessaorg/rcomp/tmp/1xsrc1313523419.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/wessaorg/rcomp/tmp/2i6tx1313523419.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/wessaorg/rcomp/tmp/3fqzo1313523419.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.0242377208 -0.1068142490 -0.1574575837 -0.0011296719 [6] -0.0007530524 -0.0884026650 -0.0634431148 -0.0456922015 -0.1817137801 [11] -0.1052185480 0.0554660298 0.8093267761 0.0086764705 -0.0861659625 [16] -0.1363023759 0.0342899734 0.0424779741 -0.0971970153 -0.1084814025 [21] -0.1015418980 -0.1785649052 -0.1384199724 0.0585691790 0.6507746631 [26] -0.0063682712 -0.0776620335 -0.1205089203 0.0613788948 0.0959396624 [31] -0.0909403015 -0.1401610976 -0.1429609949 -0.1498453492 -0.1765961047 [36] 0.0276145590 0.5166568263 -0.0251539565 -0.0737179604 -0.0891575621 [41] 0.0934584841 0.1353662478 -0.0795942905 -0.1415468784 -0.1284827744 [46] -0.1299192026 -0.1818743541 0.0009413923 0.3897029185 > (mypacf <- c(rpacf$acf)) [1] 0.024237721 -0.107464848 -0.153851854 -0.007066056 -0.034613924 [6] -0.117496051 -0.070646951 -0.077585817 -0.246279599 -0.173357218 [11] -0.047908450 0.784422177 0.025551726 0.055857590 -0.021224440 [16] -0.021531073 -0.015718388 -0.045809992 -0.031988108 -0.091608051 [21] 0.013287387 -0.143098924 -0.051320990 -0.021140555 -0.022565330 [26] -0.030782616 -0.041256905 -0.032186385 0.031846147 0.023231997 [31] -0.032211323 -0.035303996 0.043668372 -0.096779166 -0.113267981 [36] -0.031817568 -0.060779592 -0.039175729 0.015415388 -0.004020974 [41] -0.027848990 -0.005659786 -0.000296039 0.063775808 -0.009783268 [46] 0.029895558 -0.032687897 -0.055230451 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'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/wessaorg/rcomp/tmp/4amth1313523419.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/wessaorg/rcomp/tmp/5rk221313523419.tab") > > try(system("convert tmp/1xsrc1313523419.ps tmp/1xsrc1313523419.png",intern=TRUE)) character(0) > try(system("convert tmp/2i6tx1313523419.ps tmp/2i6tx1313523419.png",intern=TRUE)) character(0) > try(system("convert tmp/3fqzo1313523419.ps tmp/3fqzo1313523419.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.991 0.180 1.164