R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(540,520,550,440,570,560,600,620,690,600,570,710,600,450,530,400,560,460,610,550,580,650,640,760,550,460,510,370,530,410,580,550,490,700,630,720,540,500,450,370,490,440,600,580,500,670,620,800,640,390,390,390,460,460,620,570,510,640,590,850,670,390,410,340,470,540,680,670,540,630,560,800,610,490,440,330,490,590,690,650,480,690,540,830,690,500,460,310,490,470,710,710,540,700,520,810,690,510,390,270,530,510,670,770,570,640,480,830) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '2' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/wessaorg/rcomp/tmp/10yxg1313737367.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/wessaorg/rcomp/tmp/23rzf1313737367.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/wessaorg/rcomp/tmp/3z1cc1313737367.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.046228221 -0.155225064 -0.087582050 -0.077096549 [6] -0.209619693 -0.004009401 -0.005639543 0.128560834 0.142564592 [11] 0.070817919 0.083437032 -0.357657379 -0.206237054 0.019626817 [16] 0.012115081 0.010872010 0.218659971 0.010192200 0.132613655 [21] -0.015382896 -0.081106363 0.006016087 0.010399710 -0.163272563 [26] 0.193830470 0.154657569 -0.029043939 -0.080883194 -0.080546511 [31] 0.021766124 -0.038632755 -0.140797558 0.017171508 0.058178988 [36] -0.067326523 0.134132981 -0.017772045 -0.140511414 0.037528710 [41] 0.145169080 -0.119357928 -0.016919417 -0.062776376 0.121812488 [46] 0.027760445 -0.058805075 -0.005228795 -0.021262392 -0.060089131 [51] 0.028786153 -0.009773098 -0.082573989 0.084889336 -0.007759181 [56] 0.050937138 -0.008202972 -0.060570910 -0.070864523 0.055968914 [61] -0.005644676 > (mypacf <- c(rpacf$acf)) [1] 0.046228221 -0.157699123 -0.073978442 -0.097006661 -0.237932813 [6] -0.031271478 -0.107925705 0.079699057 0.088333777 0.051505303 [11] 0.155570803 -0.366669002 -0.095861883 -0.046153795 -0.082774874 [16] 0.015186678 0.029870356 -0.067271108 0.149745498 -0.009000378 [21] 0.100057531 0.164688962 0.109622576 -0.192488658 0.136496257 [26] 0.098589925 -0.025140476 -0.086995743 -0.041606406 0.058850810 [31] 0.018758529 -0.120035348 0.020259745 -0.009751250 -0.012995507 [36] -0.067858019 -0.018634793 -0.013902486 0.021339294 0.057767553 [41] -0.172238725 -0.027723418 -0.091094272 -0.006566760 -0.037098896 [46] -0.060737697 -0.026844871 -0.162542101 0.032122768 -0.010467718 [51] -0.033020079 0.032866749 -0.049135811 0.055407930 0.038557090 [56] -0.057315675 0.019692985 -0.054013656 0.011003647 0.018025157 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/4x0l31313737367.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/wessaorg/rcomp/tmp/5rbd51313737367.tab") > > try(system("convert tmp/10yxg1313737367.ps tmp/10yxg1313737367.png",intern=TRUE)) character(0) > try(system("convert tmp/23rzf1313737367.ps tmp/23rzf1313737367.png",intern=TRUE)) character(0) > try(system("convert tmp/3z1cc1313737367.ps tmp/3z1cc1313737367.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.000 0.203 1.392