initZtwDEMCSub.matrix: initZtwDEMCSub matrix

Description Usage Arguments Value Author(s) See Also Examples

Description

generates an appropriate initial sample of parameter vectors for twDEMC from subsampling a matrix

Usage

1
2
3
## S3 method for class 'matrix'
initZtwDEMCSub(x, ..., vars = colnames(x), nChainPop = 4, 
    nPop = 1, m0 = calcM0twDEMC(length(unique(vars)), nChainPop))

Arguments

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

Value

an array of dimension suitable for Zinit for twDEMCBlockInt

Author(s)

Thomas Wutzler

See Also

initZtwDEMCNormal

Examples

 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()

twDEMC documentation built on May 2, 2019, 5:38 p.m.