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(493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,558,575,580,575,563,552,537,545,601,604,586,564,549) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > 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/www/html/rcomp/tmp/1b0qn1292772837.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/2mrp81292772837.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/3mrp81292772837.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.000000e+00 1.494714e-01 1.211187e-01 1.171754e-01 1.384499e-01 [6] 1.558613e-01 1.265281e-01 5.302472e-02 1.046307e-01 1.374166e-01 [11] -6.776820e-02 -2.046990e-02 -2.172902e-01 -1.943676e-02 1.633090e-01 [16] -3.159001e-02 -5.463734e-02 -9.163840e-02 -3.545796e-02 4.035691e-03 [21] -6.527629e-02 -9.831517e-02 -3.425026e-02 2.383317e-02 -1.855555e-01 [26] -1.516899e-01 -2.395301e-01 -7.711741e-02 -1.073742e-01 -1.765599e-02 [31] -1.263470e-01 -7.985593e-02 -2.396510e-02 -4.253601e-02 -4.667202e-02 [36] 5.067357e-03 3.693423e-02 6.718544e-02 7.546960e-02 -8.570126e-02 [41] -3.945878e-02 1.789379e-02 2.874682e-02 2.845441e-02 -3.470620e-02 [46] -8.010710e-02 -2.550583e-02 -1.117315e-01 -4.596542e-02 -5.065899e-02 [51] 1.322463e-02 7.421913e-05 1.982991e-02 -6.430236e-02 4.344466e-02 [56] -4.126341e-02 -1.268074e-03 4.195288e-02 -2.776273e-02 -1.792448e-02 [61] 1.693883e-02 > (mypacf <- c(rpacf$acf)) [1] 0.1494714054 0.1010343185 0.0886647849 0.1038545068 0.1113280716 [6] 0.0691442925 -0.0118017599 0.0537465741 0.0815597228 -0.1492467432 [11] -0.0569018203 -0.2599906629 0.0012035223 0.2135661625 -0.0164822770 [16] -0.0054622090 -0.0708378176 0.0036343577 0.0478493452 -0.0506326921 [21] -0.0284712713 -0.0911810433 0.0101025707 -0.2041930536 -0.1035450362 [26] -0.0816048531 -0.0099359775 -0.0725653094 0.1048664641 -0.0079843582 [31] 0.0665632395 0.0563386670 0.0247202400 -0.0172388225 0.0773772000 [36] -0.0663263356 -0.0318782662 0.0110092707 -0.1164513569 -0.0826868548 [41] 0.0001269326 0.0052730997 0.0128609775 -0.0018445833 -0.0780205320 [46] -0.0584170318 -0.0678688087 -0.0080745385 -0.0565842524 0.0213151250 [51] -0.0718673431 -0.0612389149 0.0232504269 0.0906063353 -0.0419233820 [56] -0.0213509604 -0.0100772405 -0.0699400730 -0.0245240620 0.0255572618 > 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/401nh1292772837.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/53kln1292772837.tab") > > try(system("convert tmp/1b0qn1292772837.ps tmp/1b0qn1292772837.png",intern=TRUE)) character(0) > try(system("convert tmp/2mrp81292772837.ps tmp/2mrp81292772837.png",intern=TRUE)) character(0) > try(system("convert tmp/3mrp81292772837.ps tmp/3mrp81292772837.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.751 0.465 1.714