R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(356,355,354,352,372,371,356,346,347,347,348,350,353,350,343,346,373,363,349,350,353,356,355,346,349,348,342,342,379,375,363,361,363,373,367,360,358,367,357,346,386,383,367,354,363,370,361,354,363,366,353,351,389,385,364,348,347,352,342,338,343,354,329,320,353,345,324,310,314,313,310,301,294,296,274,269,292,287,271,256,260,265,263,256,246,245,220,224,240,238,222,203,209,214,216,214,206,196,169,177,193,183,164,142,141,137,140,146,136,124,105,114,135,123,100,74,64,57,62,64) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/rcomp/tmp/1i1e51282257035.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/rcomp/tmp/2i1e51282257035.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.963255888 0.924105086 0.892399184 0.864477100 [6] 0.832749557 0.803869722 0.782555239 0.760910908 0.730066295 [11] 0.698902438 0.680398146 0.662789933 0.630903610 0.596690475 [16] 0.569632850 0.545086022 0.514431178 0.486711205 0.465506996 [21] 0.443251443 0.413150355 0.382283206 0.365615003 0.350731296 [26] 0.324054726 0.297384718 0.276704626 0.256987129 0.229535431 [31] 0.204651956 0.185207374 0.163779864 0.135246319 0.105418697 [36] 0.089072925 0.072294546 0.046918484 0.022112596 0.003676061 [41] -0.013230440 -0.037110994 -0.058374024 -0.074342674 -0.090425911 [46] -0.114528789 -0.137350550 -0.148312626 -0.160786464 > (mypacf <- c(rpacf$acf)) [1] 0.963255888 -0.052078175 0.084188928 0.028874572 -0.061651468 [6] 0.035910373 0.079877575 -0.020679388 -0.116830452 -0.008476754 [11] 0.135560568 -0.013937450 -0.176753629 -0.033054396 0.034615468 [16] 0.007898902 -0.054864641 0.024363239 0.004828335 -0.037512350 [21] -0.045202192 -0.015289118 0.109518791 -0.012004816 -0.111910392 [26] 0.010708933 0.003623118 -0.004359964 -0.060050537 0.010782443 [31] -0.027905119 -0.055632841 -0.016292076 -0.031679998 0.071005179 [36] -0.051119875 -0.059897125 0.007644240 -0.005953519 0.014801627 [41] -0.045131120 0.001261926 -0.027010314 -0.020913648 -0.023648207 [46] 0.002809075 0.041624769 -0.057656037 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/398nq1282257035.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/rcomp/tmp/4c8me1282257035.tab") > > try(system("convert tmp/1i1e51282257035.ps tmp/1i1e51282257035.png",intern=TRUE)) character(0) > try(system("convert tmp/2i1e51282257035.ps tmp/2i1e51282257035.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.760 0.530 1.279