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(547.344,554.788,562.325,560.854,555.332,543.599,536.662,542.722,593.530,610.763,612.613,611.324,594.167,595.454,590.865,589.379,584.428,573.100,567.456,569.028,620.735,628.884,628.232,612.117,595.404,597.141,593.408,590.072,579.799,574.205,572.775,572.942,619.567,625.809,619.916,587.625,565.742,557.274,560.576,548.854,531.673,525.919,511.038,498.662,555.362,564.591,541.657,527.070,509.846,514.258,516.922,507.561,492.622,490.243,469.357,477.580,528.379,533.590,517.945,506.174,501.866,516.141,528.222,532.638,536.322,536.535,523.597,536.214,586.570,596.594,580.523,564.478,557.560,575.093,580.112,574.761,563.250,551.531,537.034,544.686,600.991,604.378,586.111,563.668,548.604) > par8 = '' > 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: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #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 (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > 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/1xln31293525577.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2qd5o1293525577.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=mysub) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/30mmr1293525577.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',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 0.874937347 0.683681352 0.558535937 0.522032462 [6] 0.544649547 0.537221227 0.470376590 0.375011143 0.333866052 [11] 0.368081063 0.461674993 0.493368043 0.331304299 0.131197247 [16] -0.001547059 -0.050037366 -0.048881428 -0.074791545 -0.147312142 [21] -0.233622341 -0.262453698 -0.224275411 -0.138636374 -0.107671565 [26] -0.229954546 -0.375282687 -0.453577954 -0.455881265 -0.414300889 [31] -0.395582196 -0.415210017 -0.443813187 -0.419175244 -0.339626746 [36] -0.225292886 -0.162607827 -0.224475159 -0.299037105 -0.318404060 [41] -0.284355004 -0.226561982 -0.195389139 -0.196510706 -0.204833779 [46] -0.170326368 -0.093319528 -0.001829084 0.046234371 > (mypacf <- c(rpacf$acf)) [1] 0.874937347 -0.348995180 0.276533475 0.150881916 0.165978497 [6] -0.129583818 -0.042990754 -0.053288158 0.205380544 0.090084751 [11] 0.271758308 -0.276705788 -0.659477180 0.187336124 -0.130557321 [16] -0.117113593 -0.093634455 0.003730403 0.017630378 0.015364992 [21] 0.033942249 0.001689828 -0.030098980 0.066635546 -0.077367258 [26] -0.039055865 0.021547952 -0.047102304 0.048841412 0.004684993 [31] 0.020790915 -0.016374919 0.039756285 0.009442458 0.011052865 [36] -0.007124381 0.035083701 0.025440177 -0.047277469 -0.085346053 [41] -0.073494185 -0.033393287 -0.022383331 -0.072772481 -0.060924677 [46] 0.015556941 -0.128169333 0.127265973 > 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/4442e1293525577.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/5wekh1293525577.tab") > > try(system("convert tmp/1xln31293525577.ps tmp/1xln31293525577.png",intern=TRUE)) character(0) > try(system("convert tmp/2qd5o1293525577.ps tmp/2qd5o1293525577.png",intern=TRUE)) character(0) > try(system("convert tmp/30mmr1293525577.ps tmp/30mmr1293525577.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.708 0.464 15.913