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(0.96,1,1.05,1.03,1.07,1.12,1.1,1.06,1.11,1.08,1.07,1.02,1,1.04,1.02,1.07,1.12,1.08,1.02,1.01,1.04,0.98,0.95,0.94,0.94,0.96,0.97,1.03,1.01,0.99,1,1,1.02,1.01,0.99,0.98,1.01,1.03,1.03,1,0.96,0.97,0.98,1.02,1.04,1.01,1.01,1,1.01,1.02,1.03,1.06,1.12,1.12,1.13,1.13,1.13,1.17,1.14,1.08,1.07,1.12,1.14,1.21,1.2,1.23,1.29,1.31,1.37,1.35,1.26,1.26,1.28,1.28,1.27,1.35,1.37,1.37,1.4,1.4,1.28,1.23,1.23,1.25,1.21,1.22,1.29,1.32,1.36,1.36,1.37,1.32,1.33,1.36,1.42,1.39,1.42,1.4,1.42,1.44,1.49,1.54,1.55,1.47,1.47,1.35,1.2,1.12,1.11,1.15,1.17,1.2,1.24) > 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: 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/13wg71260997738.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/2nwof1260997738.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.959709957 0.904145896 0.852230468 0.799710883 [6] 0.756046796 0.730948455 0.715869274 0.699988804 0.687594157 [11] 0.680744448 0.662604085 0.623323703 0.580883725 0.551206975 [16] 0.517562353 0.484310781 0.460019501 0.441389799 0.424701052 [21] 0.415149800 0.416650758 0.411731374 0.395632812 0.373551609 [26] 0.346802392 0.306965543 0.258022602 0.214772221 0.177581633 [31] 0.144451561 0.119622646 0.099393097 0.083387178 0.059749566 [36] 0.034213827 0.003131327 -0.037374682 -0.078429869 -0.114961322 [41] -0.149237742 -0.177905741 -0.205034341 -0.227489762 -0.241983618 [46] -0.251960423 -0.258825927 -0.268001442 -0.283082445 > (mypacf <- c(rpacf$acf)) [1] 0.959709957 -0.214006975 0.055741590 -0.062148063 0.101722707 [6] 0.171553504 0.049965787 -0.036170066 0.054670589 0.080058357 [11] -0.122881795 -0.217035214 0.010681553 0.182719843 -0.113310115 [16] -0.069824489 -0.012667681 0.081257635 0.056938625 0.007363151 [21] 0.078328199 -0.023704562 -0.019760050 -0.107463028 -0.079631716 [26] -0.106915305 -0.089814327 -0.028096622 -0.015268729 -0.029581244 [31] -0.042741172 -0.070104627 0.112494550 -0.063330520 -0.028454998 [36] -0.085424830 -0.025759133 0.052414750 -0.070013232 -0.099193878 [41] 0.033087940 -0.083342272 -0.015125922 0.019597782 0.023086332 [46] 0.067498329 -0.067233157 0.003535022 > 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/3fz2e1260997738.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/4c29h1260997738.tab") > > try(system("convert tmp/13wg71260997738.ps tmp/13wg71260997738.png",intern=TRUE)) character(0) > try(system("convert tmp/2nwof1260997738.ps tmp/2nwof1260997738.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.582 0.328 0.698