SaveOutput: Save the twalk MCMC output to a file.

Description Usage Arguments Value Author(s) References See Also Examples

Description

Save the twalk MCMC output to a file.

Usage

1
2
SaveOutput( info, file, pars=1:(info$dim), from=1, to=info$Tr,
	row.names=FALSE, col.names=paste("X", pars), ...)

Arguments

info

as returned from Runtwalk.

file

name of file to write results to (of not "").

from

iteration number to start saving (from=0 begings at initialization point).

to

last iteration to save.

pars

parameters to save (defaults to all).

row.names, col.names, ...

parameters passed to write.table.

Value

write.table object.

Author(s)

J Andres Christen (CIMAT, Guanajuato, MEXICO).

References

Christen JA and Fox C (2010). A general purpose sampling algorithm for continuous distributions (the t-walk)., Bayesian Analysis, 5 (2), 263-282. URL: http://ba.stat.cmu.edu/journal/2010/vol05/issue02/christen.pdf

See Also

Runtwalk for running the twalk.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
  

#### We first load the twalk package:
library(Rtwalk)



#### A ver simple inline example, 4 independent normals N(0,1):
######        dimension,  num of it, -log of objective function besides a const, support,
info <- Runtwalk( dim=4,  Tr=1000,  Obj=function(x) { sum(x^2)/2 }, Supp=function(x) { TRUE },
	x0=runif(4, min=20, max=21), xp0=runif(4, min=20, max=21)) 
####  and two (intentionally bad) initial points


### Save the twalk MCMC output as columns in a table
SaveOutput( info, file="Tsttwalk.dat")

Rtwalk documentation built on May 2, 2019, 3:45 a.m.

Related to SaveOutput in Rtwalk...