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(4716.99,4926.65,4920.10,5170.09,5246.24,5283.61,4979.05,4825.20,4695.12,4711.54,4727.22,4384.96,4378.75,4472.93,4564.07,4310.54,4171.38,4049.38,3591.37,3720.46,4107.23,4101.71,4162.34,4136.22,4125.88,4031.48,3761.36,3408.56,3228.47,3090.45,2741.14,2980.44,3104.33,3181.57,2863.86,2898.01,3112.33,3254.33,3513.47,3587.61,3727.45,3793.34,3817.58,3845.13,3931.86,4197.52,4307.13,4229.43,4362.28,4217.34,4361.28,4327.74,4417.65,4557.68,4650.35,4967.18,5123.42,5290.85,5535.66,5514.06,5493.88,5694.83,5850.41,6116.64,6175.00,6513.58,6383.78,6673.66,6936.61,7300.68,7392.93,7497.31,7584.71,7160.79,7196.19,7245.63,7347.51,7425.75,7778.51,7822.33,8181.22,8371.47,8347.71,8672.11,8802.79,9138.46,9123.29,9023.21,8850.41,8864.58,9163.74,8516.66,8553.44,7555.20,7851.22,7442.00,7992.53,8264.04,7517.39,7200.40,7193.69,6193.58,5104.21,4800.46,4461.61,4398.59,4243.63,4293.82) > par7 = '0.95' > par6 = 'MA' > 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/1w32d1259938735.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/20ss41259938735.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.217743538 0.296301254 0.146802602 0.156253891 [6] 0.044642717 0.044411795 0.154128912 0.029520344 0.170107280 [11] 0.079663288 0.177894254 0.043704431 0.059225713 0.020680592 [16] 0.010538790 0.058147453 -0.011111181 -0.004180922 0.010569422 [21] 0.016434848 -0.092739506 -0.015493669 -0.079013100 -0.105688910 [26] 0.013607409 -0.071518720 -0.001711301 -0.017764378 0.013754361 [31] -0.098189360 -0.045596830 -0.046473841 -0.094775779 -0.116066510 [36] -0.100513537 -0.085925768 -0.139577810 -0.094607218 -0.071735951 [41] -0.097400228 -0.077032569 -0.017394577 -0.077188429 -0.041649824 [46] -0.067615882 -0.092347628 -0.092619559 -0.083406215 -0.058471357 [51] -0.093372400 -0.087317083 -0.032889767 -0.112289735 -0.068900464 [56] -0.059100312 -0.099882763 -0.079742973 -0.030333610 -0.006455809 [61] -0.079869227 > (mypacf <- c(rpacf$acf)) [1] 0.217743538 0.261276723 0.047603120 0.055280082 -0.041934005 [6] -0.018399468 0.153073783 -0.029670566 0.115795568 0.018941425 [11] 0.082477023 -0.032687119 -0.037515048 -0.021858966 -0.005662603 [16] 0.046015224 -0.028005010 -0.071359960 0.026327941 -0.011460159 [21] -0.109404300 0.003540197 -0.054703498 -0.068776302 0.108322553 [26] -0.060465744 0.011812627 0.044954450 -0.004978066 -0.077653353 [31] -0.007184556 0.014621549 -0.032039602 -0.074044385 -0.029063032 [36] -0.052658489 -0.040205867 -0.042511250 0.001709121 -0.020741013 [41] -0.005847350 0.051047444 -0.028992423 -0.005687001 -0.017761266 [46] -0.032044547 -0.036471627 -0.014060782 0.029730938 -0.040587587 [51] -0.066377537 0.041900174 -0.099044925 -0.031648905 0.019086173 [56] -0.089519608 -0.015184184 0.031516097 0.024324609 -0.070325261 > 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/3nkz91259938735.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/4nuib1259938735.tab") > > system("convert tmp/1w32d1259938735.ps tmp/1w32d1259938735.png") > system("convert tmp/20ss41259938735.ps tmp/20ss41259938735.png") > > > proc.time() user system elapsed 0.600 0.324 0.714