Description Usage Arguments Details Value See Also Examples
This function is a wrapper function which calls the appropriate Metropolis algorithm depending on the hyperpriori which is chosen.
1 2 3 4 |
convList |
output of
|
whichPriori |
character string specifying the chosen
hyperpriori. Options are |
prioriPars |
vector or matrix of parameters for the specified hyperpriori in whichPriori |
startValsAlpha |
matrix with dimension
|
startValsBeta |
array with dimension
|
sample |
the sample size to be saved in output.
Total length of chain will be burnin |
burnin |
number of draws to be cut away from the
beginning of the Markov-Chain. |
thinning |
number specifying the thinning interval.
|
verbose |
an integer specifying whether the progress of the sampler is printed to the screen (defaults to 0). If verbose is greater than 0, the iteration number is printed to the screen every verboseth iteration |
betaVars |
array-object with dimensions |
alphaVars |
matrix of dimensions |
retBeta |
logical |
seed |
Default is |
The whichPriori
-parameter has the options
"gamma"
or "expo"
and corresponding
prioriPars
-parameters in a "list"
:
"expo"
and numeric
list-element called
"lam"
corresponding to: α_{rc} \sim
Exp(λ)
"expo"
and matrix
list-element called "lam"
corresponding to:
α_{rc} \sim Exp(λ_{rc})
"gamma"
and two numeric
list-element called
"shape"
and "rate"
corresponding to:
α_{rc} \sim Gamma(λ_1, λ_2)
"gamma"
and two matrix
list-element called
"shape"
and "rate"
corresponding to:
α_{rc} \sim Gamma(λ_1^{rc},
λ_2^{rc})
The "seed"
attribute is generated by the
.Random.seed
-function.
list
-Object with elements:
alphaDraws
mcmc
-object
cellCounts
mcmc
-object
betaDraws
mcmc
-object
betaAcc
"numeric"
with Acceptance ratios
alphaAcc
"numeric"
with Acceptance
ratios
alphaVars
matrix
with variances
for proposal density
betaVars
array
with variances for proposal density
convertEiData
,
runMBayes
, mcmc
tuneVars
,
indAggEi
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 31 | ## Not run:
# loading some fake election data
data(topleveldat)
form <- cbind(CSU_2, SPD_2, LINK_2, GRUN_2) ~ cbind(CSU_1, SPD_1, Link_1)
conv <- convertEiData(form=form, aggr=aggr, indi=indi, IDCols=c("ID","ID"))
set.seed(1234)
res <- runMBayes(conv, sample=1000, thinning=2, burnin=100,verbose=100)
## !!! not an eiwild object !!!
class(res)
# better to use indAggEi
set.seed(12345)
res2 <- indAggEi(form=form, aggr=aggr, indi=indi, IDCols=c("ID","ID"),
sample=1000, thinning=2, burnin=100,verbose=100)
class(res2)
summary(res2)
# with individual alpha-hyperpriori-parameters
hypMat <- list(shape = matrix(c(30,4,4,4,
4,30,4,4,
4,4,30,4), nrow=3, ncol=4, byrow=TRUE),
rate = matrix(c(1,2,2,2,
2,1,2,2,
2,2,1,2), nrow=3, ncol=4, byrow=TRUE))
set.seed(12345)
res2 <- indAggEi(form=form, aggr=aggr, indi=indi, IDCols=c("ID","ID"),
sample=1000, thinning=2, burnin=100, verbose=100,
prioriPars=hypMat, whichPriori="gamma")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.