Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Number of Tosses
Probability
Chart options
R Code
n <- as.numeric(par1) p <- as.numeric(par2) heads=rbinom(n-1,1,p) a=2*(heads)-1 b=diffinv(a,xi=0) c=1:n pheads=(diffinv(heads,xi=.5))/c bitmap(file='test1.png') op=par(mfrow=c(2,1)) plot(c,b,type='n',main='Law of Averages',xlab='Toss Number',ylab='Excess of Heads',lwd=2,cex.lab=1.5,cex.main=2) lines(c,b,col='red') lines(c,rep(0,n),col='black') plot(c,pheads,type='n',xlab='Toss Number',ylab='Proportion of Heads',lwd=2,cex.lab=1.5) lines(c,pheads,col='blue') lines(c,rep(.5,n),col='black') par(op) dev.off() b par1 <- as.numeric(12) x <- as.array(b) n <- length(x) sx <- sort(x) load(file='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(x,lag=1,differences=smalld) if (bigd > 0) myx <- diff(myx,lag=par1,differences=bigd) a<-table.element(a,var(myx)) a<-table.element(a,'Range',header=TRUE) a<-table.element(a,max(myx)-min(myx)) a<-table.element(a,'Trim Var.',header=TRUE) smyx <- sort(myx) sn <- length(smyx) a<-table.element(a,var(smyx[smyx>quantile(smyx,0.05) & smyx<quantile(smyx,0.95)])) a<-table.row.end(a) } } a<-table.end(a) table.save(a,file='mytable.tab')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation