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(100.00,97.57,93.71,92.70,89.66,89.05,98.99,105.68,101.62,98.38,94.12,93.31,94.73,93.31,90.87,89.86,88.44,87.42,98.17,103.45,104.06,102.03,95.54,95.54,96.55,96.35,95.33,93.51,92.29,92.49,104.87,106.49,106.09,105.27,103.25,103.85,105.27,104.87,103.45,103.25,101.62,102.84,115.42,117.65,117.24,114.60,110.95,112.58,114.00,113.79,112.58,110.34,108.92,110.14,120.49,123.94,124.34,123.94,120.49,120.69,119.88,119.47,118.46,116.23,115.01,115.42,125.96,127.59,127.38,124.14,120.69,121.10,120.28,119.68,117.65,116.43,116.23,116.23,125.76,126.98,125.76,119.27,114.81,112.98,113.79,111.36,107.91,106.69,103.65,101.22,112.58,114.60,109.94,106.90,103.45,104.26,104.87,103.04,100.00,99.39,95.13,96.96,107.10,108.32,105.07,102.64,101.83,104.67) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > 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/1gl7h1261335888.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/2bq871261335888.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.0000000000 0.0126610590 -0.0095779318 0.0146586803 0.0716797756 [6] 0.1064143076 0.1006349614 0.0188440415 0.1031428446 0.1319031050 [11] -0.0342262061 0.0170751395 -0.1893720481 0.0497784565 0.2442015049 [16] -0.0221114472 -0.0114842917 -0.0715806935 0.0045865391 0.0407262103 [21] 0.0002384208 0.0222523015 0.0612104842 0.1472641878 -0.1169009894 [26] -0.1595991690 -0.2047783157 0.0588697597 -0.0223557315 0.1012732456 [31] -0.0831903224 -0.0734350427 0.0131984678 -0.0907186005 -0.0754625703 [36] -0.0450899039 0.0231732050 0.0640637912 0.0541409352 -0.1463944674 [41] -0.0852571906 0.0009994831 -0.0261948508 0.0556476592 -0.0800065076 [46] -0.0826281468 -0.0257359700 -0.1554601958 -0.0738192323 -0.0748308669 [51] 0.0468380139 -0.0164479043 -0.0135461389 -0.1725076070 0.0028864257 [56] -0.0891662753 -0.0213558301 0.0461574090 -0.0471884037 0.0095045680 [61] -0.0090926887 > (mypacf <- c(rpacf$acf)) [1] 1.266106e-02 -9.739796e-03 1.490825e-02 7.124038e-02 1.055165e-01 [6] 1.017452e-01 1.962187e-02 1.008673e-01 1.210367e-01 -5.419546e-02 [11] -3.002442e-03 -2.317285e-01 2.512280e-03 2.119099e-01 -3.858421e-02 [16] 1.834229e-02 -7.484976e-02 3.104608e-03 2.641170e-02 -6.905547e-03 [21] 8.373439e-02 2.294591e-05 1.386754e-01 -1.551239e-01 -1.933365e-01 [26] -1.498008e-01 -2.740141e-02 -8.253213e-02 1.347308e-01 -1.709770e-02 [31] 2.032830e-02 5.929055e-02 -2.691468e-02 -2.633731e-02 -1.440093e-03 [36] -3.826164e-02 -3.597999e-02 7.459808e-02 -2.420349e-02 -5.355340e-02 [41] 4.669836e-03 -6.365261e-02 -2.242512e-02 -1.742160e-02 -7.562702e-02 [46] -2.868921e-02 -6.850932e-02 8.700021e-03 -5.031342e-02 3.860979e-02 [51] -6.147040e-02 -1.033008e-01 -5.022764e-02 5.936680e-02 -3.501127e-02 [56] 1.832576e-02 5.735615e-02 -5.049110e-02 -2.579210e-02 -1.071353e-02 > 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/3504q1261335888.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/45b7s1261335888.tab") > > try(system("convert tmp/1gl7h1261335888.ps tmp/1gl7h1261335888.png",intern=TRUE)) character(0) > try(system("convert tmp/2bq871261335888.ps tmp/2bq871261335888.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.585 0.316 0.700