twDEMCBlock.array: twDEMCBlock array

Description Usage Arguments Author(s) Examples

Description

Initialize twDEMCBlockInt by array of initial population and remove those generations from results afterwards

Usage

1
2
3
4
## S3 method for class 'array'
twDEMCBlock(x, ..., nPop = 1, X = NULL, logDenCompX = NULL, 
    upperParBounds = vector("list", nPop), lowerParBounds = vector("list", 
        nPop))

Arguments

x

initial population: a numeric array (M0 x d x nChain) see details in twDEMCBlockInt

...

further arguments to twDEMCBlockInt

nPop

number of populations in x

X

initial state (nParm x nChain)

logDenCompX

numeric matrix (nResComp x nChains) initial state

upperParBounds

list of named numeric vectors: giving upper parameter bounds for each population for exploring subspaces of the limiting distribution, see details , Alternatively a single numeric vector can be supplied, which is replicated for each population.

lowerParBounds

similar to upperParBounds

Author(s)

Thomas Wutzler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
data(twLinreg1)
attach( twLinreg1 )

argsFLogDen <- list(
	fModel=dummyTwDEMCModel,		### the model function, which predicts the output based on theta 
	obs=obs,			### vector of data to compare with
	invCovar=invCovar,		### the inverse of the Covariance of obs (its uncertainty)
	thetaPrior = thetaTrue,	### the prior estimate of the parameters
	invCovarTheta = invCovarTheta,	### the inverse of the Covariance of the prior parameter estimates
	xval=xval
)
do.call( logDenGaussian, c(list(theta=theta0),argsFLogDen))

.nPop = 2
Zinit <- initZtwDEMCNormal( theta0, diag(sdTheta^2), nChainPop=4, nPop=.nPop)
dim(Zinit)

.nGen=100
#nGen=3
#mtrace(twDEMC.array)
#mtrace(.updateIntervalTwDEMCPar)
#mtrace(twDEMCBlockInt)
tmp1 <- tmp <-  twDEMCBlock( Zinit, nPop=.nPop
	,dInfos=list(list(fLogDen=logDenGaussian, argsFLogDen=argsFLogDen))
	,nGen=.nGen 
)
plot( as.mcmc.list(tmp), smooth=FALSE )
tmp2 <- tmp <- twDEMCBlock( tmp1, nGen=200 )

str(tmp)

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