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(1111.92,1131.13,1144.94,1113.89,1107.30,1120.68,1140.84,1101.72,1104.24,1114.58,1130.20,1173.78,1211.92,1181.27,1203.60,1180.59,1156.85,1191.50,1191.33,1234.18,1220.33,1228.81,1207.01,1249.48,1248.29,1280.08,1280.66,1302.88,1310.61,1270.05,1270.06,1278.53,1303.80,1335.83,1377.76,1400.63,1418.03,1437.90,1406.80,1420.83,1482.37,1530.63,1504.66,1455.18,1473.96,1527.29,1545.79,1479.63,1467.97,1378.60,1330.45,1326.41,1385.97,1399.62,1276.69,1269.42,1287.83,1164.17,968.67,888.61) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > 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/17kz61259769460.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/274ix1259769460.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.358485493 -0.046456947 0.023550660 0.230284699 [6] 0.089081228 -0.027396078 0.128685600 0.162083352 0.111455783 [11] 0.052991128 0.186085884 0.017100364 -0.102762898 -0.077007569 [16] 0.050866730 0.041367121 -0.120113307 -0.125682715 -0.047131094 [21] 0.007749434 -0.009626500 -0.033752997 -0.080025293 -0.162653891 [26] -0.051250713 -0.084190273 -0.030412970 0.029906568 0.065611469 [31] -0.047434115 -0.081832516 -0.069423632 -0.046083682 0.005932048 [36] -0.049754434 -0.017940056 > (mypacf <- c(rpacf$acf)) [1] 0.358485493 -0.200770137 0.138124357 0.192453026 -0.091179880 [6] 0.028933536 0.168984291 -0.019206280 0.097786451 0.028848940 [11] 0.144201903 -0.186157177 -0.026583902 -0.058238294 -0.010431574 [16] 0.004226832 -0.124896466 -0.085102453 -0.021282261 -0.011567492 [21] 0.081112345 -0.038151346 -0.022504435 -0.126265179 0.110279540 [26] -0.154283472 0.129849890 0.117764724 0.023158402 -0.092029735 [31] 0.016734227 -0.139896842 0.072115478 0.056537550 -0.038267456 [36] -0.092054581 > 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/3sso01259769460.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/41agn1259769460.tab") > > system("convert tmp/17kz61259769460.ps tmp/17kz61259769460.png") > system("convert tmp/274ix1259769460.ps tmp/274ix1259769460.png") > > > proc.time() user system elapsed 0.553 0.307 0.652