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(3030.29,2803.47,2767.63,2882.6,2863.36,2897.06,3012.61,3142.95,3032.93,3045.78,3110.52,3013.24,2987.1,2995.55,2833.18,2848.96,2794.83,2845.26,2915.02,2892.63,2604.42,2641.65,2659.81,2638.53,2720.25,2745.88,2735.7,2811.7,2799.43,2555.28,2304.98,2214.95,2065.81,1940.49,2042,1995.37,1946.81,1765.9,1635.25,1833.42,1910.43,1959.67,1969.6,2061.41,2093.48,2120.88,2174.56,2196.72,2350.44,2440.25,2408.64,2472.81,2407.6,2454.62,2448.05,2497.84,2645.64,2756.76,2849.27,2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.1,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.4,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.6,2070.83,2293.41,2443.27,2513.17,2466.92) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > 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/1esuh1261399622.ps",horizontal=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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/25yb41261399622.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 0.285104933 0.069670369 0.211663175 0.183539486 [6] 0.190324604 0.001905035 -0.013478448 0.127828242 0.060946446 [11] -0.106163325 0.070389701 0.033454382 -0.027618088 0.044674000 [16] 0.009369170 0.058329189 -0.053590479 -0.094450406 0.005601141 [21] -0.110266333 -0.101606837 -0.088895211 -0.126585735 -0.067232951 [26] -0.047416927 -0.118045483 -0.030890684 0.026794151 -0.032584116 [31] -0.020761842 -0.040720807 0.010312954 -0.027866190 -0.069024477 [36] -0.122151204 -0.029426120 -0.046060070 -0.082758664 -0.014083389 [41] -0.049666505 -0.032850568 -0.040479015 -0.082717826 -0.012124099 [46] -0.051635903 -0.076564841 -0.091181102 -0.072734380 -0.099205075 [51] -0.082393509 -0.080422792 -0.103676743 -0.014348091 -0.029450173 [56] -0.046336785 -0.010016567 -0.049563321 -0.043447424 -0.016394894 [61] 0.011615167 > (mypacf <- c(rpacf$acf)) [1] 0.2851049326 -0.0126420613 0.2124534450 0.0757541390 0.1369228525 [6] -0.1345646797 -0.0209892749 0.0736179636 -0.0027717538 -0.1356273986 [11] 0.1523784151 -0.0627439133 -0.0133510343 0.0568538279 0.0231580999 [16] 0.0068900882 -0.1060309260 -0.0253656215 -0.0093013977 -0.1529241552 [21] 0.0401362845 -0.0594614637 -0.0687804206 0.0193924553 0.0385425586 [26] -0.0683462797 0.0298452190 0.0778803044 -0.0083173102 -0.0669542872 [31] 0.0311986789 0.0209528316 -0.1054345483 0.0251993525 -0.1118487855 [36] 0.0271267574 -0.0516148264 0.0294808180 0.0276153536 -0.0682461510 [41] -0.0019998606 -0.0081640468 -0.1314786304 0.0450896765 -0.0659467676 [46] -0.0224201402 -0.1040910811 0.0170942835 -0.0593935878 -0.0283248170 [51] -0.0006107005 -0.0319743299 -0.0184065601 0.0586913478 -0.0784648337 [56] 0.0274065712 -0.0925455040 -0.0337946971 -0.0066800235 0.0142426320 > 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/3u0l91261399622.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/4o2rv1261399622.tab") > > try(system("convert tmp/1esuh1261399622.ps tmp/1esuh1261399622.png",intern=TRUE)) character(0) > try(system("convert tmp/25yb41261399622.ps tmp/25yb41261399622.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.584 0.309 0.698