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(1069108,1059362,1049495,1029082,1231089,1220388,1069108,968521,978233,978233,989056,1008514,1069108,1049495,1079775,1129547,1412683,1412683,1352244,1291650,1341422,1401983,1412683,1442964,1533833,1473244,1473244,1564114,1816014,1836427,1785734,1664578,1755420,1755420,1765165,1816014,1856040,1876453,1876453,1937014,2169452,2229890,2239603,2088322,2169452,2139171,2078582,2209478,2239603,2188909,2199610,2269916,2532640,2663352,2663352,2602913,2693660,2602913,2552092,2744509,2774634,2703378,2884967,2956228,3168103,3308711,3289258,3278430,3359559,3349692,3228692,3410253,3470847,3410253,3662154,3783309,4065362,4176650,4146492,4085897,4136624,4197185,3995056,4156204,4257779,4216798,4479366,4570080,4953837,5024138,4933418,4984117,5014398,5044678,4852261,5033856,5134437,5033856,5326854,5417607,5811037,5871631,5891089,5992631,5992631,6032657,5851063,5941938,6002377,5891089,6214246,6274812,6678021,6749283,6849864,6940739,6950451,6961152,6779563,6961152) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1pp7q1310300275.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/2uxfs1310300275.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/3d3xr1310300275.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.000000000 0.974719146 0.950395300 0.923515856 0.895875013 [6] 0.869071776 0.842311110 0.816445964 0.789799889 0.766716876 [11] 0.743585825 0.722906881 0.700637258 0.675178608 0.649833468 [16] 0.622246406 0.594464577 0.567805107 0.541510988 0.515622056 [21] 0.489258104 0.466547302 0.444629428 0.425049446 0.404081112 [26] 0.381287678 0.359168955 0.334732427 0.310250513 0.286982439 [31] 0.263936877 0.240165607 0.215911445 0.195336126 0.175408210 [36] 0.157581016 0.139018241 0.119110644 0.100155634 0.079028171 [41] 0.057995912 0.038273221 0.018141766 -0.001973202 -0.022262237 [46] -0.039939854 -0.056615655 -0.071657378 -0.087162983 > (mypacf <- c(rpacf$acf)) [1] 9.747191e-01 6.367593e-03 -6.331091e-02 -3.119686e-02 4.157255e-03 [6] -1.118542e-02 2.064227e-03 -3.006256e-02 5.481489e-02 -1.043115e-02 [11] 3.025761e-02 -4.571009e-02 -8.095372e-02 -1.400524e-02 -4.948814e-02 [16] -2.327953e-02 1.297062e-02 -8.739579e-03 -6.113956e-03 -3.034952e-02 [21] 4.835678e-02 2.178090e-03 1.736198e-02 -4.315361e-02 -5.301477e-02 [26] -7.695547e-05 -4.698796e-02 -2.506078e-02 1.652207e-02 -1.139588e-02 [31] -2.633709e-02 -3.544034e-02 4.594656e-02 -2.611565e-03 4.284455e-03 [36] -3.219882e-02 -4.507930e-02 5.670848e-03 -4.436007e-02 -2.829398e-02 [41] 1.854803e-02 -2.286824e-02 -8.316291e-03 -2.997992e-02 2.162210e-02 [46] 3.954983e-03 -9.773128e-03 -3.005110e-02 > 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/4e0pv1310300275.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/54sqw1310300275.tab") > > try(system("convert tmp/1pp7q1310300275.ps tmp/1pp7q1310300275.png",intern=TRUE)) character(0) > try(system("convert tmp/2uxfs1310300275.ps tmp/2uxfs1310300275.png",intern=TRUE)) character(0) > try(system("convert tmp/3d3xr1310300275.ps tmp/3d3xr1310300275.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.944 0.168 1.104