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 = '1' > 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/1hhe51292695967.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/2a9wq1292695967.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/3a9wq1292695967.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.370350965 0.062152335 0.179632556 0.084882402 [6] 0.015396653 0.024367615 -0.031635192 0.011490671 0.007823165 [11] -0.037640089 -0.075162894 -0.357797269 -0.249314207 -0.101904298 [16] -0.139258910 -0.008458870 0.037836212 -0.011581595 -0.012217038 [21] -0.020885967 -0.022457461 0.044990751 -0.081963660 -0.123414997 [26] 0.092282965 0.057575558 -0.010029401 -0.075984740 -0.018676501 [31] 0.006060624 -0.032521515 -0.039925361 0.048097167 0.016936286 [36] -0.041701653 0.011478238 -0.017652111 -0.061049161 -0.038893682 [41] 0.021368905 0.037032554 0.046850694 0.073540977 0.006447723 [46] -0.006377628 -0.038563209 -0.028676814 -0.057456157 > (mypacf <- c(rpacf$acf)) [1] 0.3703509654 -0.0869309360 0.2181525719 -0.0745084102 0.0296544601 [6] -0.0212434177 -0.0488290197 0.0565526785 -0.0349443317 -0.0098918976 [11] -0.0785281877 -0.3799159943 0.0521065170 -0.0863589884 0.0411949167 [16] 0.1288410894 -0.0200210839 0.0443808811 -0.1005390984 0.0018026391 [21] 0.0205512003 0.0399893941 -0.1293338193 -0.2335921154 0.1414088260 [26] -0.0948923275 0.0362901039 -0.0792406996 0.0887180217 -0.0009726478 [31] -0.0736062223 0.0303216865 0.0531603292 0.0140559724 -0.1368149001 [36] -0.1367633670 0.0800699962 -0.1474456737 0.0497019144 0.0055528268 [41] 0.0884134675 0.0462750001 -0.0496252547 -0.0044763164 0.0640781678 [46] -0.0849601453 -0.1107480175 -0.1604389200 > 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/4vrcw1292695967.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/5zstk1292695967.tab") > > try(system("convert tmp/1hhe51292695967.ps tmp/1hhe51292695967.png",intern=TRUE)) character(0) > try(system("convert tmp/2a9wq1292695967.ps tmp/2a9wq1292695967.png",intern=TRUE)) character(0) > try(system("convert tmp/3a9wq1292695967.ps tmp/3a9wq1292695967.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.735 0.502 1.857