R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(186448,190530,194207,190855,200779,204428,207617,212071,214239,215883,223484,221529,225247,226699,231406,232324,237192,236727,240698,240688,245283,243556,247826,245798,250479,249216,251896,247616,249994,246552,248771,247551,249745,245742,249019,245841,248771,244723,246878,246014,248496,244351,248016,246509,249426,247840,251035,250161,254278,250801,253985,249174,251287,247947,249992,243805,255812,250417,253033,248705,253950,251484,251093,245996,252721,248019,250464,245571,252690,250183,253639,254436,265280,268705,270643,271480) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '4' > 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/rcomp/tmp/19hbb1292426222.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/rcomp/tmp/218af1292426222.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/rcomp/tmp/318af1292426222.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.2295365086 0.0529570863 0.3448279756 -0.3929719331 [6] 0.1471142411 0.0082445098 -0.1579277922 0.1087951540 0.0174948458 [11] -0.0129941768 0.0222937541 -0.0187348880 -0.0626550811 0.0814562461 [16] 0.0539965558 0.0253849027 0.1012394695 -0.1010024801 -0.0007745028 [21] -0.1039898784 -0.0785028260 -0.0065846557 -0.0685220629 0.1008659353 [26] 0.0917501028 -0.0320049256 0.0863628676 -0.0690216718 -0.0148537186 [31] 0.0407237033 -0.0624906398 0.1089227199 -0.0108792996 -0.0104281015 [36] 0.0426408247 -0.0572760584 -0.0190166640 0.0381806894 -0.0526184478 [41] 0.0554994205 0.0961103982 -0.0885624497 0.0349594261 -0.0578308390 [46] -0.2323378181 0.1426940717 -0.0939198262 -0.1789566685 0.2447520308 [51] -0.1939891587 0.0713751431 0.0518294088 -0.1648665010 0.1100892060 [56] -0.0947192987 0.0097119902 0.0526449620 -0.0845657124 0.0164842592 [61] -0.0520866380 > (mypacf <- c(rpacf$acf)) [1] -0.2295365086 0.0002850986 0.3769034814 -0.2853171442 -0.0285105829 [6] -0.0335316423 0.0628983880 -0.0719515060 0.1009026795 0.0315678951 [11] -0.0379278397 -0.0721960555 -0.0403899806 0.1141507783 0.1207094571 [16] 0.0764516651 0.0171244462 -0.1355005885 -0.0586989720 -0.1518814496 [21] 0.0212099618 -0.0297932087 0.0207840935 0.0380443695 0.1481414526 [26] -0.0430260774 0.0043335803 -0.0794244039 0.0595878490 -0.0133886059 [31] -0.0025203955 0.0786095599 0.0224994649 -0.0153528269 -0.0124317748 [36] 0.0452959481 0.0129822180 0.0303171563 -0.0763235779 -0.0190587981 [41] 0.0532349711 -0.0675098932 -0.0195545786 -0.0795953311 -0.1720026963 [46] 0.0600879595 0.0507984244 -0.1935434546 0.0071240662 -0.0539092936 [51] 0.1357815792 -0.1374174299 0.0421205729 0.0117551139 -0.0349457104 [56] -0.0644099837 -0.0027372744 0.0125822681 -0.0173871793 -0.0270652391 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/4fiqn1292426222.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/rcomp/tmp/5jiob1292426222.tab") > > try(system("convert tmp/19hbb1292426222.ps tmp/19hbb1292426222.png",intern=TRUE)) character(0) > try(system("convert tmp/218af1292426222.ps tmp/218af1292426222.png",intern=TRUE)) character(0) > try(system("convert tmp/318af1292426222.ps tmp/318af1292426222.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.860 0.580 1.438