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(240,150,290,210,240,240,310,310,190,230,260,320,270,250,240,250,230,230,240,300,190,270,300,330,230,260,300,330,190,260,240,270,170,230,270,320,190,300,310,360,170,280,270,260,280,300,320,370,210,310,290,450,190,290,280,310,340,220,390,410,250,310,280,450,210,390,300,310,370,250,440,360,290,300,340,600,220,410,360,250,410,290,470,350,330,250,270,580,260,450,320,240,420,380,400,370,300,310,280,560,280,480,320,170,420,310,470,420) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/wessaorg/rcomp/tmp/1c4qh1313697992.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/2kq6f1313697992.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/3f6ec1313697992.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 -6.502365e-01 2.069003e-01 -5.702561e-02 -1.351825e-01 [6] 3.295863e-01 -3.887390e-01 3.203094e-01 -1.229630e-01 -2.377622e-02 [11] 1.462108e-01 -5.106350e-01 7.554702e-01 -4.950268e-01 1.690287e-01 [16] -4.700955e-02 -1.056027e-01 2.863420e-01 -3.555222e-01 2.801940e-01 [21] -9.271222e-02 -2.996252e-02 1.234365e-01 -3.977974e-01 5.675211e-01 [26] -3.646157e-01 1.358223e-01 -7.467008e-02 -1.382350e-02 1.599014e-01 [31] -2.467676e-01 1.910142e-01 -5.937349e-02 1.963534e-03 6.780856e-02 [36] -2.599801e-01 3.442513e-01 -1.918332e-01 5.674014e-02 -5.688264e-02 [41] 4.245225e-02 4.726669e-02 -1.172799e-01 9.560718e-02 -3.371158e-02 [46] 2.249428e-02 5.355434e-03 -1.374605e-01 1.907894e-01 -7.836501e-02 [51] 3.512287e-04 -2.453791e-02 3.842938e-02 -8.116334e-05 -2.283763e-02 [56] -4.786854e-03 3.569000e-02 -1.095819e-02 -1.818103e-02 -2.567842e-02 [61] 5.182451e-02 > (mypacf <- c(rpacf$acf)) [1] -0.6502364666 -0.3740644188 -0.2324548659 -0.4724759234 -0.0820521456 [6] -0.3337296233 -0.2356796830 -0.0393494654 0.0079948454 0.2582649563 [11] -0.5991709206 -0.0136740214 0.1187515105 -0.0312005022 -0.1183825890 [16] -0.0086351773 -0.0015298073 -0.0104277975 -0.0208693871 0.0670797850 [21] -0.0028206866 -0.0381297280 0.0040234431 -0.0260816647 -0.0259781716 [26] 0.0492997023 -0.1029823881 0.0955028397 -0.0319980021 0.0124487576 [31] -0.0501706914 -0.1199183774 -0.0669108205 -0.0572798206 0.0641680492 [36] -0.1215159565 -0.0267322366 -0.0205379965 -0.0250796338 0.0090306173 [41] -0.0595921004 -0.0046843181 0.0576280372 0.0505508575 0.0374269618 [46] -0.0005772138 -0.0469922011 -0.0364661652 -0.0197487740 -0.0958367394 [51] 0.0332498490 -0.0903824739 -0.0323242115 0.0449275555 -0.0012853481 [56] 0.0730567390 -0.0104091352 -0.0694532714 0.0335265885 0.0542369440 > 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/4secg1313697992.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/5sihz1313697992.tab") > > try(system("convert tmp/1c4qh1313697992.ps tmp/1c4qh1313697992.png",intern=TRUE)) character(0) > try(system("convert tmp/2kq6f1313697992.ps tmp/2kq6f1313697992.png",intern=TRUE)) character(0) > try(system("convert tmp/3f6ec1313697992.ps tmp/3f6ec1313697992.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.967 0.173 1.133