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(1070,1240,1200,1280,1180,1190,1190,1230,1170,1190,1190,1400,1130,1260,1260,1260,1130,1220,1180,1280,1140,1160,1170,1410,1100,1280,1330,1260,1070,1260,1270,1410,1160,1130,1160,1300,1080,1380,1260,1250,990,1180,1240,1500,1150,1110,1080,1270,1050,1490,1280,1230,960,1100,1270,1530,1290,1120,1100,1310,1020,1510,1260,1160,970,1020,1210,1530,1350,1070,1140,1250,930,1510,1230,1180,960,960,1240,1640,1350,1100,1120,1290,890,1560,1250,1170,900,860,1310,1610,1440,1130,1220,1400,930,1490,1250,1160,910,880,1300,1550,1460,1120,1270,1410) > 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/wessaorg/rcomp/tmp/124er1311165379.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/2v0uw1311165379.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/37r3d1311165379.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.0000000000 0.0416299681 -0.2281250407 -0.4371127021 -0.0509651130 [6] 0.0597285242 0.3362192982 0.0362602478 -0.0465010440 -0.3946051743 [11] -0.2281332501 -0.0181949910 0.8431333615 0.0502399917 -0.1776362784 [16] -0.3840425951 -0.0457131464 0.0415341233 0.3078251224 0.0375427620 [21] 0.0013694313 -0.3332562932 -0.2102534746 -0.0531787533 0.6480794457 [26] 0.0434275198 -0.1159724640 -0.3061130768 -0.0341218774 0.0148429885 [31] 0.2368669279 0.0231829740 0.0460351603 -0.2458529166 -0.1777103683 [36] -0.0695712926 0.4879009281 0.0237277193 -0.0619390860 -0.2461633860 [41] -0.0198485960 -0.0004846884 0.1673827320 0.0063111081 0.0837917516 [46] -0.1566088889 -0.1461914879 -0.0688216713 0.3362357684 > (mypacf <- c(rpacf$acf)) [1] 0.0416299681 -0.2302571431 -0.4398875976 -0.1336901943 -0.1937410575 [6] 0.1185857787 -0.0374013181 0.0368118893 -0.2800985673 -0.3589637518 [11] -0.3918721469 0.6859643000 -0.2080154234 0.0708536906 0.1787477905 [16] -0.0383777339 -0.0790195635 -0.0263524825 0.0207971686 0.0496266033 [21] -0.0009875354 0.0637154467 0.0796919627 -0.2678461997 0.0153231066 [26] 0.0275374708 -0.0514316219 0.0066486541 0.0389787385 -0.1070934942 [31] -0.0615962609 -0.0611661966 0.0362520640 -0.0468969724 -0.0245359555 [36] 0.0801931560 -0.0762372470 -0.0420727807 -0.0676204015 -0.0212703997 [41] -0.0376446716 -0.0471521129 0.0164960641 0.0454366372 -0.0290711589 [46] -0.0325127294 0.0623259982 -0.1673555254 > 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/469ur1311165379.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/5eqmc1311165379.tab") > > try(system("convert tmp/124er1311165379.ps tmp/124er1311165379.png",intern=TRUE)) character(0) > try(system("convert tmp/2v0uw1311165379.ps tmp/2v0uw1311165379.png",intern=TRUE)) character(0) > try(system("convert tmp/37r3d1311165379.ps tmp/37r3d1311165379.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.937 0.178 1.110