R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(5745,4549,5074,3602,2732,2589,2148,2330,2752,3241,4517,6550,6778,6240,5570,3558,3299,2447,2380,2378,2947,3651,4816,6436,7090,4682,4198,3860,3056,2563,2568,2472,2821,4015,4686,5418,5649,4572,4695,3766,2900,2528,2549,2478,2828,4139,5390,5621,5291,5272,4677,3520,2842,2723,2581,2429,2606,3787,4630,5505,5577,4911,4701,3557,2921,2734,2636,2433,2640,3794,4745,5698,5909,5119,5200,3876,3104,2251,2386,2794,2967,3392,4741,5909,5901,4962,4751,3909,3130,2860,2568,2540,2894,4216,4530,5144,6206,5645,4601,3645,3140,2264,2557,2431,2747,4587,4512,5313,6011,5328,5014,3630,3102,2739,2877,2659,2957,3785,4785,5757,5458,5427,5018,3498,3204,2763,2589,2591,2805,3278,4615,5524,6167,5380,5377,3603,2774,2470,2407,2512,2451,3134,4210,4859,5022,4584,4267,3022,2777,2428,2389,2496,2820,3854,4748,5666,5293,4905,4920,3854,2659,2491,2455,2472,3030,3987,4453,5417) > 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/www/html/rcomp/tmp/1gy301292692162.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/html/rcomp/tmp/298231292692162.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/html/rcomp/tmp/398231292692162.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.803316592 0.443069164 -0.011395897 -0.451669628 [6] -0.757133052 -0.868158796 -0.748508282 -0.433508999 0.001791208 [11] 0.433733644 0.753782297 0.870127703 0.712436941 0.383594094 [16] -0.039253455 -0.417872240 -0.689482175 -0.784874675 -0.667999817 [21] -0.385849890 0.014362576 0.413460234 0.681862863 0.776447297 [26] 0.641141685 0.351356372 -0.027046590 -0.389987911 -0.638775512 [31] -0.725396533 -0.619669551 -0.363228303 0.005507018 0.362332411 [36] 0.616128608 0.709177702 0.588139429 0.330991365 -0.016339630 [41] -0.350123485 -0.580391587 -0.663650118 -0.568290635 -0.339386548 [46] -0.011167178 0.316942080 0.556793180 0.650698614 > (mypacf <- c(rpacf$acf)) [1] 0.803316592 -0.570223815 -0.468788930 -0.391446757 -0.258879333 [6] -0.268580433 -0.151481746 -0.067200413 0.085756784 0.110870083 [11] 0.179701327 0.138307079 -0.224425986 -0.017848225 -0.009822328 [16] 0.221479185 0.026657282 -0.023684445 -0.026833864 -0.108289293 [21] 0.043330770 0.108562941 -0.052526511 0.118047134 -0.023353623 [26] 0.073706627 -0.030842058 -0.107583553 0.066547633 -0.003937216 [31] 0.033706902 -0.102266676 -0.023523467 -0.071734736 0.003333662 [36] 0.068849904 -0.081880065 -0.033770039 -0.015720825 -0.025429895 [41] 0.039250048 -0.021456583 -0.018735228 -0.073706278 -0.042673541 [46] 0.017386064 -0.005415812 0.055707346 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/4vqjr1292692162.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/html/rcomp/tmp/5grzf1292692162.tab") > > try(system("convert tmp/1gy301292692162.ps tmp/1gy301292692162.png",intern=TRUE)) character(0) > try(system("convert tmp/298231292692162.ps tmp/298231292692162.png",intern=TRUE)) character(0) > try(system("convert tmp/398231292692162.ps tmp/398231292692162.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.738 0.499 2.445