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(1770,2203,2836,1976,2150,2180,2631,1781,2327,2260,2051,2250,2102,2957,2485,2871,2447,2570,2622,1840,2682,2369,2119,2531,2214,3206,2709,2734,2348,2702,2642,2064,2647,2534,2297,2718,2321,3112,2664,2808,2668,2934,2616,2228,2463,2416,2407,2582,2101,3305,2818,2401,3019,2507,2948,2210,2467,2596,2451,2233,2393,3122,2801,2656,2782,2604,2803,2178,2324,2536,2408,2261,2166,3243,2296,2719,2734,2297,2732,1904,2397,2473,1967,2471,2203,3053,2350,2807,2639,2646,2577,1860,2624,2590,2261,3342,2840,3328,3245,3025,2915,3579,2787,2397,3065,2154,2689,3187,2540,3469,3005,2573,2998,2768,2556,2414,2467,2136,2493,2735,2316,3042,2364,2248,2714,2583,2631,1965,2209,1964,2132) > 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/rcomp/tmp/1a4841323963399.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/28ui31323963399.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/35q391323963399.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.206889285 0.428354652 0.554256454 0.146377702 [6] 0.371229571 0.380501579 0.051953782 0.352735646 0.157259984 [11] -0.045946970 0.181276407 -0.090227763 -0.093829953 0.056835652 [16] -0.143643995 -0.133856942 -0.056059518 -0.213690815 -0.191047063 [21] -0.120091631 -0.239332705 -0.242347369 -0.070837546 -0.299312772 [26] -0.183567728 -0.131147197 -0.274863272 -0.114556362 -0.125236820 [31] -0.167845085 -0.014613048 -0.117453806 -0.105946014 0.003033112 [36] -0.045222284 -0.087417539 0.115195143 -0.056972640 0.071302336 [41] 0.031237676 0.055430222 0.016180080 0.042119929 0.033162438 [46] 0.026303946 0.065466532 0.027971058 -0.005038646 > (mypacf <- c(rpacf$acf)) [1] 0.20688929 0.40279226 0.52125887 -0.10021251 -0.05009040 0.16710395 [7] -0.13863936 0.01596794 -0.02524961 -0.22905661 -0.13498421 -0.11119198 [13] -0.04602448 0.03186582 0.11048564 -0.06682602 -0.08218301 0.05282305 [19] -0.07442396 -0.01525812 0.03653849 -0.19331532 0.06997740 -0.02562080 [25] -0.07010212 -0.02220728 0.04472907 0.02776055 -0.03969108 0.15475838 [31] 0.04942925 -0.12131063 -0.01450587 -0.07153162 0.08154635 -0.12248834 [37] 0.06725402 -0.04878894 0.06294200 -0.08933978 0.09802286 -0.01901173 [43] -0.13255051 -0.03292956 0.01591887 -0.02006821 0.02742255 -0.08168472 > 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/4rj491323963399.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/5ri601323963399.tab") > > try(system("convert tmp/1a4841323963399.ps tmp/1a4841323963399.png",intern=TRUE)) character(0) > try(system("convert tmp/28ui31323963399.ps tmp/28ui31323963399.png",intern=TRUE)) character(0) > try(system("convert tmp/35q391323963399.ps tmp/35q391323963399.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.148 0.192 1.373