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(3030.29,2803.47,2767.63,2882.6,2863.36,2897.06,3012.61,3142.95,3032.93,3045.78,3110.52,3013.24,2987.1,2995.55,2833.18,2848.96,2794.83,2845.26,2915.02,2892.63,2604.42,2641.65,2659.81,2638.53,2720.25,2745.88,2735.7,2811.7,2799.43,2555.28,2304.98,2214.95,2065.81,1940.49,2042,1995.37,1946.81,1765.9,1635.25,1833.42,1910.43,1959.67,1969.6,2061.41,2093.48,2120.88,2174.56,2196.72,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,2466.92) > par7 = '0.95' > par6 = 'White Noise' > 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/1yaoo1261397942.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/21ahc1261397942.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.00000000 0.98065903 0.95177248 0.91997670 0.87954181 0.83111127 [7] 0.77558506 0.71995066 0.66332258 0.60091475 0.53718941 0.47769091 [13] 0.41544849 0.35298961 0.29265732 0.23599375 0.17955165 0.12102108 [19] 0.06749569 0.01925277 -0.02873186 -0.07365830 -0.11466056 -0.15165079 [25] -0.18224955 -0.21055326 -0.23491793 -0.25592477 -0.27646231 -0.29543852 [31] -0.31248495 -0.32787915 -0.34229173 -0.35832119 -0.37210745 -0.38380651 [37] -0.39201270 -0.39959448 -0.40561507 -0.40954492 -0.41378554 -0.41731428 [43] -0.42051427 -0.42065656 -0.41724153 -0.41317828 -0.40791828 -0.40089478 [49] -0.39174797 -0.38100799 -0.36727297 -0.35067156 -0.33139293 -0.30897889 [55] -0.28650982 -0.26320840 -0.23791456 -0.21250052 -0.18562116 -0.15796993 [61] -0.13023604 > (mypacf <- c(rpacf$acf)) [1] 9.806590e-01 -2.589457e-01 -3.192023e-02 -2.353257e-01 -1.455254e-01 [6] -1.573701e-01 7.426632e-02 -2.522015e-02 -1.209659e-01 -1.110905e-02 [11] 8.723902e-02 -1.561694e-01 2.475226e-02 -1.064574e-02 3.381633e-02 [16] -1.154319e-01 -6.404988e-02 6.269430e-02 3.512552e-03 -6.379723e-02 [21] 6.217506e-02 -5.277742e-02 -9.683776e-03 9.440269e-02 -2.165260e-02 [26] -3.865056e-02 -6.179725e-02 -4.284040e-02 -7.339470e-02 -4.272841e-02 [31] 1.315284e-02 -3.851180e-02 -1.135531e-01 4.236015e-02 -3.493946e-02 [36] 1.084394e-01 -9.044639e-02 4.534054e-02 -8.063469e-02 -9.720031e-02 [41] -7.571521e-04 -2.769777e-02 2.190360e-02 9.262425e-02 -6.318473e-02 [46] 6.794487e-03 -6.992158e-02 5.827342e-02 -1.581635e-02 3.870614e-02 [51] 6.789164e-05 -3.042006e-03 3.376224e-02 -6.443396e-02 -3.783008e-02 [56] 3.645606e-02 -4.248518e-02 5.450310e-02 1.463048e-02 -1.635358e-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/37luu1261397942.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/4ze561261397942.tab") > > try(system("convert tmp/1yaoo1261397942.ps tmp/1yaoo1261397942.png",intern=TRUE)) character(0) > try(system("convert tmp/21ahc1261397942.ps tmp/21ahc1261397942.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.581 0.309 0.704