R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(117 + ,116 + ,166 + ,180 + ,202 + ,290 + ,298 + ,441 + ,388 + ,260 + ,175 + ,105 + ,137 + ,142 + ,176 + ,231 + ,240 + ,316 + ,363 + ,537 + ,487 + ,324 + ,185 + ,133 + ,169 + ,157 + ,206 + ,244 + ,243 + ,393 + ,405 + ,579 + ,525 + ,373 + ,198 + ,148 + ,201 + ,177 + ,222 + ,275 + ,290 + ,402 + ,534 + ,614 + ,578 + ,419 + ,203 + ,173 + ,229 + ,192 + ,294 + ,310 + ,365 + ,509 + ,537 + ,655 + ,643 + ,444 + ,259 + ,229 + ,276 + ,245 + ,324 + ,323 + ,349 + ,480 + ,530 + ,676 + ,670 + ,476 + ,281 + ,240 + ,259 + ,237 + ,400 + ,367 + ,497 + ,593 + ,696 + ,969 + ,878 + ,581 + ,373 + ,232 + ,358 + ,318 + ,410 + ,480 + ,604 + ,713 + ,844 + ,1134 + ,1013 + ,755 + ,371 + ,280 + ,417 + ,417 + ,514 + ,548 + ,583 + ,839 + ,924 + ,1179 + ,1109 + ,896 + ,452 + ,337 + ,484 + ,524 + ,575 + ,622 + ,664 + ,926 + ,1028 + ,1361 + ,1304 + ,937 + ,505 + ,427 + ,580 + ,483 + ,625 + ,695 + ,729 + ,1099 + ,1090 + ,1393 + ,1261 + ,988 + ,525 + ,416 + ,516 + ,454 + ,629 + ,755 + ,706 + ,951 + ,1099 + ,1444 + ,1316 + ,1066 + ,585 + ,430 + ,669 + ,598 + ,714 + ,835 + ,912 + ,1031 + ,1210 + ,1581 + ,1416 + ,1120 + ,652 + ,505 + ,741 + ,675 + ,782 + ,956 + ,996 + ,1259 + ,1389 + ,1868 + ,1609 + ,1385 + ,735 + ,577 + ,815 + ,798 + ,940 + ,1007 + ,1094 + ,1413 + ,1552 + ,2038 + ,1762 + ,1411 + ,805 + ,729 + ,912 + ,753 + ,989 + ,1137 + ,1256 + ,1554 + ,1629 + ,2024 + ,1900 + ,1563 + ,905 + ,766 + ,952 + ,915 + ,1197 + ,1242 + ,1197 + ,1522 + ,1591 + ,2128 + ,1962 + ,1653 + ,987 + ,877 + ,990 + ,880 + ,1258 + ,1240 + ,1312 + ,1713 + ,1683 + ,2220 + ,1996 + ,1628 + ,1119 + ,890 + ,1118 + ,1164 + ,1364 + ,1412 + ,1721 + ,1752 + ,1794 + ,2434 + ,2390 + ,1929 + ,1352 + ,1060 + ,1435 + ,1196 + ,1478 + ,1648 + ,1812 + ,2118 + ,2211 + ,2826 + ,2534 + ,2290 + ,1367 + ,1105 + ,1463 + ,1299 + ,1576 + ,1850 + ,1929 + ,2367 + ,2508 + ,3073 + ,2922 + ,2377 + ,1627 + ,1259 + ,1547 + ,1436 + ,1905 + ,2079 + ,1994 + ,2501 + ,2569 + ,3467 + ,2885 + ,2211 + ,1597 + ,1141 + ,1533 + ,1546 + ,1967 + ,2171 + ,2021 + ,2753 + ,2626 + ,3532 + ,3096 + ,2639 + ,1653 + ,1425 + ,1802 + ,1674 + ,1970 + ,2092 + ,2280 + ,2715 + ,2971 + ,3937 + ,3110 + ,2662 + ,1728 + ,1609 + ,1922 + ,1863 + ,1945 + ,2365 + ,2275 + ,2962 + ,2930 + ,4062 + ,3445 + ,2943 + ,1879 + ,1694 + ,2147 + ,1999 + ,2266 + ,2562 + ,2583 + ,2965 + ,3142 + ,4115 + ,3654 + ,2992 + ,2031 + ,1699 + ,2313 + ,1970 + ,2382 + ,2830 + ,2614 + ,3321 + ,3418 + ,4468 + ,3657 + ,3250 + ,2174 + ,2014 + ,2118 + ,2227 + ,2563 + ,2817 + ,2680 + ,3337 + ,3559 + ,4608 + ,3930 + ,3133 + ,2042 + ,1999 + ,2679 + ,2425 + ,2693 + ,2760 + ,2941 + ,3611 + ,3779 + ,4945 + ,4034 + ,2906 + ,2132 + ,1932 + ,2268 + ,2178 + ,2317 + ,2552 + ,2582 + ,2886 + ,3283 + ,4125 + ,3536 + ,2568 + ,1802 + ,1598 + ,2013 + ,1872 + ,2227 + ,2497 + ,2530 + ,3119 + ,3411 + ,4511 + ,3528 + ,2833 + ,1760 + ,1517 + ,1968 + ,1809 + ,2104 + ,2391 + ,2691 + ,3023 + ,3188 + ,4057 + ,3476) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '60' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #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 (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/wessaorg/rcomp/tmp/1poid1323790508.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2mf2c1323790508.ps",horizontal=F,onefile=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=mysub) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/33mpq1323790508.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 0.5679435823 0.5352679302 0.4326760627 0.4521248900 [6] 0.3751051477 0.3428462004 0.2717971227 0.2127238540 0.1848094630 [11] 0.1364829811 0.1750166965 -0.0809554319 0.0718691319 0.0483657331 [16] 0.1058593130 0.0353492375 0.0908480013 0.0902112236 0.1104465800 [21] 0.1245010900 0.1717544449 0.1483003453 0.1593016321 0.2035738762 [26] 0.1557970826 0.1819420626 0.0541722733 0.0790149337 0.0642616886 [31] 0.0260948378 -0.0119415963 -0.0021792452 -0.0771183560 -0.0012151130 [36] -0.0332196328 -0.0941384170 -0.0755507493 -0.1017522304 -0.0035623488 [41] -0.0062697636 -0.0380005962 -0.0585380168 -0.0328572032 -0.0273326902 [46] 0.0467251111 0.0121353873 -0.0245378737 0.0264500293 0.0283079146 [51] 0.0394804195 -0.0806743486 -0.0685672010 -0.0594174560 -0.0441679485 [56] -0.0326451308 -0.0448677450 -0.0942652604 -0.0435592560 -0.0130503971 [61] 0.0001051365 > (mypacf <- c(rpacf$acf)) [1] 0.567943582 0.313987940 0.075001103 0.162567707 0.019127752 [6] 0.007785584 -0.037239716 -0.069520917 -0.007130062 -0.038948814 [11] 0.096896211 -0.357386266 0.211190649 0.099129008 0.055791613 [16] 0.005631776 0.064092884 0.071223252 -0.012698541 0.031358760 [21] 0.082682706 -0.068374781 0.135302647 -0.130620378 0.008884026 [26] 0.050513565 -0.195277400 -0.037988289 0.053423680 -0.065423884 [31] -0.034082838 0.027198473 -0.007482772 0.082806835 0.060579596 [36] -0.167807018 0.032671517 0.062367028 0.009638222 -0.002945231 [41] -0.035710983 -0.068867303 -0.051527409 0.055363459 0.036701564 [46] 0.017804616 -0.044601082 0.032579083 0.009582429 0.011523875 [51] -0.155990425 -0.009856147 0.097480351 -0.034778789 0.014182533 [56] 0.046033893 -0.059252768 0.124857138 0.023082961 -0.010686352 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/4uee91323790508.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/wessaorg/rcomp/tmp/5e13k1323790508.tab") > > try(system("convert tmp/1poid1323790508.ps tmp/1poid1323790508.png",intern=TRUE)) character(0) > try(system("convert tmp/2mf2c1323790508.ps tmp/2mf2c1323790508.png",intern=TRUE)) character(0) > try(system("convert tmp/33mpq1323790508.ps tmp/33mpq1323790508.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.023 0.217 1.239