R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(41,39,50,40,43,38,44,35,39,35,29,49,50,59,63,32,39,47,53,60,57,52,70,90,74,62,55,84,94,70,108,139,120,97,126,149,158,124,140,109,114,77,120,133,110,92,97,78,99,107,112,90,98,125,155,190,236,189,174,178,136,161,171,149,184,155,276,224,213,279,268,287,238,213,257,293,212,246,353,339,308,247,257,322,298,273,312,249,286,279,309,401,309,328,353,354,327,324,285,243,241,287,355,460,364,487,452,391,500,451,375,372,302,316,398,394,431,431) > 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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/1xoac1386173947.tab") > postscript(file="/var/fisher/rcomp/tmp/2x13m1386173947.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/2x13m1386173947.ps tmp/2x13m1386173947.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.627 0.461 2.001