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(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) > 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/1kiqz1260724074.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/2malw1260724074.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.000000e+00 2.976746e-01 1.049527e-01 2.337439e-01 2.441534e-01 [6] 2.616350e-01 -1.146960e-02 -2.475551e-02 1.528317e-01 4.349865e-02 [11] -1.294608e-01 1.358350e-01 1.085734e-02 -3.485980e-02 8.181242e-02 [16] -2.403915e-02 6.350454e-02 -1.088570e-01 -1.686504e-01 1.252534e-02 [21] -1.001364e-01 -1.652156e-01 -1.517322e-01 -1.174610e-01 -9.319932e-02 [26] -2.392840e-02 -9.954271e-02 -2.152475e-02 6.038213e-02 -2.057528e-02 [31] -2.074569e-02 -5.412701e-02 -2.329088e-02 -5.782706e-02 -8.580078e-02 [36] -1.394680e-01 -4.180983e-02 -2.188666e-02 -6.542582e-02 -5.859352e-02 [41] -7.389871e-02 -9.585722e-03 1.796916e-03 -1.612485e-02 -2.517919e-02 [46] -6.720705e-02 -5.375939e-02 -7.417134e-02 -5.986678e-02 -7.166699e-02 [51] -7.899773e-03 -2.146094e-02 -2.120266e-02 2.529137e-03 -7.384775e-06 [56] 4.506922e-02 -4.356187e-03 1.665164e-02 2.106668e-02 2.467888e-02 [61] 1.673474e-02 > (mypacf <- c(rpacf$acf)) [1] 0.297674565 0.017931444 0.217018213 0.134656240 0.174517425 [6] -0.194225397 -0.056242269 0.079529758 -0.050041222 -0.152563431 [11] 0.290473737 -0.141157418 -0.026611016 0.151575234 -0.056823781 [16] -0.065759095 -0.110342072 -0.071339379 -0.035566990 -0.082079562 [21] 0.053342752 -0.129049570 0.014742616 0.005756008 0.075857079 [26] -0.011587470 0.020808104 0.094523608 -0.010587539 -0.147509600 [31] 0.049766136 -0.040672113 -0.132737663 0.028633126 -0.073532302 [36] 0.018769975 0.032974457 0.062795920 -0.115002805 -0.077789628 [41] 0.039896297 -0.040533669 -0.022517660 0.035444749 -0.106338577 [46] 0.013080237 -0.079015922 0.018469515 0.015437748 0.070251904 [51] -0.006135607 -0.001236652 -0.049362584 0.024555762 -0.044988834 [56] -0.029657584 -0.070095589 0.042980571 0.015707565 0.024318948 > 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/3fgs21260724074.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/4owda1260724074.tab") > > try(system("convert tmp/1kiqz1260724074.ps tmp/1kiqz1260724074.png",intern=TRUE)) character(0) > try(system("convert tmp/2malw1260724074.ps tmp/2malw1260724074.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.581 0.311 0.686