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 = '0' > 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/1rhuh1259937434.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/2f0o41259937434.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.9853085095 0.9657881172 0.9398091914 0.9111368241 [6] 0.8800966712 0.8491096546 0.8200854755 0.7904912699 0.7599666362 [11] 0.7265788390 0.6939035155 0.6554216196 0.6140807024 0.5729684778 [16] 0.5306074975 0.4908433271 0.4493296953 0.4100393938 0.3688889787 [21] 0.3277817807 0.2877739455 0.2503223936 0.2134723449 0.1773413594 [26] 0.1432788216 0.1076435263 0.0732220221 0.0374745586 0.0005893795 [31] -0.0370205607 -0.0742303342 -0.1100592259 -0.1448227904 -0.1773142955 [36] -0.2078531811 -0.2344809239 -0.2588663766 -0.2799684458 -0.2985484960 [41] -0.3164701143 -0.3326501411 -0.3478242983 -0.3620725176 -0.3755623391 [46] -0.3880573513 -0.3992585459 -0.4085594589 -0.4165201644 -0.4221509561 [51] -0.4266427117 -0.4294397548 -0.4308164098 -0.4317442847 -0.4307931538 [56] -0.4283346011 -0.4242694497 -0.4178276021 -0.4090437688 -0.3995092317 [61] -0.3893981960 > (mypacf <- c(rpacf$acf)) [1] 0.985308510 -0.172959760 -0.210630747 -0.048562049 -0.040216601 [6] 0.024719024 0.075241778 -0.060717019 -0.077918240 -0.115440108 [11] 0.043553026 -0.196007041 -0.081420527 0.079060830 -0.054164909 [16] 0.077021983 -0.103337792 -0.004542699 -0.106029714 -0.025839035 [21] 0.088070313 0.050229134 -0.035213181 -0.007949716 -0.026800088 [26] -0.105293168 -0.018485921 -0.031060468 -0.091882537 -0.039979451 [31] 0.044128062 -0.033397566 -0.051031834 -0.011435205 0.018195038 [36] 0.046132905 0.057899397 0.049413188 -0.009012377 -0.064301893 [41] 0.010608316 0.014363562 -0.056366570 -0.001486202 -0.014171233 [46] -0.022842657 -0.013846638 -0.018705450 -0.007239164 -0.081589540 [51] 0.052723103 0.022910742 -0.053942776 0.045476737 0.017875986 [56] 0.006312194 0.059877081 0.054288765 -0.030026595 -0.070812536 > 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/3sql81259937434.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/445051259937434.tab") > > system("convert tmp/1rhuh1259937434.ps tmp/1rhuh1259937434.png") > system("convert tmp/2f0o41259937434.ps tmp/2f0o41259937434.png") > > > proc.time() user system elapsed 0.614 0.325 3.357