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(17192.4,15386.1,14287.1,17526.6,14497,14398.3,16629.6,16670.7,16614.8,16869.2,15663.9,16359.9,18447.7,16889,16505,18320.9,15052.1,15699.8,18135.3,16768.7,18883,19021,18101.9,17776.1,21489.9,17065.3,18690,18953.1,16398.9,16895.6,18553,19270,19422.1,17579.4,18637.3,18076.7,20438.6,18075.2,19563,19899.2,19227.5,17789.6,19220.8,21968.9,21131.5,19484.6,22168.7,20866.8,22176.2,23533.8,21479.6,24347.7,22751.6,20328.3,23650.4,23335.7,19614.9,18042.3,17282.5,16847.2,18159.5) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > 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/160kr1260633749.ps",horizontal=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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2u9c01260633749.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 0.6949368111 0.6125271746 0.6571858933 0.5095553198 [6] 0.4540876351 0.4609582527 0.3152433829 0.2967333367 0.2814697604 [11] 0.1620792624 0.1844582249 0.2812530765 0.1062233830 0.0681822286 [16] 0.1006406913 0.0613946103 0.0301273045 0.0257751793 -0.0007918818 [21] -0.0468092241 -0.0478163541 -0.0596953337 -0.0415176559 0.0086570471 [26] -0.0134765485 -0.1045435331 -0.0681096552 -0.0325511466 -0.1090800689 [31] -0.1091309416 -0.0791977446 -0.1901311523 -0.1955827112 -0.2148079304 [36] -0.2731037250 -0.2367563739 -0.2463232919 -0.3316667233 -0.2788540314 [41] -0.2336164052 -0.2911687922 -0.2800459504 -0.2558608489 -0.3105479593 [46] -0.2896227569 -0.2784103014 -0.2854955825 -0.2198247044 -0.2183847748 [51] -0.2223840352 -0.1450245969 -0.0963097547 -0.0813850375 -0.0363489141 [56] 0.0080966398 0.0277381349 0.0373955456 0.0268434918 0.0110646647 [61] 0.0017493907 > (mypacf <- c(rpacf$acf)) [1] 0.6949368111 0.2506271888 0.3385007137 -0.1344979731 0.0084035761 [6] 0.0451983089 -0.1647785743 0.0492087614 -0.0234507009 -0.0821826564 [11] 0.0907097854 0.2669978106 -0.2552230427 -0.1269468337 -0.0349459169 [16] 0.1621103351 -0.0722375949 -0.0738107692 0.0934966537 -0.1471259049 [21] 0.0260699359 0.0723905943 0.0728403160 -0.0500072918 0.0914296983 [26] -0.2017954980 -0.0352225723 0.0406666649 -0.0363905142 -0.0546862684 [31] 0.0012282066 -0.0688967526 -0.0977567911 -0.0947461865 -0.0466498051 [36] 0.0239646905 -0.0241389103 0.0777804917 -0.0372061906 -0.0015177986 [41] -0.0317159217 -0.0818387294 -0.0783020969 -0.0014389718 0.0418927174 [46] -0.0295020284 0.0073998275 0.0630383131 -0.0261754538 0.0376769783 [51] 0.1248543561 -0.0331424180 0.0001579378 0.0538178065 0.0348305511 [56] -0.0393211048 0.0246411939 -0.0645282530 -0.1444414757 -0.0650318556 > 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/3vrau1260633749.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/4qst91260633749.tab") > > try(system("convert tmp/160kr1260633749.ps tmp/160kr1260633749.png",intern=TRUE)) character(0) > try(system("convert tmp/2u9c01260633749.ps tmp/2u9c01260633749.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.561 0.325 0.742