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(1322.4,1089.2,1147.3,1196.4,1190.2,1146,1139.8,1045.6,1050.9,1117.3,1120,1052.1,1065.8,1092.5,1422,1367.5,1136.3,1293.7,1154.8,1206.7,1199,1265,1247.1,1116.5,1153.9,1077.4,1132.5,1058.8,1195.1,1263.4,1023.1,1141,1116.3,1135.6,1210.5,1230,1136.5,1068.7,1372.5,1049.9,1302.2,1305.9,1173.5,1277.4,1238.6,1508.6,1423.4,1375.1,1344.1,1287.5,1446.9,1451,1604.4,1501.5,1522.8,1328,1420.5,1648,1631.1,1396.6,1663.4,1283,1582.4,1785.2,1853.6,1994.1,2042.8,1586.1,1942.4,1763.6,1819.9,1836,1449.9,1513.3,1677.7,1494.4,1375.3,1577.7,1537.7,1356.6,1469.6) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1ks891261050488.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/2n5251261050488.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.78682949 0.76064172 0.74292677 0.66992794 0.68973087 [7] 0.67603781 0.58978603 0.53750317 0.48038865 0.43168733 0.44053888 [13] 0.44371371 0.34733698 0.35346816 0.26932324 0.24252826 0.25752360 [19] 0.21318767 0.19078206 0.16154174 0.10162562 0.07563654 0.07373779 [25] 0.04859878 0.01574500 -0.02663640 -0.09690805 -0.07464473 -0.11550851 [31] -0.11626683 -0.13328160 -0.18060632 -0.20578403 -0.23207667 -0.23339520 [37] -0.22552112 > (mypacf <- c(rpacf$acf)) [1] 0.786829489 0.371597042 0.226763054 -0.034031759 0.173957957 [6] 0.106642642 -0.164211171 -0.173175352 -0.099422527 -0.030920866 [11] 0.100576653 0.167955160 -0.159909210 0.072914848 -0.134679816 [16] -0.002383228 -0.002688401 -0.031017349 0.002585683 -0.003915562 [21] -0.027048298 -0.064806190 0.002991547 -0.014537077 -0.038082341 [26] -0.134329566 -0.076960359 0.113682545 -0.041794112 0.059564930 [31] -0.058519411 -0.003625257 -0.038104899 -0.090819224 -0.008649650 [36] 0.032394044 > 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/3rbnq1261050488.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/4tqf51261050488.tab") > > try(system("convert tmp/1ks891261050488.ps tmp/1ks891261050488.png",intern=TRUE)) character(0) > try(system("convert tmp/2n5251261050488.ps tmp/2n5251261050488.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.528 0.326 0.655