R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(4143,4429,5219,4929,5761,5592,4163,4962,5208,4755,4491,5732,5731,5040,6102,4904,5369,5578,4619,4731,5011,5299,4146,4625,4736,4219,5116,4205,4121,5103,4300,4578,3809,5657,4248,3830,4736,4839,4411,4570,4104,4801,3953,3828,4440,4026,4109,4785,3224,3552,3940,3913,3681,4309,3830,4143,4087,3818,3380,3430,3458,3970,5260,5024,5634,6549,4676) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 () > #Author: root > #To cite this work: Wessa P., (2012), Variance Reduction Matrix (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_variancereduction.wasp/ > #Source of accompanying publication: > # > par1 <- as.numeric(par1) > n <- length(x) > sx <- sort(x) > > #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,'Variance Reduction Matrix',6,TRUE) > a<-table.row.end(a) > for (bigd in 0:2) { + for (smalld in 0:3) { + mylabel <- 'V(Y[t],d=' + mylabel <- paste(mylabel,as.character(smalld),sep='') + mylabel <- paste(mylabel,',D=',sep='') + mylabel <- paste(mylabel,as.character(bigd),sep='') + mylabel <- paste(mylabel,')',sep='') + a<-table.row.start(a) + a<-table.element(a,mylabel,header=TRUE) + myx <- x + if (smalld > 0) myx <- diff(myx,lag=1,differences=smalld) + if (bigd > 0) myx <- diff(myx,lag=par1,differences=bigd) + a<-table.element(a,signif(var(myx), digits=6)) + a<-table.element(a,'Range',header=TRUE) + a<-table.element(a,signif(max(myx)-min(myx), digits=6)) + a<-table.element(a,'Trim Var.',header=TRUE) + smyx <- sort(myx) + sn <- length(smyx) + a<-table.element(a,signif(var(smyx[smyx>quantile(smyx,0.05) & smyx a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/1ruqs1355831779.tab") > postscript(file="/var/wessaorg/rcomp/tmp/21e1a1355831779.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,2)) > plot(x,type='l',xlab='time',ylab='value',main='d=0, D=0') > plot(diff(x,lag=1,differences=1),type='l',xlab='time',ylab='value',main='d=1, D=0') > plot(diff(x,lag=par1,differences=1),type='l',xlab='time',ylab='value',main='d=0, D=1') > plot(diff(diff(x,lag=1,differences=1),lag=par1,differences=1),type='l',xlab='time',ylab='value',main='d=1, D=1') > par(op) > dev.off() null device 1 > > try(system("convert tmp/21e1a1355831779.ps tmp/21e1a1355831779.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.035 0.171 1.183