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(1.1591,1.1203,1.0886,1.0701,1.0630,1.0377,1.0370,1.0605,1.0497,1.0706,1.0328,1.0110,1.0131,0.9834,0.9643,0.9449,0.9059,0.9505,0.9386,0.9045,0.8695,0.8525,0.8552,0.8983,0.9376,0.9205,0.9083,0.8925,0.8753,0.8530,0.8615,0.9014,0.9114,0.9050,0.8883,0.8912,0.8832,0.8707,0.8766,0.8860,0.9170,0.9561,0.9935,0.9781,0.9806,0.9812,1.0013,1.0194,1.0622,1.0785,1.0797,1.0862,1.1556,1.1674,1.1365,1.1155,1.1267,1.1714,1.1710,1.2298,1.2638,1.2640,1.2261,1.1989,1.2000,1.2146,1.2266,1.2191,1.2224,1.2507,1.2997,1.3406,1.3123,1.3013,1.3185,1.2943,1.2697,1.2155,1.2041,1.2295,1.2234,1.2022,1.1789,1.1861,1.2126,1.1940,1.2028,1.2273,1.2767,1.2661,1.2681,1.2810,1.2722,1.2617,1.2888,1.3205,1.2993,1.3080,1.3246,1.3513,1.3518,1.3421,1.3726,1.3626,1.3910,1.4233,1.4683,1.4559,1.4728,1.4759,1.5520,1.5754,1.5554,1.5562,1.5759,1.4955,1.4342,1.3266,1.2744,1.3511,1.3244,1.2797,1.3050,1.3199,1.3646,1.4014,1.4092,1.4266,1.4575,1.4821,1.4908,1.4579) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = 'Default' > #'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/1e65b1272902508.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/27x4e1272902508.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.305833096 -0.015410597 0.008071342 0.056983861 [6] 0.084135232 -0.055647357 -0.174327047 0.010966726 0.042239276 [11] -0.024925160 -0.040089956 -0.130756261 -0.054914963 0.093425780 [16] 0.039128924 -0.009767545 0.082998555 0.107913481 0.085632497 [21] -0.022343248 -0.095062425 > (mypacf <- c(rpacf$acf)) [1] 0.3058330959 -0.1201859373 0.0560882424 0.0391465076 0.0608599959 [6] -0.1079314757 -0.1280888732 0.1105621771 -0.0235439976 -0.0271011544 [11] -0.0002132152 -0.1217104390 -0.0039857324 0.0941144124 0.0063279279 [16] -0.0055304706 0.1107493100 0.0397750967 -0.0100783472 -0.0397975830 [21] -0.0405045310 > 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/3ay321272902508.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/4wy2q1272902508.tab") > > try(system("convert tmp/1e65b1272902508.ps tmp/1e65b1272902508.png",intern=TRUE)) character(0) > try(system("convert tmp/27x4e1272902508.ps tmp/27x4e1272902508.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.538 0.312 0.674