R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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 = '1' > 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/144001291666443.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/rcomp/tmp/244001291666443.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.0000000000 0.2811001687 -0.0497511159 -0.0676258911 -0.1335937517 [6] -0.1553634571 0.0607324465 0.0139583080 -0.1909481016 -0.1782623264 [11] -0.0678701123 -0.0385406148 0.0503641788 -0.1674292733 -0.0582473655 [16] 0.0168889042 0.1257124753 0.0921881226 0.1391359744 0.0772348450 [21] -0.1732349620 -0.0513216222 0.1594585797 0.0623059397 -0.0026873817 [26] 0.0136219031 -0.0536873634 -0.1243671944 -0.0474562839 0.0334873120 [31] 0.0558914301 0.0217232334 -0.0399833534 0.0268371926 -0.0434171329 [36] -0.0422927157 -0.0059113984 0.0219295728 -0.0464652563 -0.0191447498 [41] 0.0001258268 -0.0114587459 -0.0170472105 -0.0218982823 -0.0310344275 [46] -0.0194047182 -0.0074267303 0.0367463793 0.0382897074 > (mypacf <- c(rpacf$acf)) [1] 0.2811001687 -0.1398163303 -0.0137136248 -0.1273120120 -0.0971098712 [6] 0.1264839874 -0.0841321132 -0.2033150936 -0.1032942352 -0.0272212781 [11] -0.0338142271 -0.0027992718 -0.3427419528 0.0720594240 -0.0268467115 [16] 0.0854328735 -0.0865665635 0.0160906941 0.0705114411 -0.2094571819 [21] 0.0366453974 0.0972277431 -0.0097822433 -0.0212864284 0.0200057024 [26] -0.0461086715 0.0427863113 -0.1452877285 0.0990894884 0.0803346228 [31] 0.0021332031 -0.0081307007 -0.0366736894 -0.0517707015 0.0563463748 [36] -0.0517697191 0.0004022909 -0.0372226064 0.0024792539 -0.0592952666 [41] -0.1102444239 0.0709930230 -0.0585164350 -0.0578046703 -0.0596915015 [46] -0.0094702414 -0.0475626718 -0.0386557269 > 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/3heyq1291666443.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/4s5xb1291666443.tab") > > try(system("convert tmp/144001291666443.ps tmp/144001291666443.png",intern=TRUE)) character(0) > try(system("convert tmp/244001291666443.ps tmp/244001291666443.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.610 0.400 1.001