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(900,899,898,896,916,915,900,890,891,891,892,894,896,889,878,883,901,897,881,866,867,866,862,871,865,856,847,859,870,872,856,839,829,825,822,827,822,812,810,816,820,823,810,793,777,772,765,765,753,742,736,740,742,742,728,707,699,696,689,692,673,653,642,648,654,653,630,609,598,601,592,591,568,538,523,530,529,534,513,491,480,478,462,461,437,411,400,405,395,407,385,366,349,343,332,327,306,276,269,268,260,274,247,226,212,199,188,179,155,124,117,116,105,112,86,64,53,42,32,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/14iir1279987333.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/24iir1279987333.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.975178755 0.949739074 0.924408347 0.899522406 [6] 0.874107561 0.849130516 0.824770316 0.799272934 0.773886922 [11] 0.748285140 0.722572794 0.697693022 0.672410040 0.646928520 [16] 0.622019882 0.597502414 0.572829693 0.548779887 0.525634605 [21] 0.501226932 0.476846422 0.452368143 0.428040226 0.404398506 [26] 0.380807007 0.356954759 0.333660803 0.310128768 0.286969402 [31] 0.264203284 0.242203892 0.219282442 0.197004305 0.174419878 [36] 0.152316670 0.130936308 0.110060538 0.088830999 0.068388806 [41] 0.047746719 0.027367264 0.007647206 -0.011250062 -0.030458015 [46] -0.049283150 -0.068404616 -0.086522719 -0.103318110 > (mypacf <- c(rpacf$acf)) [1] 0.975178755 -0.025180938 -0.010670776 -0.004139826 -0.024115602 [6] -0.004313009 -0.001099029 -0.037051075 -0.010978676 -0.018847745 [11] -0.017407492 0.002937650 -0.023755987 -0.019384754 -0.002753367 [16] -0.008509716 -0.018111505 -0.002108324 0.001423424 -0.041106175 [21] -0.014215476 -0.019051454 -0.014364718 -0.001958546 -0.017109107 [26] -0.023290475 -0.004493969 -0.023844733 -0.009176686 -0.008811768 [31] -0.004942702 -0.036260521 -0.003988206 -0.026392795 -0.009003407 [36] -0.003631934 -0.010573377 -0.027208555 -0.001593268 -0.025343728 [41] -0.012864198 -0.005422810 -0.006305032 -0.025720630 -0.010896470 [46] -0.028635028 0.001370992 0.006872656 > 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/3p0yf1279987333.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/4s1x31279987333.tab") > > try(system("convert tmp/14iir1279987333.ps tmp/14iir1279987333.png",intern=TRUE)) character(0) > try(system("convert tmp/24iir1279987333.ps tmp/24iir1279987333.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.563 0.315 0.799