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(100 + ,108.1560276 + ,114.0150276 + ,102.1880309 + ,110.3672031 + ,96.8602511 + ,94.1944583 + ,99.51621961 + ,94.06333487 + ,97.5541476 + ,78.15062422 + ,81.2434643 + ,92.36262465 + ,96.06324371 + ,114.0523777 + ,110.6616666 + ,104.9171949 + ,90.00187193 + ,95.7008067 + ,86.02741157 + ,84.85287668 + ,100.04328 + ,80.91713823 + ,74.06539709 + ,77.30281369 + ,97.23043249 + ,90.75515676 + ,100.5614455 + ,92.01293267 + ,99.24012138 + ,105.8672755 + ,90.9920463 + ,93.30624423 + ,91.17419413 + ,77.33295039 + ,91.1277721 + ,85.01249943 + ,83.90390242 + ,104.8626302 + ,110.9039108 + ,95.43714373 + ,111.6238727 + ,108.8925403 + ,96.17511682 + ,101.9740205 + ,99.11953031 + ,86.78158147 + ,118.4195003 + ,118.7441447 + ,106.5296192 + ,134.7772694 + ,104.6778714 + ,105.2954304 + ,139.4139849 + ,103.6060491 + ,99.78182974 + ,103.4610301 + ,120.0594945 + ,96.71377168 + ,107.1308929 + ,105.3608372 + ,111.6942359 + ,132.0519998 + ,126.8037879 + ,154.4824253 + ,141.5570984 + ,109.9506882 + ,127.904198 + ,133.0888617 + ,120.0796299 + ,117.5557142 + ,143.0362309 + ,159.982927 + ,128.5991124 + ,149.7373327 + ,126.8169313 + ,140.9639674 + ,137.6691981 + ,117.9402337 + ,122.3095247 + ,127.7804207 + ,136.1677176 + ,116.2405856 + ,123.1576893 + ,116.3400234 + ,108.6119282 + ,125.8982264 + ,112.8003105 + ,107.5182447 + ,135.0955413 + ,115.5096488 + ,115.8640759 + ,104.5883906 + ,163.7213386 + ,113.4482275 + ,98.0428844 + ,116.7868521 + ,126.5330444 + ,113.0336597 + ,124.3392163 + ,109.8298759 + ,124.4434777 + ,111.5039454 + ,102.0350019 + ,116.8726598 + ,112.2073122 + ,101.1513902 + ,124.4255108) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1lqld1259939703.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/2o04d1259939703.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.000000000 -0.339641365 -0.224507608 0.093507318 0.140126436 [6] -0.191564435 -0.027924733 0.098890218 0.022235363 -0.081154198 [11] 0.059105285 0.196451544 -0.306458246 -0.080166739 0.155303457 [16] 0.105926115 -0.236498290 0.124074611 0.037831961 0.089504561 [21] -0.181858742 0.053224869 0.033730442 0.060806076 -0.205430906 [26] 0.127548088 0.113779610 -0.157091904 -0.027137548 0.158102608 [31] 0.001141420 -0.260372000 0.218075255 0.010604733 -0.113588987 [36] -0.039303863 0.173276901 > (mypacf <- c(rpacf$acf)) [1] -0.339641365 -0.384181619 -0.189004408 0.028168216 -0.141358873 [6] -0.138580189 -0.081850819 -0.023047524 -0.038778331 0.021228201 [11] 0.263503444 -0.107887676 -0.210494558 -0.168906239 0.024905483 [16] -0.088684354 0.014967903 -0.092140762 0.127616182 -0.020329877 [21] -0.010273602 -0.010041428 0.251698678 -0.106660869 -0.112998583 [26] 0.008611114 0.023834183 -0.106304833 0.045112250 0.092877784 [31] -0.075261795 0.052516335 -0.014195395 -0.088438977 0.089609689 [36] -0.023385492 > 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/3fkhy1259939703.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/4mzbp1259939703.tab") > system("convert tmp/1lqld1259939703.ps tmp/1lqld1259939703.png") > system("convert tmp/2o04d1259939703.ps tmp/2o04d1259939703.png") > > > proc.time() user system elapsed 0.544 0.314 0.645