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(1576.23,1546.37,1545.05,1552.34,1594.3,1605.78,1673.21,1612.94,1566.34,1530.17,1582.54,1702.16,1701.93,1811.15,1924.2,2034.25,2011.13,2013.04,2151.67,1902.09,1944.01,1916.67,1967.31,2119.88,2216.38,2522.83,2647.64,2631.23,2693.41,3021.76,2953.67,2796.8,2672.05,2251.23,2046.08,2420.04,2608.89,2660.47,2493.98,2541.7,2554.6,2699.61,2805.48,2956.66,3149.51,3372.5,3379.33,3517.54,3527.34,3281.06,3089.65,3222.76,3165.76,3232.43,3229.54,3071.74,2850.17) > 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/html/rcomp/tmp/1dzsq1292007698.ps",horizontal=F,onefile=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/2o9st1292007698.ps",horizontal=F,onefile=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.951752271 0.880781203 0.807488532 0.736325266 [6] 0.673733407 0.617172583 0.560908574 0.495816522 0.432244954 [11] 0.375064177 0.324312805 0.278323765 0.232325761 0.202090546 [16] 0.181149121 0.164526568 0.142136591 0.114058637 0.083716995 [21] 0.035128612 -0.002453923 -0.035395532 -0.068181561 -0.103540148 [26] -0.144758498 -0.178648962 -0.209032230 -0.235612878 -0.251202875 [31] -0.255327407 -0.265808325 -0.281268363 -0.293231910 -0.321131048 [36] -0.351939602 -0.365659106 -0.372685864 -0.378215372 -0.393068215 [41] -0.402617208 -0.412029315 -0.416118935 -0.413127984 -0.400778450 [46] -0.376793238 -0.342709678 -0.304742469 -0.261594439 > (mypacf <- c(rpacf$acf)) [1] 0.9517522709 -0.2660275766 -0.0069904858 -0.0183509799 0.0454197360 [6] -0.0107704062 -0.0532981519 -0.1319112259 0.0270994635 0.0173800861 [11] 0.0018044109 -0.0274768702 -0.0565725122 0.1637145399 0.0157309960 [16] -0.0107386624 -0.1235755005 -0.0365746823 -0.0043742310 -0.2254572896 [21] 0.1427863290 -0.0870579336 -0.0192548930 -0.0656020395 -0.0771304245 [26] 0.0852217761 -0.0071051423 -0.0445991502 0.0788891000 0.0404844659 [31] -0.1649534329 -0.0059851423 -0.0780256360 -0.2117065817 0.0183334083 [36] 0.1868358645 -0.0963780156 -0.0792864524 -0.0691751074 0.0680273191 [41] 0.0232421985 -0.0004544482 -0.0021348154 0.0870191495 0.0100794939 [46] 0.1032979584 -0.0467252811 -0.0227609787 > 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/3998h1292007698.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/4uso51292007698.tab") > try(system("convert tmp/1dzsq1292007698.ps tmp/1dzsq1292007698.png",intern=TRUE)) character(0) > try(system("convert tmp/2o9st1292007698.ps tmp/2o9st1292007698.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.566 0.319 1.235