Description Usage Arguments Value Author(s) See Also Examples
generates an appropriate initial sample of parameter vectors for twDEMC from subsampling a matrix
1 2 3 | ## S3 method for class 'matrix'
initZtwDEMCSub(x, ..., vars = colnames(x), nChainPop = 4,
nPop = 1, m0 = calcM0twDEMC(length(unique(vars)), nChainPop))
|
x |
the mcmc matrix to subsample (nCases x nParms) |
... |
|
vars |
which variables to keep |
nChainPop |
number of chains per population |
nPop |
number of populations |
m0 |
number of required cases for initialization |
an array of dimension suitable for Zinit for twDEMCBlockInt
Thomas Wutzler
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(twLinreg1)
attach( twLinreg1 )
.nChainPop=4
.nPop=2
.nPar=length(theta0)
Zinit <- initZtwDEMCNormal( theta0, diag(sdTheta^2), nChainPop=.nChainPop, nPop=.nPop)
ss <- do.call( rbind, twMisc::twListArrDim( Zinit)) #stack the chains
ZinitSub <- initZtwDEMCSub(ss, nChainPop=.nChainPop, nPop=.nPop)
head(Zinit[,,1])
all.equal(dim(Zinit),dim(ZinitSub))
detach()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.